Results 1 to 20 of 23

Thread: Return QObject undefined

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Oct 2007
    Posts
    78
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Return QObject undefined

    Thank you Wysota, the problem I was having was experimenting with other possibilities and I did not back that code out before attempting the qmlRegisterType.

    I have noticed that QML behaves differently when these objects are passed to the script as a signal. I have added to the previous code example that reproduces this.

    The update adds a singleShot QTimer that passed the object1 twice to the script. Once declared class and the second as a QObject.

    When passed as a class it is casted as a QVariant and I will not have access to any properties or slots.

    When passed as a QObject I will have access to properties but is also casted differently then when it is passed using the doSomething() function. (Clickign anywhere in the window)

    I could not find anyway to cast it from a QVariant in the script so I could access it properly. Also a little confused why it is casting the same object type differently.
    Attached Files Attached Files

Similar Threads

  1. undefined reference to `QUiLoader::QUiLoader(QObject*)'
    By ashukla in forum Qt Programming
    Replies: 7
    Last Post: 7th October 2011, 18:05
  2. Return value to QList
    By lyucs in forum Newbie
    Replies: 7
    Last Post: 16th October 2009, 02:31
  3. undefined reference to QObject
    By hcerny in forum Qt Programming
    Replies: 2
    Last Post: 2nd May 2008, 16:55
  4. Replies: 1
    Last Post: 31st October 2007, 14:14
  5. Replies: 1
    Last Post: 18th June 2006, 10:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.