Results 1 to 2 of 2

Thread: Q_EXPORT_PLUGIN2 proplem

  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Q_EXPORT_PLUGIN2 proplem

    Hi,

    Qt4.1.0 GPL, MinGW, WinXP.
    I am trying to implement a QtDesigner plugin following the AnalogCLock example:
    http://doc.trolltech.com/4.0/designe...getplugin.html
    The online version of this example and the one which comes with the GPL bundle, are not the same.
    The online version says:
    Finally, we use the Q_EXPORT_PLUGIN macro to export the AnalogClockPlugin class for use with Qt Designer:

    Q_EXPORT_PLUGIN(AnalogClockPlugin)

    This macro ensures that Qt Designer can access and construct the custom widget. Without this macro, there is no way for Qt Designer to use the widget.
    And the other:
    Finally, we use the Q_EXPORT_PLUGIN() macro to export the AnalogClockPlugin class for use with Qt Designer:
    Q_EXPORT_PLUGIN2(customwidgetplugin, AnalogClockPlugin)
    This macro ensures that Qt Designer can access and construct the custom widget. Without this macro, there is no way for Qt Designer to use the widget.
    However, that for it self is not my problemm since with both I get the following compile error:
    89 C:\Dev-Cpp\projects\PStyledButtonPlugIn\pstyledbuttonplug in.cpp expected constructor, destructor, or type conversion at end of input
    And here is the offending code from the PStyledButtonPlugin implementation file :
    Qt Code:
    1. //Q_EXPORT_PLUGIN(PStyledButtonPlugin)
    2. Q_EXPORT_PLUGIN2(PStyledButton, PStyledButtonPlugin)
    To copy to clipboard, switch view to plain text mode 

    Where the first parameter is the cutom widget class name, and the secod the plugin implementation class name.

    What am I doing wrong?

    P.S
    Here is the macro decleration in qplugin.h:
    Qt Code:
    1. # define Q_EXPORT_PLUGIN2(PLUGIN, PLUGINCLASS) \
    2. Q_PLUGIN_VERIFICATION_DATA \
    3. Q_EXTERN_C Q_DECL_EXPORT \
    4. const char * Q_STANDARD_CALL qt_plugin_query_verification_data() \
    5. { return qt_plugin_verification_data; } \
    6. Q_EXTERN_C Q_DECL_EXPORT QObject * Q_STANDARD_CALL qt_plugin_instance() \
    7. Q_PLUGIN_INSTANCE(PLUGINCLASS)
    To copy to clipboard, switch view to plain text mode 
    As you can see, the PLUGIN parmeter is not used, which is strange...
    But either way, I can't make out what I am doing wrong...
    Last edited by high_flyer; 1st February 2006 at 21:38.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Q_EXPORT_PLUGIN2 proplem [solved]

    The problem was I didn't include #include <QtCore/qplugin.h>.

Similar Threads

  1. QThread exec proplem to stop...
    By patrik08 in forum Qt Programming
    Replies: 29
    Last Post: 21st May 2007, 08:51

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.