Results 1 to 3 of 3

Thread: What is the proper way to link program against custom designer widget plugin ?

  1. #1
    Join Date
    Apr 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question What is the proper way to link program against custom designer widget plugin ?

    I have a qt project for which I have created a custom designer plugin. It works fine in designer if I copy the dll in $QT_DIR/plugins/designer or set QT_PLUGIN_PATH env. Plugin has to be built in Release config (I use cmake) else designer won't load it.

    Now when building the actual program I naturally do it in Debug config since I'm developing it. The program is linked against the designer plugin. This however causes program to crash at startup with error 'QWidget: Must construct a QApplication before a QPaintDevice'. If designer plugin is also built in Debug config it will work (but then it won't load in designer).

    So a bit confused what's going on here. Is it wrong to link debug code against release code ?

    I'm also a bit unsure whether I should link my app directly with the designer plugin dll OR should I maybe build another, 'ordinary' shared library from same source code, only omitting QDesignerCustomWidgetInterface QDesignerCustomWidgetCollectionInterface related classes ?

    I'm using mingw32 build chain.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What is the proper way to link program against custom designer widget plugin ?

    1. You must build plugin in both modes (debug and release)
    2. Just link to the program this same dll which is used by QDesigner or (as we are doing) for application create a static library with widget.
    Last edited by Lesiok; 2nd December 2010 at 14:58.

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

    jkv (2nd December 2010)

  4. #3
    Join Date
    Sep 2010
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: What is the proper way to link program against custom designer widget plugin ?

    Quote Originally Posted by Lesiok View Post
    2. Just link to the program this same dll which is used by QDesigner or (as we are doing) for application create a static library with widget.
    Please can you describe your build chain? In particular, how do you make your application independent from the plugin's DLL? (My application is linked against the plugin's static library but still requires the plugin's DLL at runtime.)

    Thanks

Similar Threads

  1. QT4 custom designer plugin properties ignored
    By Intangir in forum Qt Programming
    Replies: 7
    Last Post: 23rd May 2015, 12:56
  2. Replies: 1
    Last Post: 6th May 2010, 11:09
  3. Replies: 4
    Last Post: 5th March 2010, 15:20
  4. problem loading custom plugin on Qt Designer 4
    By raman_31181 in forum Qt Tools
    Replies: 18
    Last Post: 26th September 2008, 10:42
  5. custom plugin designer property with out a variable?
    By high_flyer in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2006, 20:11

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.