Results 1 to 1 of 1

Thread: Strange icon problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Location
    Auckland, NZ
    Posts
    121
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Strange icon problem

    I have two Qt programs that are very similar. They have the same GUI, sharing the same .ui file, which was created with Qt Creator. The ui file includes a QToolBar that holds 8 QActions. Each action has an icon, the icons are specified in icons.qrc. In the .pro files I have the line:
    RESOURCES += icons.qrc
    The two .pro files are almost identical, except for differences in source file lists. Let's call them good.pro and bad.pro, building good.exe and bad.exe.
    good.exe displays the icons, but bad.exe does not. When I open bad.pro with Qt Creator, open the ui file and select the toolbar object, it does not show the icons on the screen, and the action objects in the object list also do not show the icons, although the file names are there. But when I open good.pro with Qt Creator and open the ui file I can see the icons, both on screen and in the action objects. Note that this the same ui file. If I open the ui file directly with Qt Creator (i.e. not by first opening a .pro file) the icons are not displayed. This is surprising, but not necessarily significant, because I see that some other ui files that give the correct icon display in the executable also don't display the icons when open with Qt Creator.

    I am baffled by this. I am using Qt Creator 2.4.1, and building with the VS2010 compiler.

    Please help!

    Gib

    Sorry! I found my trivial mistake. The line ahead of the RESOURCES line in the bad.pro file had a '\' at the end, the result of some careless editting. When I removed that '\' the icons all returned - now that the icons.qrc file is found.
    Last edited by gib; 26th May 2018 at 11:42. Reason: Solved

Similar Threads

  1. Strange problem with QThread
    By akaWolf in forum Qt Programming
    Replies: 3
    Last Post: 31st May 2013, 15:25
  2. Strange Problem
    By Atomic_Sheep in forum General Programming
    Replies: 3
    Last Post: 7th February 2013, 11:57
  3. Strange problem
    By wirasto in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2009, 12:24
  4. Strange problem
    By pavel in forum Newbie
    Replies: 4
    Last Post: 18th December 2009, 22:46
  5. Very Strange problem
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2008, 10:20

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.