diff options
Diffstat (limited to 'examples/script/defaultprototypes')
-rw-r--r-- | examples/script/defaultprototypes/code.js | 2 | ||||
-rw-r--r-- | examples/script/defaultprototypes/defaultprototypes.pro | 1 | ||||
-rw-r--r-- | examples/script/defaultprototypes/main.cpp | 5 | ||||
-rw-r--r-- | examples/script/defaultprototypes/prototypes.cpp | 7 |
4 files changed, 13 insertions, 2 deletions
diff --git a/examples/script/defaultprototypes/code.js b/examples/script/defaultprototypes/code.js index 048e131..5f776fb 100644 --- a/examples/script/defaultprototypes/code.js +++ b/examples/script/defaultprototypes/code.js @@ -16,5 +16,3 @@ listWidget.currentItemChanged.connect( } ); //! [1] - -listWidget.show(); diff --git a/examples/script/defaultprototypes/defaultprototypes.pro b/examples/script/defaultprototypes/defaultprototypes.pro index 483188c..590ae8d 100644 --- a/examples/script/defaultprototypes/defaultprototypes.pro +++ b/examples/script/defaultprototypes/defaultprototypes.pro @@ -10,3 +10,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtscript/script/defaultprototypes INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/script/defaultprototypes/main.cpp b/examples/script/defaultprototypes/main.cpp index 688bcd3..8fc17e3 100644 --- a/examples/script/defaultprototypes/main.cpp +++ b/examples/script/defaultprototypes/main.cpp @@ -79,5 +79,10 @@ int main(int argc, char **argv) qWarning() << "line" << lineNo << ":" << result.toString(); } +#if defined(Q_OS_SYMBIAN) + listWidget.showMaximized(); +#else + listWidget.show(); +#endif return app.exec(); } 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] |