summaryrefslogtreecommitdiff
path: root/examples/script/defaultprototypes/prototypes.cpp
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-04-27 19:16:41 +0200
committerDavid Boddie <david.boddie@nokia.com>2011-05-20 21:08:25 +0200
commit21caabc486fb594a29af9b84f172657093e4d662 (patch)
tree03da7c9a74765f77a8facbe4d5b89ef9ac38f8b3 /examples/script/defaultprototypes/prototypes.cpp
parentb843a09895a28edf113e814fc0df09fd3c1cf9df (diff)
downloadqtscript-21caabc486fb594a29af9b84f172657093e4d662.tar.gz
Squashed commit of the changes from the mobile-examples repository
(4.7-generated-declarative branch). (cherry picked from commit 539311f7b2687e3148ea695ce06fee768abe7b44)
Diffstat (limited to 'examples/script/defaultprototypes/prototypes.cpp')
-rw-r--r--examples/script/defaultprototypes/prototypes.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/script/defaultprototypes/prototypes.cpp b/examples/script/defaultprototypes/prototypes.cpp
index 5a3065b..15c2661 100644
--- a/examples/script/defaultprototypes/prototypes.cpp
+++ b/examples/script/defaultprototypes/prototypes.cpp
@@ -43,6 +43,7 @@
#include <QtGui/QListWidget>
#include <QtScript/QScriptValue>
#include <QtScript/QScriptEngine>
+#include <QDebug>
Q_DECLARE_METATYPE(QListWidgetItem*)
Q_DECLARE_METATYPE(QListWidget*)
@@ -100,10 +101,16 @@ void ListWidgetPrototype::setBackgroundColor(const QString &colorName)
{
QListWidget *widget = qscriptvalue_cast<QListWidget*>(thisObject());
if (widget) {
+#ifdef Q_WS_MAEMO_5
+ QString style = QString("QListWidget::item {background-color: %1;}").arg(colorName);
+ style += "QListWidget::item {selection-color: black;}";
+ widget->setStyleSheet(style);
+#else
QPalette palette = widget->palette();
QColor color(colorName);
palette.setBrush(QPalette::Base, color);
widget->setPalette(palette);
+#endif
}
}
//! [1]