Results 1 to 7 of 7

Thread: custom plug-in widget in another custom plug-in widget.

  1. #1
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default custom plug-in widget in another custom plug-in widget.

    Hi,

    I have created a simple custom LED plug-in widget.
    I can use this plug-in from within QT Designer and also build and use a form
    created within QT Designer in my app.

    In QT Designer I have now created another custom plug-in widget which uses
    this custom LED widget.

    When I try to build this plug-in, it fails to link complaining about:

    Creating library C:\Projects\Gen2_GUI\My Designer Widgets\CollapsibleGroup\Debug\P1_CollapsibleGrp.l ib and object C:\Projects\Gen2_GUI\My Designer Widgets\CollapsibleGroup\Debug\P1_CollapsibleGrp.e xp
    Collapsegrp.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const P1LED::staticMetaObject" (?staticMetaObject@P1LED@@2UQMetaObject@@B)
    Collapsegrpplugin.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const P1LED::staticMetaObject" (?staticMetaObject@P1LED@@2UQMetaObject@@B)
    moc_Collapsegrp.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const P1LED::staticMetaObject" (?staticMetaObject@P1LED@@2UQMetaObject@@B)
    C:\Projects\Gen2_GUI\My Designer Widgets\CollapsibleGroup\Debug\P1_CollapsibleGrp.d ll : fatal error LNK1120: 1 unresolved externals


    I thought this sort of thing is usually related to linking the release build with a debug
    lib or vice versa, but I have verified that I am building and linking the release versions
    of everything.

    This is windows and QT 4.3

    Any suggestions?

    Many Thanks,
    Mark

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: custom plug-in widget in another custom plug-in widget.

    Could you describe the structure of the project? A custom widget can be either built into a designer plugin or the widget can be built as a separate library to which the designer plugin links to. Which is the case of yours? Is the led a separate library or does it get built into the another plugin or what?
    J-P Nurmi

  3. #3
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: custom plug-in widget in another custom plug-in widget.

    LED is a designer plug-in that I wrote and copied to the plugins directory.
    It correctly appears in my QT Designer widget box and I have used it in several forms.

    I am creating a new designer plug-in.
    In QT Designer I have designed my new widget and one of the controls in that
    widget is the LED control which I have pulled on from the QT widget box.

    It previews and operates as desired in QT Designer.

    When I try to build the actual plug-in for this new widget I get the link errors
    described earlier.

    Mark

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: custom plug-in widget in another custom plug-in widget.

    Quote Originally Posted by MrGarbage View Post
    LED is a designer plug-in that I wrote and copied to the plugins directory.
    Do you have sources of LED included to this designer plugin project or is LED a separate library to which this designer plugin links to?

    I am creating a new designer plug-in.
    In QT Designer I have designed my new widget and one of the controls in that
    widget is the LED control which I have pulled on from the QT widget box.
    Do you have sources of LED included to this designer plugin project too, or is LED a separate library to which this designer plugins also links to?
    J-P Nurmi

  5. #5
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: custom plug-in widget in another custom plug-in widget.

    The LED plug-in is source only. It does not link to any libraries.

    The new plug-in which includes the LED widget links with the LED library generated by
    the building of the LED plug-in. This is the same library that I copy to plugins\designer directory to make the LED widget available to QT Designer.

    Thanks in advance!

    Mark

  6. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: custom plug-in widget in another custom plug-in widget.

    I think you have to include the moc result for LED in the other plugin, at the end of the file that generates the errors.

  7. #7
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: custom plug-in widget in another custom plug-in widget.

    Thanks, that did in fact take care of the problem.

    I must say however I don't entirely understand why this is necessary.

    If I create a custom control and in it I include an existing QT widget from the toolkit, I am able to build that widget without including the moc files for that widget in my build.

    It seems as if I should be able to build my custom LED widget such that it behaves like
    an existing QT widget and can be included in another custom control without having to deal with the moc files.

    Mark

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.