Results 1 to 5 of 5

Thread: Action Icons not showing when running app

  1. #1
    Join Date
    Jan 2010
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Action Icons not showing when running app

    Hello,

    I'm pretty new to Qt and C++ so please let me know if I am not asking the right questions or if this isn't the correct place to post this.

    I am currently running Qt Creator 1.3.1 / Qt 4.6.1 (32 bit) on Windows XP. The issue I am experiencing is when in Qt Designer I create new action in the action editor I can see the icon that I have associated with the action, I can move the action to the action tool bar and see the icon, but when I run the app the icon does not show. This also happens foraction icons in the menu bar. When I roll over the area where the icon is supposed to be there is a clickable space visable where the icon should be. In the property explorer under QAction/icon I've added the same icon to Normal Off, Normal On, and Active On but it doesn't show.

    Any ideas?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Action Icons not showing when running app

    Did you use relative path to your icons? They differ when running your applications because then the starting point of relative paths are the directory containing the exe. Try to use Qt resource system.

  3. The following 2 users say thank you to Lykurg for this useful post:

    jimmydean101 (28th February 2010), waynew (10th August 2010)

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

    Default Re: Action Icons not showing when running app

    Hey Lykurg,

    I'm learning a lot here today. I am trying to do everything through the Designer that I can. I had assumed that when I selected a particular file for the icon that a .qrc file was going to be created and that RESOURCES was going to be added automatically to the .pro file. I went and created a new .qrc file and added the file folder with all the images files. I'm now selecting the files from the resource and it's working now.

    Thanks

  5. #4
    Join Date
    May 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Lightbulb Re: Action Icons not showing when running app

    You need to use qt plugin qico:
    1. add in .pro
    "....
    CONFIG += staticlib
    QTPLUGIN += qico"

    2. add in .h (mainwindow.h)
    "
    .....
    #include <QtCore/QtPlugin>

    Q_IMPORT_PLUGIN(qico);
    "
    3. copy files <QT Dir>/plugins/imageformats/libqico*.a to <QT Dir>/lib

    P.S. I'm use QT with static

  6. #5
    Join Date
    Oct 2010
    Posts
    19
    Qt products
    Qt4

    Default Re: Action Icons not showing when running app

    have the same problem. How to correct this trouble? When i start app all icons from buttons disappear. But in editor i see them. My *.pro file

    Qt Code:
    1. QT += phonon \
    2. multimedia
    3. TARGET = CorePlayer
    4. TEMPLATE = app
    5. DESTDIR = ../Qplayer/bin
    6. SOURCES += src/main.cpp \
    7. src/mainwindow.cpp \
    8. src/widesearch.cpp
    9. HEADERS += src/mainwindow.h \
    10. src/widesearch.h
    11. FORMS += src/mainwindow.ui \
    12. src/tageditor.ui
    13. RESOURCES += images/coreplayer.qrc
    14.  
    15.  
    16.  
    17.  
    18. win32 {
    19. INCLUDEPATH += src/taglib-1.6.3-mingw-bin/include \
    20. INCLUDEPATH += src/flac-1.2.1-devel-win/include \
    21.  
    22. LIBS += ../Qplayer/src/taglib-1.6.3-mingw-bin/lib/libtag.dll.a
    23. LIBS += ../Qplayer/src/flac-1.2.1-devel-win/lib/libFLAC.lib
    24.  
    25. }
    26.  
    27. OTHER_FILES +=
    28.  
    29. OBJECTS_DIR = $${DESTDIR}/obj
    30. MOC_DIR = $${DESTDIR}/obj
    31. RCC_DIR = $${DESTDIR}/obj
    32. UI_DIR = ./src/
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Action editor and MultiSize Icons
    By mcosta in forum Qt Tools
    Replies: 4
    Last Post: 28th May 2008, 19:29
  2. Showing QMainWindow without showing a child QWidget
    By discostu in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2007, 09:03
  3. svg icons not showing up
    By ePharaoh in forum Qt Programming
    Replies: 6
    Last Post: 6th April 2006, 15:56
  4. Missing action icons
    By ReilenBlaeyze in forum KDE Forum
    Replies: 4
    Last Post: 20th February 2006, 12:05
  5. No action checked in an exclusive action group
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 13th February 2006, 06:19

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.