Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. What is the associate type of QList<QPair<double, QString>> in qml?
QtWS25 Last Chance

What is the associate type of QList<QPair<double, QString>> in qml?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 3.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stereomatching
    wrote on last edited by
    #1

    @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?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vincent007
      wrote on last edited by
      #2

      I don't think you can access the data return by do_something in qml.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stereomatching
        wrote on last edited by
        #3

        [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

        1 Reply Last reply
        0
        • V Offline
          V Offline
          Vincent007
          wrote on last edited by
          #4

          You can return QVariantList, "QVariantList and QVariantMap to JavaScript Array and Object":http://qt-project.org/doc/qt-5/qtqml-cppintegration-data.html

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved