Skip to content

How to get list results from QVariant #97

Description

@RuoyanMeng

Hi, I am using pythonQt to embed python code in my C++ code, I create a python function as the example did, but my return value is a list, and I couldn't fetch the list value after calling the function
context.evalScript("def multiply(a,b):\n return [a,b];\n");
QVariantList args;
args << 42 << 47;
QVariant result = context.call("multiply", args);

Could you give some idea on how to get the result when the return value is a list?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions