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. [Solved] Passing QML object to C++ function
Forum Updated to NodeBB v4.3 + New Features

[Solved] Passing QML object to C++ function

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 4.4k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    Merinas
    wrote on last edited by
    #1

    Hi,

    I'm discovering QML, and i try to pass a QML object to a C++ function of another one. I have read that http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html but i haven't found my answer.

    From now i've tried that
    plugin_test_plugin.h => http://pastebin.com/xdjBzquw
    plugin_test_plugin.cpp => http://pastebin.com/L7kTi7tb
    and here an example of use http://pastebin.com/5zhbzLAU

    In my c++ function i never get the same pointer and this never is a pointer to my QML object.

    Here what i get :

    @A: 14328816
    B: 14358136
    A: 3998072
    A: 14328816
    B: 14358136
    A: 14433544
    A: 14328816
    B: 14358136
    A: 3998088 @

    A is supose to have allways the same value.

    Thanks in advance!

    1 Reply Last reply
    0
    • B Offline
      B Offline
      baysmith
      wrote on last edited by
      #2

      Works for me with Qt 4.7.1. What version of Qt are you using?

      Nokia Certified Qt Specialist.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Merinas
        wrote on last edited by
        #3

        I've updated Qt to 4.7.1 (I was using 4.7) and that works fine now, thanks a lot.

        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