You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, September 18th 2012, 11:48pm

Custom Icon Missing from Window Menu Bars

Icons show up fine on my system, but when installed on systems without Qt, the custom icon does not display, the default icon displays enstead. However, the Desktop and the Taskbar displays my custom icon just fine.

Things Already Tried/Done:

Yes, both QtCore4.dll, and QtGui4.dll are included.

Additionally, I have run the executable through Dependency Walker and all dependencies are included in my Setup project/build. Nothing appears to be missing from the build.

I have a foo.qrc file with the customIcon.ico file and an foo.rc file that has the same. The *.rc file provides the icon on the desktop and taskbar. It seems to be working fine.

The puzzler is the Qt window icons show up fine on my system and on another developers system, but not on non-Qt systems.

How do I fix this?

System: Win7 Prof 64bit, Visual Studio 10, Qt 4.8.1

Thanks;
masher333

PiQuer

Unregistered

2

Monday, November 18th 2013, 9:43pm

Hi masher333,

I had the same problem last week. The reason was, that Qt didn't know, where to find its plugins. Here is how I solved it:
You need to tell Qt, where to find the root plugin folder (/directory):

qApp->addLibraryPath(PATH);

where "qApp" is a Subclass of QApplication and "PATH" is the root folder of the qt plugins, for example: C:\QtSDK\5.0.1\mingw47_32\plugins
Note: If you copy the plugin folder to the folder where your executable is, you still need to tell qt where the pluginfolder is located!
Oh, btw, you don't need the full plugin folder. It contains debug and release versions and not all plugins are necessary....

You find more information under this link:
http://qt-project.org/doc/qt-4.8/deployment-windows.html