What is the associate type of QList<QPair<double, QString>> in qml?
-
@class whatever: public QObject
{
Q_OBJECT
public:
explicit generalUnitConverter(QObject *parent = nullptr);QList<QPair<double, QString>> do_something();
}@
How could I access the data return by do_something in qml?
-
I don't think you can access the data return by do_something in qml.
-
[quote author="Vincent007" date="1388213398"]I don't think you can access the data return by do_something in qml.[/quote]
nevermind, I could return the double and QString with two function calls -
You can return QVariantList, "QVariantList and QVariantMap to JavaScript Array and Object":http://qt-project.org/doc/qt-5/qtqml-cppintegration-data.html