Fixed unsupported variant type: 1024 (QJSValue)#140
Open
Fixed unsupported variant type: 1024 (QJSValue)#140
Conversation
Added proper casting from QMetaType::User (1024) with userType 1034 (i.e., QJSValue) to QVariant so it can be handled properly by the packDataValue method.
This was referenced Jan 23, 2015
|
I tried this with limetext/qml .. however for me the userType is 1051 ... will try a way to not hardcode this |
|
Here is what i ended up with, which seems to work: diff --git a/cpp/capi.cpp b/cpp/capi.cpp
index 55ac585..c2255aa 100644
--- a/cpp/capi.cpp
+++ b/cpp/capi.cpp
@@ -745,7 +745,8 @@ void packDataValue(QVariant_ *var, DataValue *value)
break;
case QMetaType::User:
{
- if (qvar->userType() == 1034) {
+ static const int qjstype = QVariant::fromValue(QJSValue()).userType();
+ if (qvar->userType() == qjstype) {
auto var = qvar->value<QJSValue>().toVariant();
packDataValue(&var, value);
} |
Author
|
Confirmed. @pjoe change works. Updated PR. |
Program called "Moom" (http://manytricks.com/moom/) which uses OS X's accesibility API could cause a crash with calling the log handler with a null file in context.
Contributor
|
We need a test case exercising the issue to make sure we understand the problem and it doesn't not regress. Also, can you please sign the agreement so we can get the change in: |
|
@Niemyer, please can you merge this in. It's really useful. |
zoli
added a commit
to limetext/lime-qml
that referenced
this pull request
Apr 24, 2016
using github.com/limetext/qml-go instead of gopkg.in/qml.v1 which it seems its not under development anymore. also applyed go-qml/qml#140 closes #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added proper casting from QMetaType::User (1024) with userType 1034 (i.e.,
QJSValue) to QVariant so it can be handled properly by the packDataValue
method.