Added qtquickcontrols patch.
authorTomasz Olszak <olszak.tomasz@gmail.com>
Sat, 18 May 2013 22:05:08 +0000 (22:05 +0000)
committerTomasz Olszak <olszak.tomasz@gmail.com>
Sat, 25 May 2013 13:45:50 +0000 (13:45 +0000)
Now QT_QUICK_CONTROLS_STYLE environment variable used as postfix for
styles directory.

README
tools/patches/qtquickcontrols/1_QT_QUICK_CONTROLS_STYLE.patch [new file with mode: 0644]

diff --git a/README b/README
index 3e97872..0f1c04f 100644 (file)
--- a/README
+++ b/README
@@ -15,7 +15,8 @@ To run a QML example using the Tizen style, execute this in directory, e.g.
  QT_QUICK_CONTROLS_STYLE=Tizen qmlscene main.qml
 
 For this to work, patched qtquickcontrols repository has to be build and original libprivateplugin.so
-should be replaced by the newly built. The patched code is included in this Qt for Tizen release.
+should be replaced by the newly built. The patched code is included in this Qt for Tizen release
+(see qtquickcontrols-tizen/tools/patches/qtquickcontrols/*.patch).
 
 
 Licensing
diff --git a/tools/patches/qtquickcontrols/1_QT_QUICK_CONTROLS_STYLE.patch b/tools/patches/qtquickcontrols/1_QT_QUICK_CONTROLS_STYLE.patch
new file mode 100644 (file)
index 0000000..f1c2310
--- /dev/null
@@ -0,0 +1,36 @@
+diff --git a/src/private/qquickcontrolsettings.cpp b/src/private/qquickcontrolsettings.cpp
+index 3b7d550..9205e33 100644
+--- a/src/private/qquickcontrolsettings.cpp
++++ b/src/private/qquickcontrolsettings.cpp
+@@ -42,6 +42,7 @@
+ #include "qquickcontrolsettings_p.h"
+ #include <qquickitem.h>
+ #include <qcoreapplication.h>
++#include <qdir.h>
+ QT_BEGIN_NAMESPACE
+@@ -55,13 +56,18 @@ QString QQuickControlSettings::theme()
+     static QString currentTheme;
+     if (currentTheme.isEmpty()) {
+         currentTheme = QLatin1String("Styles");
++        QString customStyle = qgetenv("QT_QUICK_CONTROLS_STYLE");
++        if (customStyle.isEmpty()) {
+ #ifndef QT_NO_WIDGETS
+-        //Only enable QStyle support when we are using QApplication
+-        if (QCoreApplication::instance()->inherits("QApplication")) {
+-            if (qgetenv("QT_QUICK_CONTROLS_NO_WIDGETS").toInt() < 1)
+-                currentTheme = QLatin1String("Styles/Desktop");
+-        }
++            //Only enable QStyle support when we are using QApplication
++            if (QCoreApplication::instance()->inherits("QApplication")) {
++                if (qgetenv("QT_QUICK_CONTROLS_NO_WIDGETS").toInt() < 1)
++                    currentTheme = QLatin1String("Styles/Desktop");
++            }
+ #endif
++        } else {
++            currentTheme += QDir::separator()+customStyle;
++        }
+     }
+     return currentTheme;
+ }