Page 1 of 1

Qt4 GUI: timetoolbar is invisible on OpenSuse fixed

Posted: 20.08.2011, 15:10
by refsteff
Hello,
my system:
OS: modified OpenSuse 11.2, KDE 4.6.3, Qt 4.7.3, Xorg 1.9.3, Celestia trunk 5166, libPNG12 and libPNG14 (tried both)
HW: CPU Intel E7500, 8GB ram, Nvidia Geoforce 9400 GT

If I select the timetoolbar, I can't see the Icons. only the tooltips are displayed.
If I change the icon path in qttimetoolbar.cpp to an absolute path, it works (but I have to install the icons somewhere).

So far I can see, the icons should be loaded from a compiled-in resource.
Maybe Linux doesn't support compiled-in resources or is some extra initialization needed?

Regards,
refsteff

Re: Qt4 GUI: timetoolbar is invisible on OpenSuse

Posted: 21.08.2011, 14:37
by refsteff
refsteff wrote:Maybe Linux doesn't support compiled-in resources or is some extra initialization needed?

Indeed I need some extra initialization and because I use the autoconf tools to build celestia, there is also a little change in the build system necessary.

Code: Select all

diff -urN celestia.org/src/celestia/qt/Makefile.am celestia/src/celestia/qt/Makefile.am
--- celestia.org/src/celestia/qt/Makefile.am   2011-08-19 16:04:59.000000000 +0200
+++ celestia/src/celestia/qt/Makefile.am   2011-08-21 15:30:54.388752873 +0200
@@ -99,4 +99,4 @@
    $(MOC) $< -o $@
 
 qrc_%.cpp: %.qrc
-   $(RCC) $< -o $@
+   $(RCC) -name $(patsubst %.qrc,%,$<) $< -o $@

This does the whole thing:

Code: Select all

diff -urN celestia.org/src/celestia/qt/qtmain.cpp celestia/src/celestia/qt/qtmain.cpp
--- celestia.org/src/celestia/qt/qtmain.cpp   2011-08-21 15:28:32.000000000 +0200
+++ celestia/src/celestia/qt/qtmain.cpp   2011-08-21 15:32:30.445753651 +0200
@@ -47,6 +47,10 @@
 { 
     QApplication app(argc, argv);
 
+#ifdef __linux
+    Q_INIT_RESOURCE(icons);
+#endif
+
     QCoreApplication::setOrganizationName("Celestia Development Team");
     QCoreApplication::setApplicationName("Celestia");
 


After this I can see the timetoolbar :D

The enclosing "#ifdef __linux " is only for the developers sake, I don't know if it is necessary.

Re: Qt4 GUI: timetoolbar is invisible on OpenSuse fixed

Posted: 21.08.2011, 19:52
by John Van Vliet
--- edit ---

Re: Qt4 GUI: timetoolbar is invisible on OpenSuse fixed

Posted: 21.08.2011, 20:28
by ajtribick
Ah great, I was also having this issue on Ubuntu, this fixes it.

Any Mac users seeing this? (From what I remember this does not affect Windows, but I might be mistaken there)

Re: Qt4 GUI: timetoolbar is invisible on OpenSuse fixed

Posted: 22.08.2011, 21:12
by ajtribick
Also working on Windows using qt creator, with or without the #ifdef.

Re: Qt4 GUI: timetoolbar is invisible on OpenSuse fixed

Posted: 15.09.2011, 01:12
by ni1s
Nice. But I have to say, these icons(resources) should automatically loaded. If they didn't the build system missed something.

Re: Qt4 GUI: timetoolbar is invisible on OpenSuse fixed

Posted: 15.09.2011, 02:05
by John Van Vliet
--- edit ---