Results 1 to 18 of 18

Thread: QMetaObject::invokeMethod: Unable to handle unregistered datatype 'quit16'

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QMetaObject::invokeMethod: Unable to handle unregistered datatype 'quit16'

    I'm suffering from this same problem, and I have a single-threaded application.

    I invoke QTcpSocket in a separate class as a static object with no parent (attempting to set a parent after it has been instantiated seems to confuse QObject and create free() errors on shutdown). An entirely different class then takes this socket and tries to make it connect to a remote server.

    Here's what the connection looks like:
    Qt Code:
    1. QTcpSocket * mySocket = &formBasePlugin::socketServer;
    2. mySocket->connectToHost(ui.lineEditHost->text(), ui.spinBoxPort->value(), QIODevice::ReadWrite);
    To copy to clipboard, switch view to plain text mode 
    Life without passion is death in disguise

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMetaObject::invokeMethod: Unable to handle unregistered datatype 'quit16'

    Quote Originally Posted by KShots View Post
    a static object with no parent
    http://www.trolltech.com/developer/t...entry&id=90881

    Quote Originally Posted by KShots View Post
    attempting to set a parent after it has been instantiated seems to confuse QObject and create free() errors on shutdown
    Every QObject that has a parent will be deleted when it's parent gets destroyed, but on the other hand you can't delete static objects. So either make that object non-static or reparent it again.

  3. The following user says thank you to jacek for this useful post:

    KShots (8th February 2007)

  4. #3
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QMetaObject::invokeMethod: Unable to handle unregistered datatype 'quit16'

    Ah, I think I see the problem, then. Although they fixed the bug you mention in 4.2.0, I am using 4.1.4 (latest version available that plays nice with dbus). So... I'll see if I can find a way to make this thing work without a static socket. Thanks!
    Life without passion is death in disguise

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMetaObject::invokeMethod: Unable to handle unregistered datatype 'quit16'

    Quote Originally Posted by KShots View Post
    I'll see if I can find a way to make this thing work without a static socket.
    Maybe QObject::moveToThread() will be enough?

  6. The following user says thank you to jacek for this useful post:

    KShots (8th February 2007)

  7. #5
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QMetaObject::invokeMethod: Unable to handle unregistered datatype 'quit16'

    That worked - the socket is still static, but it is now functional .

    Thanks!
    Life without passion is death in disguise

Similar Threads

  1. Replies: 4
    Last Post: 4th July 2012, 07:37
  2. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  3. Replies: 3
    Last Post: 18th May 2008, 18:36

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.