Results 1 to 3 of 3

Thread: Using Q_INIT_RESOURCE() in a designer plugin...

  1. #1
    Join Date
    Jan 2006
    Location
    Florida
    Posts
    24
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Angry Using Q_INIT_RESOURCE() in a designer plugin...

    I have a static library that I have that includes a resource file of .png files, we'll call it libA

    I want to link libA into a designer plugin library I am making called DesignerLibB.

    The problem is that I can see 99.95% of the expected interaction between libA and DesignerLibB in designer BUT, whenever I try to load one of the resources in libA (for instance in the paintEvent of libA), the resource doesn't load.

    I read the documentation and it says that in some cases where resources are in an included libary you need to add Q_INIT_RESOURCE to the main() of the application to initiate the resources. I actually converted DesignerLibB into a standalone application (with a main()) and I am seeing the .png file from libA in that case (so I know it's not a code problem persay).

    My question is, since designer plugins don't have main() functions, where do I put the Q_INIT_RESOURCE() call? I've tried putting it into the constructor of libA and DesignerLibB and in both cases compiler errrors result.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using Q_INIT_RESOURCE() in a designer plugin...

    In the initialize method of the plugin.

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

    thawkins (26th March 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Florida
    Posts
    24
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default (solved) Using Q_INIT_RESOURCE() in a designer plugin...

    Quote Originally Posted by wysota View Post
    In the initialize method of the plugin.
    That did it. I should have thought of that.

Similar Threads

  1. Replies: 1
    Last Post: 22nd January 2007, 12:13
  2. Replies: 13
    Last Post: 15th December 2006, 11:52
  3. Replies: 5
    Last Post: 23rd May 2006, 11:40
  4. custom plugin designer property with out a variable?
    By high_flyer in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2006, 19:11
  5. Size of a plugin widget in designer
    By high_flyer in forum Qt Programming
    Replies: 4
    Last Post: 28th February 2006, 13:29

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.