Results 1 to 20 of 22

Thread: Image resources (png, ico) not rendering in app

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Image resources (png, ico) not rendering in app

    The more important part of anda_skoa's question is whether the resources you are trying to use are in your app EXE or if they are in a DLL you are dynamically loading into your app. If they are in a DLL, you'll need to put a Q_INIT_RESOURCE() macro in main() after your QApplication instance is declared so it will load them properly:

    Qt Code:
    1. QApplication app( argc, argv );
    2.  
    3. Q_INIT_RESOURCE( MyDLL );
    To copy to clipboard, switch view to plain text mode 

    (assuming your DLL is named "MyDLL.dll")

    In Visual Studio, right-click on your qrc file name in the Solution Browser and go to the General properties page. It should look something like the attached screenshot; basically, it should be running rcc on the resource file and putting something in the GeneratedFiles directory.

    Capture.jpg
    Last edited by d_stranz; 16th February 2017 at 03:35.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 4
    Last Post: 28th April 2014, 12:01
  2. load image from resources in library
    By stevocz in forum Newbie
    Replies: 0
    Last Post: 11th July 2013, 09:21
  3. Replies: 5
    Last Post: 10th October 2012, 21:05
  4. Replies: 2
    Last Post: 14th January 2012, 22:39
  5. Speeding up Image Rendering
    By reno77 in forum Newbie
    Replies: 2
    Last Post: 15th June 2010, 09:58

Tags for this Thread

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.