Results 1 to 2 of 2

Thread: QVariant to QAxObject*

  1. #1
    Join Date
    Sep 2007
    Location
    Russia
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QVariant to QAxObject*

    I have QVariant value. It tapeName() == "QAxObject*".
    How can I convert this QVariant value to QAxObject*?

    This doesn't work:
    Qt Code:
    1. QVariant v = ....; // Here I init my QVariant value
    2. QAxObject* axObject = v.value<QAxObject*>();
    To copy to clipboard, switch view to plain text mode 
    It return a compiler error: 'qt_metatype_id' : is not a member of 'QMetaTypeId<T>'

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QVariant to QAxObject*

    read more about
    Qt Code:
    1. int qRegisterMetaType ( const char * typeName )
    To copy to clipboard, switch view to plain text mode 
    http://doc.trolltech.com/4.4/qmetatype.html

Similar Threads

  1. Replies: 8
    Last Post: 16th July 2008, 14:05
  2. QVariant compile errors
    By ntp in forum Installation and Deployment
    Replies: 3
    Last Post: 14th May 2008, 19:07
  3. Replies: 1
    Last Post: 15th April 2008, 23:15
  4. Crash caused by QVariant (mis)use
    By mclark in forum Newbie
    Replies: 2
    Last Post: 31st October 2006, 15:05
  5. QVariant types support for custom properties
    By Dusdan in forum Qt Tools
    Replies: 9
    Last Post: 11th January 2006, 09:55

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.