I could have forgotten that, but I didn't. I see the .qrc file in the file list in QtCreator, and when I double-click on it I see all the icons. It is very strange.
I could have forgotten that, but I didn't. I see the .qrc file in the file list in QtCreator, and when I double-click on it I see all the icons. It is very strange.
Forget QtCreator. Open the .pro file and see what's in there. Also make sure if you have appropriate imageformat plugins deployed if you are using icon formats other than png.
Yes, I have looked in the .pro file, and it contains
RESOURCES += icons.qrc
I've also tried building from the command line, with qmake then make. No difference.
The icon formats are all png.
I've also looked in the .h file that uic creates from the .ui file, and I see sections like
QIcon icon1;
icon1.addFile(QString::fromUtf8(":/icons/001_29.png"), QSize(), QIcon::Normal, QIcon::Off);
action_stop->setIcon(icon1);
action_run = new QAction(MainWindow);
action_run->setObjectName(QString::fromUtf8("action_run"));
Does this look OK?
(BTW thanks for responding)
Last edited by gib; 6th September 2010 at 07:53.
Yes, it looks ok. From the console run make distclean, rerun qmake and see if you get any warnings. If you do, post them here. If not, continue with make. Then note the size of the resulting binary and repeat the process after commenting out the "RESOURCES += icons.qrc" line from your .pro file. Compare binary sizes and see if they differ.
The make distclean output was:
C:\Users\Gib\ABM_GUI>make distclean
c:\Qt\4.6.3\bin\qmake.exe -win32 -o Makefile ABM_GUI.pro
mingw32-make -f Makefile.Release distclean
mingw32-make[1]: Entering directory `C:/Users/Gib/ABM_GUI'
del release\moc_mainwindow.cpp release\moc_qmylabel.cpp release\moc_misc.cpp
del ui_ABM_GUI.h
del release\main.o release\mainwindow.o release\params.o release\plot.o release\
myvtk.o release\misc.o release\lognormal.o release\moc_mainwindow.o release\moc_
qmylabel.o release\moc_misc.o
del release\ABM_GUI.exe
del Makefile.Release
mingw32-make[1]: Leaving directory `C:/Users/Gib/ABM_GUI'
mingw32-make -f Makefile.Debug distclean
mingw32-make[1]: Entering directory `C:/Users/Gib/ABM_GUI'
del debug\moc_mainwindow.cpp debug\moc_qmylabel.cpp debug\moc_misc.cpp
Could Not Find C:\Users\Gib\ABM_GUI\debug\moc_mainwindow.cpp
del ui_ABM_GUI.h
Could Not Find C:\Users\Gib\ABM_GUI\ui_ABM_GUI.h
del debug\main.o debug\mainwindow.o debug\params.o debug\plot.o debug\myvtk.o de
bug\misc.o debug\lognormal.o debug\moc_mainwindow.o debug\moc_qmylabel.o debug\m
oc_misc.o
Could Not Find C:\Users\Gib\ABM_GUI\debug\main.o
del debug\ABM_GUI.exe
Could Not Find C:\Users\Gib\ABM_GUI\debug\ABM_GUI.exe
del Makefile.Debug
mingw32-make[1]: Leaving directory `C:/Users/Gib/ABM_GUI'
del Makefile
qmake generates no output to the console.
The binary with and without icons.qrc is the same size 745984 bytes.
make generates a lot of warnings, about some deprecated coding practices.
Last edited by gib; 6th September 2010 at 08:19.
I just found my stupid mistake!!
For some reason, later in the .pro file than the 'RESOURCES += icons.qrc', I had the line
RESOURCES =
I can only guess that I was interrupted or distracted while making a change.
Sorry for wasting your time, and thanks for pointing me in the right direction.
Bookmarks