Skip to content
Snippets Groups Projects
Commit 3aec9f95 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Properly handle Qt styles

parent 48fe4f7e
No related branches found
No related tags found
No related merge requests found
......@@ -69,9 +69,10 @@ IF(NOT CLIENT_ONLY)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
IF(USE_QT4)
FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGl QtNetwork)
# TODO PythonQt is currently only handled with Qt 4
FIND_PACKAGE(PythonQt COMPONENTS QtAll)
SET(GEPETTO_GUI_HAS_PYTHONQT (${PythonQt_FOUND} AND ${PythonQt_QtAll_FOUND}) CACHE BOOL "Use PythonQt dependency")
ADD_DEFINITIONS(-DUSE_QT4)
ELSE(USE_QT4)
FOREACH (component "Core" "Widgets" "Gui" "OpenGL" "Network")
FIND_PACKAGE ("Qt5${component}" REQUIRED)
......
#include <QApplication>
#include <QSettings>
#include <QCommonStyle>
#include <QStyleFactory>
#include <QProcessEnvironment>
#include <QSplashScreen>
#include <QIcon>
......@@ -39,7 +39,13 @@ int main(int argc, char *argv[])
QApplication::setAttribute(Qt::AA_X11InitThreads);
SafeApplication a(argc, argv);
a.setStyle(new QCommonStyle);
a.setStyle(QStyleFactory::create (
#if USE_QT4
"cleanlooks"
#else // USE_QT4
"fusion"
#endif // USE_QT4
));
QPixmap pixmap(":/img/gepetto.png");
a.setWindowIcon(pixmap);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment