aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Lamecker <bernd.lamecker@basyskom.de>2010-03-10 14:28:21 +0100
committerBernd Lamecker <bernd.lamecker@basyskom.de>2010-03-10 14:28:21 +0100
commit2d4d7eecab76e615e99db36180ed52ccba039f71 (patch)
tree6700515af570e24d024113dadbce9e10732ca12a
parent938ebce91a91109a78ca6c6acacdba4e8bf6bcbc (diff)
Changes: Property for not applying style to widgets
RevBy: Torsten Rahn Details: Setting a dynamic property named Dui::NoDuiStyle to any QWidget or QApplication will cause the Qt Maemo 6 style not to style this widget. The definition of Dui::NoDuiStyle is in duinamespace.h to ensure it can be used even if the Qt Maemo 6 style is not included in the package. The preprocessor construct is unfortunately needed to suppress a "variable not used" warning/error.
-rw-r--r--plainqt/style/qtmaemo6style.cpp6
-rw-r--r--src/core/duinamespace.h13
2 files changed, 19 insertions, 0 deletions
diff --git a/plainqt/style/qtmaemo6style.cpp b/plainqt/style/qtmaemo6style.cpp
index 64bd14d3..200dd3f5 100644
--- a/plainqt/style/qtmaemo6style.cpp
+++ b/plainqt/style/qtmaemo6style.cpp
@@ -815,11 +815,17 @@ void QtMaemo6Style::setKineticMaxKineticScrollSpeed(int speed) {
void QtMaemo6Style::polish(QApplication *app)
{
+ if(app->dynamicPropertyNames().contains(Dui::NoDuiStyle))
+ return;
+
QtMaemo6TestStyle::polish(app);
}
void QtMaemo6Style::polish(QWidget *widget)
{
+ if(widget->dynamicPropertyNames().contains(Dui::NoDuiStyle))
+ return;
+
if(qobject_cast<DuiWindow*>(widget))
return;
diff --git a/src/core/duinamespace.h b/src/core/duinamespace.h
index 494cb925..43f1f176 100644
--- a/src/core/duinamespace.h
+++ b/src/core/duinamespace.h
@@ -30,6 +30,19 @@ namespace Dui
};
/*!
+ * setting a dynamic porperty to any QWidget or QApplication will cause the the object
+ * not to be styled like DUI does.
+ */
+#ifdef __GNUC__
+ static const char* NoDuiStyle __attribute__((__unused__)) = "NoDuiStyle";
+#elif defined _MSC_VER
+ #pragma warning(disable: Cxxxxx)
+ static const char* NoDuiStyle = "NoDuiStyle";
+#else
+ static const char* NoDuiStyle = "NoDuiStyle";
+#endif
+
+ /*!
* This enum contains values of the orientation angle of windows in the application.
*
* \sa Orientation