Results 1 to 3 of 3

Thread: Toolbar action icons disappear under Ubuntu 12.04

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

    Default Toolbar action icons disappear under Ubuntu 12.04

    I have just ported my Qt program from Windows (where I use Qt 4.6) to Ubuntu 12.04 (where I use Qt 4.8). The program works fine in Windows, but in Ubuntu there is a problem with the toolbar icons. The icons are all visible in Designer, and when I view the .qrc file in the Qt Creator editor, but at runtime they do not display. I have checked that the .cpp file generated from icons.qrc is the same for both OSs. Any suggestions?
    Thanks
    Gib

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Toolbar action icons disappear under Ubuntu 12.04

    Here are some guesses:
    • The image format plugin needed for the icon images is not present in your run time environment
    • The paths to icons in the program are not referencing the resource file, e.g "images/file.png" vs. ":images/file.png", and only worked by accident on Windows. The build directory structure is generally different between Windows and Unix so files accessed by relative paths may not be where you expect.

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

    Default Re: Toolbar action icons disappear under Ubuntu 12.04

    Quote Originally Posted by ChrisW67 View Post
    Here are some guesses:
    • The image format plugin needed for the icon images is not present in your run time environment
    • The paths to icons in the program are not referencing the resource file, e.g "images/file.png" vs. ":images/file.png", and only worked by accident on Windows. The build directory structure is generally different between Windows and Unix so files accessed by relative paths may not be where you expect.
    Thanks for responding.

    The images are .png. They display correctly everywhere, as far as I can tell, e.g. they show up in Qt Designer. Qt examples that use .png icon files all display the icons correctly, which makes me think that any needed plugin is present. If I'm wrong, how can I check that the image format plugin is present? I thought of using these examples (e.g. the Application example) to help resolve this issue, but these are not directly comparable with what I'm doing, because I am generating a form as a .ui file using Designer, while the examples all seem to build the UI programmatically.

    The paths to the icon files are correctly referenced in the resource file, and the file qrc_icons.cpp that is automatically generated from them is the same as that generated on Windows.

Similar Threads

  1. Icons on toolbar
    By tndave in forum Newbie
    Replies: 2
    Last Post: 8th July 2010, 02:47
  2. ToolBar Action With Menu
    By indifference in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2007, 19:37
  3. Replies: 3
    Last Post: 1st October 2006, 15:03
  4. Toolbar & Icons missing
    By raphaelf in forum Qt Tools
    Replies: 2
    Last Post: 27th February 2006, 22:19
  5. Missing action icons
    By ReilenBlaeyze in forum KDE Forum
    Replies: 4
    Last Post: 20th February 2006, 12:05

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.