diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index fa88a18f198..fd0d9ff5242 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -188,12 +188,16 @@ MainWindow::MainWindow() : #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) if (baseName == QLatin1String("windows")) { // Sometimes we get the standard windows 95 style as a fallback - // e.g. if we are running on a KDE4 desktop - QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION"); - if (desktopEnvironment == "kde") - baseName = QLatin1String("plastique"); - else - baseName = QLatin1String("cleanlooks"); + if (QStyleFactory::keys().contains("Fusion")) + baseName = QLatin1String("fusion"); // Qt5 + else { // Qt4 + // e.g. if we are running on a KDE4 desktop + QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION"); + if (desktopEnvironment == "kde") + baseName = QLatin1String("plastique"); + else + baseName = QLatin1String("cleanlooks"); + } } #endif qApp->setStyle(new ManhattanStyle(baseName)); diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp index 99c35b2c3fe..bce089c94d2 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp @@ -44,53 +44,43 @@ #include #include #include -#if QT_VERSION >= 0x050000 -# include -#else -# include -# include -#endif +#include + #include QT_BEGIN_NAMESPACE -class CleanLooksSingleton +class WindowsStyleSingleton { public: - static CleanLooksSingleton* instance(); + static WindowsStyleSingleton* instance(); QStyle* style() {return &m_style; }; private: - static CleanLooksSingleton *m_instance; + static WindowsStyleSingleton *m_instance; -#if QT_VERSION >= 0x050000 - QFusionStyle m_style; -#elif defined(Q_OS_MAC) - QPlastiqueStyle m_style; -#else - QCleanlooksStyle m_style; -#endif + QWindowsStyle m_style; - CleanLooksSingleton() {} - CleanLooksSingleton( const CleanLooksSingleton& ); + WindowsStyleSingleton() {} + WindowsStyleSingleton( const WindowsStyleSingleton& ); - class CleanLooksWatcher { - public: ~CleanLooksWatcher() { - if( CleanLooksSingleton::m_instance != 0 ) - delete CleanLooksSingleton::m_instance; + class WindowsWatcher { + public: ~WindowsWatcher() { + if ( WindowsStyleSingleton::m_instance != 0 ) + delete WindowsStyleSingleton::m_instance; } }; - friend class CleanLooksWatcher; + friend class WindowsWatcher; }; -CleanLooksSingleton* CleanLooksSingleton::m_instance = 0; +WindowsStyleSingleton* WindowsStyleSingleton::m_instance = 0; -CleanLooksSingleton* CleanLooksSingleton::instance() +WindowsStyleSingleton* WindowsStyleSingleton::instance() { - static CleanLooksWatcher w; + static WindowsWatcher w; if( m_instance == 0 ) - m_instance = new CleanLooksSingleton(); + m_instance = new WindowsStyleSingleton(); return m_instance; } @@ -175,7 +165,7 @@ public: filter->setDuiTarget(this); m_mouseOver = false; q->installEventFilter(filter); - q->setStyle(CleanLooksSingleton::instance()->style()); + q->setStyle(WindowsStyleSingleton::instance()->style()); Q_ASSERT(q); } virtual ~QWidgetDeclarativeUI() {