diff options
Diffstat (limited to 'demos')
61 files changed, 842 insertions, 104 deletions
diff --git a/demos/affine/affine.pro b/demos/affine/affine.pro index b928753..4973496 100644 --- a/demos/affine/affine.pro +++ b/demos/affine/affine.pro @@ -18,6 +18,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.jpg sources.path = $$[QT_INSTALL_DEMOS]/affine INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + wince*: { DEPLOYMENT_PLUGIN += qjpeg } diff --git a/demos/arthurplugin/arthurplugin.pro b/demos/arthurplugin/arthurplugin.pro index e9eb1f3..d4827a1 100644 --- a/demos/arthurplugin/arthurplugin.pro +++ b/demos/arthurplugin/arthurplugin.pro @@ -44,6 +44,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg *.png sources.path = $$[QT_INSTALL_DEMOS]/arthurplugin INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + win32-msvc* { QMAKE_CFLAGS += /Zm500 QMAKE_CXXFLAGS += /Zm500 diff --git a/demos/books/books.pro b/demos/books/books.pro index a2cd33f..94b049a 100644 --- a/demos/books/books.pro +++ b/demos/books/books.pro @@ -13,6 +13,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro images sources.path = $$[QT_INSTALL_DEMOS]/books INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + wince*: { CONFIG(debug, debug|release):sqlPlugins.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll CONFIG(release, debug|release):sqlPlugins.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll diff --git a/demos/browser/browser.pro b/demos/browser/browser.pro index d970f99..c500788 100644 --- a/demos/browser/browser.pro +++ b/demos/browser/browser.pro @@ -89,3 +89,5 @@ target.path = $$[QT_INSTALL_DEMOS]/browser sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.plist *.icns *.ico *.rc *.pro *.html *.doc images htmls sources.path = $$[QT_INSTALL_DEMOS]/browser INSTALLS += target sources + +include($$QT_SOURCE_TREE/demos/demobase.pri) diff --git a/demos/chip/chip.pro b/demos/chip/chip.pro index 53fa23b..2c44e56 100644 --- a/demos/chip/chip.pro +++ b/demos/chip/chip.pro @@ -17,3 +17,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.png *.pro *.html *.doc images sources.path = $$[QT_INSTALL_DEMOS]/chip INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + diff --git a/demos/composition/composition.pro b/demos/composition/composition.pro index d5c4a60..90562eb 100644 --- a/demos/composition/composition.pro +++ b/demos/composition/composition.pro @@ -17,6 +17,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.png *.jpg *.pro *.html sources.path = $$[QT_INSTALL_DEMOS]/composition INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + win32-msvc* { QMAKE_CXXFLAGS += /Zm500 QMAKE_CFLAGS += /Zm500 diff --git a/demos/deform/deform.pro b/demos/deform/deform.pro index db8484d..31ba2e9 100644 --- a/demos/deform/deform.pro +++ b/demos/deform/deform.pro @@ -17,3 +17,7 @@ target.path = $$[QT_INSTALL_DEMOS]/deform sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html sources.path = $$[QT_INSTALL_DEMOS]/deform INSTALLS += target sources + +include($$QT_SOURCE_TREE/demos/demobase.pri) + +symbian:TARGET.UID3 = 0xA000A63D diff --git a/demos/deform/pathdeform.cpp b/demos/deform/pathdeform.cpp index 2e1d89a..4026241 100644 --- a/demos/deform/pathdeform.cpp +++ b/demos/deform/pathdeform.cpp @@ -53,6 +53,10 @@ #include <QDesktopWidget> #include <qmath.h> +#if defined(Q_OS_SYMBIAN) +// TODO: Remove all FONT_OUTLINE_TWEAK related code as soon as the S60FontEngine can deliver outlines +#define FONT_OUTLINE_TWEAK +#endif PathDeformControls::PathDeformControls(QWidget *parent, PathDeformRenderer* renderer, bool smallScreen) : QWidget(parent) @@ -241,6 +245,14 @@ void PathDeformControls::layoutForSmallScreen() QRect screen_size = QApplication::desktop()->screenGeometry(); radiusSlider->setValue(qMin(screen_size.width(), screen_size.height())/5); + +#ifdef FONT_OUTLINE_TWEAK + radiusSlider->setValue(qMin(screen_size.width(), screen_size.height())/7); + fontSizeLabel->setText("Qt Logo Size:"); + m_renderer->setText("A"); // Any Letter would be fine + fontSizeSlider->setValue(100); +#endif + m_renderer->setText(tr("Qt")); } diff --git a/demos/demobase.pri b/demos/demobase.pri new file mode 100644 index 0000000..c0bba64 --- /dev/null +++ b/demos/demobase.pri @@ -0,0 +1 @@ +symbian:RSS_RULES = "group_name=\"QtDemos\";"
\ No newline at end of file diff --git a/demos/demos.pro b/demos/demos.pro index 6084550..3856591 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -1,26 +1,31 @@ TEMPLATE = subdirs SUBDIRS = \ - demos_shared \ - demos_deform \ - demos_gradients \ - demos_pathstroke \ - demos_affine \ - demos_composition \ - demos_books \ - demos_interview \ - demos_mainwindow \ - demos_spreadsheet \ - demos_textedit \ - demos_chip \ - demos_embeddeddialogs \ - demos_undo + demos_shared \ + demos_deform \ + demos_gradients \ + demos_pathstroke \ + demos_affine \ + demos_composition \ + demos_books \ + demos_interview \ + demos_mainwindow \ + demos_spreadsheet \ + demos_textedit \ + demos_chip \ + demos_embeddeddialogs \ + demos_undo + +symbian: SUBDIRS = \ + demos_shared \ + demos_deform \ + demos_pathstroke contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl):!contains(QT_CONFIG, opengles2):{ SUBDIRS += demos_boxes } mac*: SUBDIRS += demos_macmainwindow -wince*|embedded: SUBDIRS += embedded +wince*|symbian|embedded: SUBDIRS += embedded !contains(QT_EDITION, Console):!cross_compile:!embedded:!wince*:SUBDIRS += demos_arthurplugin @@ -38,6 +43,8 @@ sources.files = README *.pro sources.path = $$[QT_INSTALL_DEMOS] INSTALLS += sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + demos_chip.subdir = chip demos_embeddeddialogs.subdir = embeddeddialogs demos_shared.subdir = shared diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp new file mode 100644 index 0000000..1abb051 --- /dev/null +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +// EXTERNAL INCLUDES +#include <QKeyEvent> +#include <QListWidget> +#include <QVBoxLayout> +#include <QFileInfoList> +#include <QListWidgetItem> + +// INTERNAL INCLUDES + +// CLASS HEADER +#include "contenttab.h" + + +// CONSTRUCTORS & DESTRUCTORS +ContentTab::ContentTab(QWidget *parent) : + QListWidget(parent) +{ + setDragEnabled(false); + setIconSize(QSize(45, 45)); +} + +ContentTab::~ContentTab() +{ +} + +// NEW PUBLIC METHODS +void ContentTab::init(const QDesktopServices::StandardLocation &location, + const QString &icon) +{ + setContentDir(location); + setIcon(icon); + + connect(this, SIGNAL(itemClicked(QListWidgetItem *)), + this, SLOT(openItem(QListWidgetItem *))); + + populateListWidget(); +} + +// NEW PROTECTED METHODS +void ContentTab::setContentDir(const QDesktopServices::StandardLocation &location) +{ + m_ContentDir.setPath(QDesktopServices::storageLocation(location)); +} + +void ContentTab::setIcon(const QString &icon) +{ + m_Icon = QIcon(icon); +} + +void ContentTab::populateListWidget() +{ + QFileInfoList fileList = m_ContentDir.entryInfoList(QStringList(), QDir::Files, QDir::Time); + foreach(QFileInfo item, fileList) { + new QListWidgetItem(m_Icon, itemName(item), this); + } +} + +QString ContentTab::itemName(const QFileInfo &item) +{ + return QString(item.baseName() + "." + item.completeSuffix()); +} + +QUrl ContentTab::itemUrl(QListWidgetItem *item) +{ + return QUrl("file:///" + m_ContentDir.absolutePath() + "/" + item->text()); +} + +void ContentTab::keyPressEvent(QKeyEvent *event) +{ + switch(event->key()) { + case Qt::Key_Up: + if(currentRow() == 0) { + setCurrentRow(count()-1); + } else { + setCurrentRow(currentRow()-1); + } + break; + case Qt::Key_Down: + if(currentRow() == (count()-1)) { + setCurrentRow(0); + } else { + setCurrentRow(currentRow()+1); + } + break; + case Qt::Key_Select: + openItem(currentItem()); + default: + QListWidget::keyPressEvent(event); + break; + } +} + +// NEW SLOTS +void ContentTab::openItem(QListWidgetItem *item) +{ + QDesktopServices::openUrl(itemUrl(item)); +} + +// End of File diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h new file mode 100644 index 0000000..60fabc8 --- /dev/null +++ b/demos/embedded/desktopservices/contenttab.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#ifndef CONTENTTAB_H_ +#define CONTENTTAB_H_ + +// EXTERNAL INCLUDES +#include <QDir> +#include <QUrl> +#include <QIcon> +#include <QFileInfo> +#include <QListWidget> +#include <QDesktopServices> + +// INTERNAL INCLUDES + +// FORWARD DECLARATIONS +QT_BEGIN_NAMESPACE +class QListWidgetItem; +QT_END_NAMESPACE + +// CLASS DECLARATION + +/** +* ContentTab class. +* +* This class implements general purpose tab for media files. +*/ +class ContentTab : public QListWidget +{ + Q_OBJECT + +public: // Constructors & Destructors + ContentTab(QWidget *parent); + virtual ~ContentTab(); + +public: // New Methods + virtual void init(const QDesktopServices::StandardLocation &location, + const QString &icon); + +protected: // New Methods + virtual void setContentDir(const QDesktopServices::StandardLocation &location); + virtual void setIcon(const QString &icon); + virtual void populateListWidget(); + virtual QString itemName(const QFileInfo &item); + virtual QUrl itemUrl(QListWidgetItem *item); + +protected: + void keyPressEvent(QKeyEvent *event); + +public slots: // New Slots + virtual void openItem(QListWidgetItem *item); + +protected: // Owned variables + QDir m_ContentDir; + QIcon m_Icon; +}; + + +#endif // CONTENTTAB_H_ + +// End of File diff --git a/demos/embedded/desktopservices/data/Explosion.wav b/demos/embedded/desktopservices/data/Explosion.wav Binary files differnew file mode 100644 index 0000000..7b140b1 --- /dev/null +++ b/demos/embedded/desktopservices/data/Explosion.wav diff --git a/demos/embedded/desktopservices/data/designer.png b/demos/embedded/desktopservices/data/designer.png Binary files differnew file mode 100644 index 0000000..0988fce --- /dev/null +++ b/demos/embedded/desktopservices/data/designer.png diff --git a/demos/embedded/desktopservices/data/monkey_on_64x64.png b/demos/embedded/desktopservices/data/monkey_on_64x64.png Binary files differnew file mode 100644 index 0000000..990f604 --- /dev/null +++ b/demos/embedded/desktopservices/data/monkey_on_64x64.png diff --git a/demos/embedded/desktopservices/data/sax.mp3 b/demos/embedded/desktopservices/data/sax.mp3 Binary files differnew file mode 100644 index 0000000..0a078b1 --- /dev/null +++ b/demos/embedded/desktopservices/data/sax.mp3 diff --git a/demos/embedded/desktopservices/desktopservices.pro b/demos/embedded/desktopservices/desktopservices.pro new file mode 100644 index 0000000..32cb6d9 --- /dev/null +++ b/demos/embedded/desktopservices/desktopservices.pro @@ -0,0 +1,23 @@ +TEMPLATE = app +TARGET = +INCLUDEPATH += . + +HEADERS += desktopwidget.h contenttab.h linktab.h +SOURCES += desktopwidget.cpp contenttab.cpp linktab.cpp main.cpp + +RESOURCES += desktopservices.qrc + +music.sources = data/*.mp3 data/*.wav +music.path = /data/sounds/ + +image.sources = data/*.png +image.path = /data/images/ + +DEPLOYMENT += music image + +include($$QT_SOURCE_TREE/demos/demobase.pri) + +symbian { + TARGET.UID3 = 0xA000C611 + ICON = ./resources/heart.svg +} diff --git a/demos/embedded/desktopservices/desktopservices.qrc b/demos/embedded/desktopservices/desktopservices.qrc new file mode 100644 index 0000000..d36205d --- /dev/null +++ b/demos/embedded/desktopservices/desktopservices.qrc @@ -0,0 +1,8 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/"> + <file>resources/music.png</file> + <file>resources/photo.png</file> + <file>resources/browser.png</file> + <file>resources/message.png</file> +</qresource> +</RCC> diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp new file mode 100644 index 0000000..17243cf --- /dev/null +++ b/demos/embedded/desktopservices/desktopwidget.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +// EXTERNAL INCLUDES +#include <QTabWidget> +#include <QVBoxLayout> +#include <QDesktopServices> + +// INTERNAL INCLUDES +#include "linktab.h" +#include "contenttab.h" + +// CLASS HEADER +#include "desktopwidget.h" + +// CONSTRUCTORS & DESTRUCTORS +DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent) + +{ + QTabWidget *tabWidget = new QTabWidget(this); + + // Images + ContentTab* imageTab = new ContentTab(tabWidget); + imageTab->init(QDesktopServices::PicturesLocation, ":/resources/photo.png"); + tabWidget->addTab(imageTab, tr("Images")); + + // Music + ContentTab* musicTab = new ContentTab(tabWidget); + musicTab->init(QDesktopServices::MusicLocation, ":/resources/music.png"); + tabWidget->addTab(musicTab, tr("Music")); + + // Links + LinkTab* othersTab = new LinkTab(tabWidget);; + // Given icon file will be overriden by LinkTab + othersTab->init(QDesktopServices::PicturesLocation, ""); + tabWidget->addTab(othersTab, tr("Links")); + + // Layout + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(tabWidget); + setLayout(layout); +} + +DesktopWidget::~DesktopWidget() +{ +} + +// End of file diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h new file mode 100644 index 0000000..a947e80 --- /dev/null +++ b/demos/embedded/desktopservices/desktopwidget.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#ifndef DESKTOPWIDGET_H_ +#define DESKTOPWIDGET_H_ + +// EXTERNAL INCLUDES +#include <QWidget> + +// INTERNAL INCLUDES + +// FORWARD DECLARATIONS +QT_BEGIN_NAMESPACE +class QTabWidget; +QT_END_NAMESPACE + +// CLASS DECLARATION +/** +* DesktopWidget class. +* +* Implements the main top level widget for QDesktopServices demo app. +*/ +class DesktopWidget : public QWidget +{ + Q_OBJECT + +public: // Constructors & Destructors + DesktopWidget(QWidget *parent); + ~DesktopWidget(); + +}; + +#endif // DESKTOPWIDGET_H_ + +// End of file diff --git a/demos/embedded/desktopservices/linktab.cpp b/demos/embedded/desktopservices/linktab.cpp new file mode 100644 index 0000000..0d5bea7 --- /dev/null +++ b/demos/embedded/desktopservices/linktab.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +// EXTERNAL INCLUDES +#include <QUrl> +#include <QListWidgetItem> + +// INTERNAL INCLUDES + +// CLASS HEADER +#include "linktab.h" + +LinkTab::LinkTab(QWidget *parent) : + ContentTab(parent) +{ +} + +LinkTab::~LinkTab() +{ +} + +void LinkTab::populateListWidget() +{ + m_WebItem = new QListWidgetItem(QIcon(":/resources/browser.png"), tr("Launch Browser"), this); + m_MailToItem = new QListWidgetItem(QIcon(":/resources/message.png"), tr("New e-mail"), this); +} + +QUrl LinkTab::itemUrl(QListWidgetItem *item) +{ + if(m_WebItem == item) { + return QUrl(tr("http://www.qtsoftware.com")); + } else if(m_MailToItem == item) { + return QUrl(tr("mailto:qts60-feedback@trolltech.com?subject=QtS60 feedback&body=Hello")); + } else { + // We should never endup here + Q_ASSERT(false); + return QUrl(); + } +} + +// End of file diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h new file mode 100644 index 0000000..f88c334 --- /dev/null +++ b/demos/embedded/desktopservices/linktab.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#ifndef LINKTAB_H_ +#define LINKTAB_H_ + +// EXTERNAL INCLUDES + +// INTERNAL INCLUDES +#include "contenttab.h" + +// FORWARD DECLARATIONS +QT_BEGIN_NAMESPACE +class QWidget; +class QListWidgetItem; +QT_END_NAMESPACE + +// CLASS DECLARATION + +/** +* LinkTab class. +* +* This class implements tab for opening http and mailto links. +*/ +class LinkTab : public ContentTab +{ + Q_OBJECT + +public: // Constructors & Destructors + LinkTab(QWidget *parent); + ~LinkTab(); + +protected: // Derived Methods + virtual void populateListWidget(); + virtual QUrl itemUrl(QListWidgetItem *item); + +private: // Used variables + QListWidgetItem *m_WebItem; + QListWidgetItem *m_MailToItem; + +private: // Owned variables + +}; + +#endif // CONTENTTAB_H_ + +// End of File diff --git a/demos/embedded/desktopservices/main.cpp b/demos/embedded/desktopservices/main.cpp new file mode 100644 index 0000000..32e22ae --- /dev/null +++ b/demos/embedded/desktopservices/main.cpp @@ -0,0 +1,26 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> +#include "desktopwidget.h" + +int main(int argc, char *argv[]) +{ + Q_INIT_RESOURCE(desktopservices); + + QApplication app(argc, argv); + DesktopWidget* myWidget = new DesktopWidget(0); + myWidget->showMaximized(); + + return app.exec(); +} + +// End of file diff --git a/demos/embedded/desktopservices/resources/browser.png b/demos/embedded/desktopservices/resources/browser.png Binary files differnew file mode 100644 index 0000000..28561e1 --- /dev/null +++ b/demos/embedded/desktopservices/resources/browser.png diff --git a/demos/embedded/desktopservices/resources/heart.svg b/demos/embedded/desktopservices/resources/heart.svg new file mode 100644 index 0000000..ba5f050 --- /dev/null +++ b/demos/embedded/desktopservices/resources/heart.svg @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --><svg viewBox="100 200 550 500" height="595.27559pt" id="svg1" inkscape:version="0.40+cvs" sodipodi:docbase="C:\Documents and Settings\Jon Phillips\My Documents\projects\clipart-project\submissions" sodipodi:docname="heart-left-highlight.svg" sodipodi:version="0.32" width="595.27559pt" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg"> +<metadata> +<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> +<cc:Work rdf:about=""> +<dc:title>Heart Left-Highlight</dc:title> +<dc:description>This is a normal valentines day heart.</dc:description> +<dc:subject> +<rdf:Bag> +<rdf:li>holiday</rdf:li> +<rdf:li>valentines</rdf:li> +<rdf:li></rdf:li> +<rdf:li>valentine</rdf:li> +<rdf:li>hash(0x8a091c0)</rdf:li> +<rdf:li>hash(0x8a0916c)</rdf:li> +<rdf:li>signs_and_symbols</rdf:li> +<rdf:li>hash(0x8a091f0)</rdf:li> +<rdf:li>day</rdf:li> +</rdf:Bag> +</dc:subject> +<dc:publisher> +<cc:Agent rdf:about="http://www.openclipart.org"> +<dc:title>Jon Phillips</dc:title> +</cc:Agent> +</dc:publisher> +<dc:creator> +<cc:Agent> +<dc:title>Jon Phillips</dc:title> +</cc:Agent> +</dc:creator> +<dc:rights> +<cc:Agent> +<dc:title>Jon Phillips</dc:title> +</cc:Agent> +</dc:rights> +<dc:date></dc:date> +<dc:format>image/svg+xml</dc:format> +<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> +<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/> +<dc:language>en</dc:language> +</cc:Work> +<cc:License rdf:about="http://web.resource.org/cc/PublicDomain"> +<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/> +<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/> +<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/> +</cc:License> +</rdf:RDF> +</metadata> +<defs id="defs3"/> +<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="549.40674" inkscape:cy="596.00159" inkscape:document-units="px" inkscape:guide-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="615" inkscape:window-width="866" inkscape:window-x="88" inkscape:window-y="116" inkscape:zoom="0.35000000" pagecolor="#ffffff" showguides="true"/> +<g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1"> +<path d="M 263.41570,235.14588 C 197.17570,235.14588 143.41575,288.90587 143.41575,355.14588 C 143.41575,489.90139 279.34890,525.23318 371.97820,658.45392 C 459.55244,526.05056 600.54070,485.59932 600.54070,355.14588 C 600.54070,288.90588 546.78080,235.14587 480.54070,235.14588 C 432.49280,235.14588 391.13910,263.51631 371.97820,304.33338 C 352.81740,263.51630 311.46370,235.14587 263.41570,235.14588 z " id="path7" sodipodi:nodetypes="ccccccc" style="fill:#e60000;fill-opacity:1.0000000;stroke:#000000;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/> +<path d="M 265.00000,253.59375 C 207.04033,253.59375 160.00000,300.63407 160.00000,358.59375 C 160.00000,476.50415 278.91857,507.43251 359.96875,624.00000 C 366.52868,614.08205 220.00000,478.47309 220.00000,378.59375 C 220.00000,320.63407 267.04033,273.59375 325.00000,273.59375 C 325.50453,273.59375 325.99718,273.64912 326.50000,273.65625 C 309.22436,261.07286 288.00557,253.59374 265.00000,253.59375 z " id="path220" sodipodi:nodetypes="ccccccc" style="fill:#e6e6e6;fill-opacity:0.64556962;stroke:none;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/> +</g> +</svg> diff --git a/demos/embedded/desktopservices/resources/message.png b/demos/embedded/desktopservices/resources/message.png Binary files differnew file mode 100644 index 0000000..e30052b --- /dev/null +++ b/demos/embedded/desktopservices/resources/message.png diff --git a/demos/embedded/desktopservices/resources/music.png b/demos/embedded/desktopservices/resources/music.png Binary files differnew file mode 100644 index 0000000..11a57bb --- /dev/null +++ b/demos/embedded/desktopservices/resources/music.png diff --git a/demos/embedded/desktopservices/resources/photo.png b/demos/embedded/desktopservices/resources/photo.png Binary files differnew file mode 100644 index 0000000..5ba15c1 --- /dev/null +++ b/demos/embedded/desktopservices/resources/photo.png diff --git a/demos/embedded/embedded.pro b/demos/embedded/embedded.pro index 7428b9f..8214dd3 100644 --- a/demos/embedded/embedded.pro +++ b/demos/embedded/embedded.pro @@ -3,7 +3,8 @@ SUBDIRS = styledemo contains(QT_CONFIG, svg) { SUBDIRS += embeddedsvgviewer \ - fluidlauncher + fluidlauncher \ + desktopservices } # install @@ -11,3 +12,5 @@ sources.files = README *.pro sources.path = $$[QT_INSTALL_DEMOS]/embedded INSTALLS += sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + diff --git a/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro b/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro index 505e607..51a04e7 100644 --- a/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro +++ b/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.pro @@ -11,6 +11,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.svg files sources.path = $$[QT_INSTALL_DEMOS]/embedded/embeddedsvgviewer INSTALLS += target sources -wince*: { +wince* { DEPLOYMENT_PLUGIN += qsvg } + +include($$QT_SOURCE_TREE/demos/demobase.pri) + +symbian:TARGET.UID3 = 0xA000A640 + diff --git a/demos/embedded/fluidlauncher/config_s60/config.xml b/demos/embedded/fluidlauncher/config_s60/config.xml new file mode 100644 index 0000000..41b3b6d --- /dev/null +++ b/demos/embedded/fluidlauncher/config_s60/config.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<demolauncher> + <demos> + <example filename="embeddedsvgviewer" name="SVG Viewer" image="screenshots/embeddedsvgviewer.png" args="/data/images/qt/demos/embeddedsvgviewer/shapes.svg"/> + <example filename="styledemo" name="Stylesheets" image="screenshots/styledemo.png"/> + <example filename="deform" name="Vector Deformation" image="screenshots/deform.png" args="-small-screen"/> + <example filename="pathstroke" name="Path Stroking" image="screenshots/pathstroke.png" args="-small-screen"/> + <example filename="wiggly" name="Wiggly Text" image="screenshots/wiggly.png" args="-small-screen"/> + <example filename="ftp" name="Ftp Client" image="screenshots/ftp.png"/> + <example filename="context2d" name="Context2d" image="screenshots/context2d.png"/> + <example filename="saxbookmarks" name="SaxBookmarks" image="screenshots/saxbookmarks.png"/> + <example filename="desktopservices" name="Desktop Services" image="screenshots/desktopservices.png"/> + <example filename="fridgemagnets" name="Fridge Magnets" image="screenshots/fridgemagnets.png" args="-small-screen"/> + <example filename="drilldown" name="Drilldown" image="screenshots/drilldown.png"/> + </demos> + <slideshow timeout="60000" interval="10000"> + <imagedir dir="slides"/> + </slideshow> +</demolauncher> diff --git a/demos/embedded/fluidlauncher/fluidlauncher.cpp b/demos/embedded/fluidlauncher/fluidlauncher.cpp index f80e6ca..9a4f2ca 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.cpp +++ b/demos/embedded/fluidlauncher/fluidlauncher.cpp @@ -39,12 +39,14 @@ ** ****************************************************************************/ -#include <QtXml> +#include <QXmlStreamReader> #include "fluidlauncher.h" #define DEFAULT_INPUT_TIMEOUT 10000 +#define SIZING_FACTOR_HEIGHT 6/10 +#define SIZING_FACTOR_WIDTH 6/10 FluidLauncher::FluidLauncher(QStringList* args) { @@ -62,7 +64,11 @@ FluidLauncher::FluidLauncher(QStringList* args) inputTimer->setSingleShot(true); inputTimer->setInterval(DEFAULT_INPUT_TIMEOUT); - pictureFlowWidget->setSlideSize(QSize( (screen_size.width()*2)/5, (screen_size.height()*2)/5 )); + const int h = screen_size.height() * SIZING_FACTOR_HEIGHT; + const int w = screen_size.width() * SIZING_FACTOR_WIDTH; + const int hh = qMin(h, w); + const int ww = hh / 3 * 2; + pictureFlowWidget->setSlideSize(QSize(ww, hh)); bool success; int configIndex = args->indexOf("-config"); @@ -100,61 +106,97 @@ bool FluidLauncher::loadConfig(QString configPath) slideShowWidget->clearImages(); - QDomDocument xmlDoc; - xmlDoc.setContent(&xmlFile, true); + xmlFile.open(QIODevice::ReadOnly); + QXmlStreamReader reader(&xmlFile); + while (!reader.atEnd()) { + reader.readNext(); - QDomElement rootElement = xmlDoc.documentElement(); - - // Process the demos node: - QDomNodeList demoNodes = rootElement.firstChildElement("demos").elementsByTagName("example"); - for (int i=0; i<demoNodes.size(); i++) { - QDomElement element = demoNodes.item(i).toElement(); - - if (element.hasAttribute("filename")) { - DemoApplication* newDemo = new DemoApplication( - element.attribute("filename"), - element.attribute("name", "Unamed Demo"), - element.attribute("image"), - element.attribute("args").split(" ")); - demoList.append(newDemo); + if (reader.isStartElement()) { + if (reader.name() == "demos") + parseDemos(reader); + else if(reader.name() == "slideshow") + parseSlideshow(reader); } } + if (reader.hasError()) { + qDebug() << QString("Error parsing %1 on line %2 column %3: \n%4") + .arg(configPath) + .arg(reader.lineNumber()) + .arg(reader.columnNumber()) + .arg(reader.errorString()); + } - // Process the slideshow node: - QDomElement slideshowElement = rootElement.firstChildElement("slideshow"); + // Append an exit Item + DemoApplication* exitItem = new DemoApplication(QString(), QLatin1String("Exit Embedded Demo"), QString(), QStringList()); + demoList.append(exitItem); - if (slideshowElement.hasAttribute("timeout")) { - bool valid; - int timeout = slideshowElement.attribute("timeout").toInt(&valid); - if (valid) - inputTimer->setInterval(timeout); - } + return true; +} - if (slideshowElement.hasAttribute("interval")) { - bool valid; - int interval = slideshowElement.attribute("interval").toInt(&valid); - if (valid) - slideShowWidget->setSlideInterval(interval); + +void FluidLauncher::parseDemos(QXmlStreamReader& reader) +{ + while (!reader.atEnd()) { + reader.readNext(); + if (reader.isStartElement() && reader.name() == "example") { + QXmlStreamAttributes attrs = reader.attributes(); + QStringRef filename = attrs.value("filename"); + if (!filename.isEmpty()) { + QStringRef name = attrs.value("name"); + QStringRef image = attrs.value("image"); + QStringRef args = attrs.value("args"); + + DemoApplication* newDemo = new DemoApplication( + filename.toString(), + name.isEmpty() ? "Unamed Demo" : name.toString(), + image.toString(), + args.toString().split(" ")); + demoList.append(newDemo); + } + } else if(reader.isEndElement() && reader.name() == "demos") { + return; + } } +} - for (QDomNode node=slideshowElement.firstChild(); !node.isNull(); node=node.nextSibling()) { - QDomElement element = node.toElement(); +void FluidLauncher::parseSlideshow(QXmlStreamReader& reader) +{ + QXmlStreamAttributes attrs = reader.attributes(); + + QStringRef timeout = attrs.value("timeout"); + bool valid; + if (!timeout.isEmpty()) { + int t = timeout.toString().toInt(&valid); + if (valid) + inputTimer->setInterval(t); + } - if (element.tagName() == "imagedir") - slideShowWidget->addImageDir(element.attribute("dir")); - else if (element.tagName() == "image") - slideShowWidget->addImage(element.attribute("image")); + QStringRef interval = attrs.value("interval"); + if (!interval.isEmpty()) { + int i = interval.toString().toInt(&valid); + if (valid) + slideShowWidget->setSlideInterval(i); } - // Append an exit Item - DemoApplication* exitItem = new DemoApplication(QString(), QLatin1String("Exit Embedded Demo"), QString(), QStringList()); - demoList.append(exitItem); + while (!reader.atEnd()) { + reader.readNext(); + if (reader.isStartElement()) { + QXmlStreamAttributes attrs = reader.attributes(); + if (reader.name() == "imagedir") { + QStringRef dir = attrs.value("dir"); + slideShowWidget->addImageDir(dir.toString()); + } else if(reader.name() == "image") { + QStringRef image = attrs.value("image"); + slideShowWidget->addImage(image.toString()); + } + } else if(reader.isEndElement() && reader.name() == "slideshow") { + return; + } + } - return true; } - void FluidLauncher::populatePictureFlow() { pictureFlowWidget->setSlideCount(demoList.count()); diff --git a/demos/embedded/fluidlauncher/fluidlauncher.h b/demos/embedded/fluidlauncher/fluidlauncher.h index 3f4c1fe..d064edd 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.h +++ b/demos/embedded/fluidlauncher/fluidlauncher.h @@ -44,6 +44,7 @@ #include <QtGui> #include <QTimer> +#include <QStringRef> #include "pictureflow.h" #include "slideshow.h" @@ -73,7 +74,8 @@ private: bool loadConfig(QString configPath); void populatePictureFlow(); void switchToSlideshow(); - + void parseDemos(QXmlStreamReader& reader); + void parseSlideshow(QXmlStreamReader& reader); }; diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index 76d12ad..ed2530c 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -2,7 +2,6 @@ TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += . -QT += xml # Input HEADERS += \ @@ -40,7 +39,8 @@ wince*{ $$QT_BUILD_TREE/demos/pathstroke/$${BUILD_DIR}/pathstroke.exe \ $$QT_BUILD_TREE/examples/graphicsview/elasticnodes/$${BUILD_DIR}/elasticnodes.exe \ $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/wiggly.exe \ - $$QT_BUILD_TREE/examples/painting/concentriccircles/$${BUILD_DIR}/concentriccircles.exe + $$QT_BUILD_TREE/examples/painting/concentriccircles/$${BUILD_DIR}/concentriccircles.exe \ + $$QT_BUILD_TREE/examples/draganddrop/$${BUILD_DIR}/fridgemagnets.exe executables.path = . @@ -54,3 +54,85 @@ wince*{ DEPLOYMENT_PLUGIN += qgif qjpeg qmng qsvg } + +symbian { + load(data_caging_paths) + + TARGET.UID3 = 0xA000A641 + + executables.sources = \ + embeddedsvgviewer.exe \ + styledemo.exe \ + deform.exe \ + pathstroke.exe \ + wiggly.exe \ + ftp.exe \ + context2d.exe \ + saxbookmarks.exe \ + desktopservices.exe \ + fridgemagnets.exe \ + drilldown.exe + + executables.path = /sys/bin + + reg_resource.sources = \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/styledemo_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/deform_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/pathstroke_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/wiggly_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/ftp_reg.rsc\ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc + + reg_resource.path = $$REG_RESOURCE_IMPORT_DIR + + + resource.sources = \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/ftp.rsc\ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc + + resource.path = $$APP_RESOURCE_DIR + + mifs.sources = \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C611.mif + mifs.path = $$APP_RESOURCE_DIR + + files.sources = $$PWD/screenshots $$PWD/slides + files.path = . + + config.sources = $$PWD/config_s60/config.xml + config.path = . + + viewerimages.sources = $$PWD/../embeddedsvgviewer/shapes.svg + viewerimages.path = /data/images/qt/demos/embeddedsvgviewer + + desktopservices_music.sources = \ + $$PWD/../desktopservices/data/*.mp3 \ + $$PWD/../desktopservices/data/*.wav + desktopservices_music.path = /data/sounds + + desktopservices_images.sources = $$PWD/../desktopservices/data/*.png + desktopservices_images.path = /data/images + + saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frankf.xbel + saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jenniferf.xbel + saxbookmarks.path = /data/qt/saxbookmarks + + DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \ + mifs desktopservices_music desktopservices_images + + TARGET.EPOCHEAPSIZE = 100000 20000000 +} diff --git a/demos/embedded/fluidlauncher/pictureflow.cpp b/demos/embedded/fluidlauncher/pictureflow.cpp index 04bbf05..e2f8284 100644 --- a/demos/embedded/fluidlauncher/pictureflow.cpp +++ b/demos/embedded/fluidlauncher/pictureflow.cpp @@ -105,6 +105,14 @@ #include <QDebug> +static const int captionFontSize = +#ifdef Q_WS_S60 + 8; +#else + 14; +#endif + + // uncomment this to enable bilinear filtering for texture mapping // gives much better rendering, at the cost of memory space // #define PICTUREFLOW_BILINEAR_FILTER @@ -739,14 +747,14 @@ void PictureFlowPrivate::render() QPainter painter; painter.begin(&buffer); - QFont font("Arial", 14); + QFont font("Arial", captionFontSize); font.setBold(true); painter.setFont(font); painter.setPen(Qt::white); //painter.setPen(QColor(255,255,255,127)); if (!captions.isEmpty()) - painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2), + painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4), Qt::AlignCenter, captions[centerIndex]); painter.end(); @@ -789,18 +797,18 @@ void PictureFlowPrivate::render() QPainter painter; painter.begin(&buffer); - QFont font("Arial", 14); + QFont font("Arial", captionFontSize); font.setBold(true); painter.setFont(font); int leftTextIndex = (step>0) ? centerIndex : centerIndex-1; painter.setPen(QColor(255,255,255, (255-fade) )); - painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2), + painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4), Qt::AlignCenter, captions[leftTextIndex]); painter.setPen(QColor(255,255,255, fade)); - painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/2), + painter.drawText( QRect(0,0, buffer.width(), (buffer.height() - slideSize().height())/4), Qt::AlignCenter, captions[leftTextIndex+1]); @@ -1265,6 +1273,12 @@ void PictureFlow::keyPressEvent(QKeyEvent* event) return; } + if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Select) { + emit itemActivated(d->getTarget()); + event->accept(); + return; + } + event->ignore(); } diff --git a/demos/embedded/fluidlauncher/screenshots/context2d.png b/demos/embedded/fluidlauncher/screenshots/context2d.png Binary files differnew file mode 100644 index 0000000..d571546 --- /dev/null +++ b/demos/embedded/fluidlauncher/screenshots/context2d.png diff --git a/demos/embedded/fluidlauncher/screenshots/desktopservices.png b/demos/embedded/fluidlauncher/screenshots/desktopservices.png Binary files differnew file mode 100644 index 0000000..a8d82ce --- /dev/null +++ b/demos/embedded/fluidlauncher/screenshots/desktopservices.png diff --git a/demos/embedded/fluidlauncher/screenshots/fridgemagnets.png b/demos/embedded/fluidlauncher/screenshots/fridgemagnets.png Binary files differnew file mode 100644 index 0000000..87b9099 --- /dev/null +++ b/demos/embedded/fluidlauncher/screenshots/fridgemagnets.png diff --git a/demos/embedded/fluidlauncher/screenshots/ftp.png b/demos/embedded/fluidlauncher/screenshots/ftp.png Binary files differnew file mode 100644 index 0000000..fae7ffc --- /dev/null +++ b/demos/embedded/fluidlauncher/screenshots/ftp.png diff --git a/demos/embedded/fluidlauncher/screenshots/saxbookmarks.png b/demos/embedded/fluidlauncher/screenshots/saxbookmarks.png Binary files differnew file mode 100644 index 0000000..6a2b07f --- /dev/null +++ b/demos/embedded/fluidlauncher/screenshots/saxbookmarks.png diff --git a/demos/embedded/styledemo/files/application.qss b/demos/embedded/styledemo/files/application.qss index a632ad1..432fe6b 100644 --- a/demos/embedded/styledemo/files/application.qss +++ b/demos/embedded/styledemo/files/application.qss @@ -6,7 +6,7 @@ QWidget#StyleWidget QLabel, QAbstractButton { - font: 18px bold; + font: bold; color: beige; } diff --git a/demos/embedded/styledemo/files/blue.qss b/demos/embedded/styledemo/files/blue.qss index aa87277..ac8671b 100644 --- a/demos/embedded/styledemo/files/blue.qss +++ b/demos/embedded/styledemo/files/blue.qss @@ -5,7 +5,7 @@ QLabel, QAbstractButton { - font: 10pt bold; + font: bold; color: yellow; } @@ -28,7 +28,6 @@ QAbstractButton border-style: solid; border-radius: 5; padding: 3px; - qproperty-focusPolicy: NoFocus; } QAbstractButton:pressed diff --git a/demos/embedded/styledemo/files/khaki.qss b/demos/embedded/styledemo/files/khaki.qss index 9c0f77c..b0d4a0f 100644 --- a/demos/embedded/styledemo/files/khaki.qss +++ b/demos/embedded/styledemo/files/khaki.qss @@ -16,7 +16,6 @@ QPushButton, QToolButton { padding: 3px; /* min-width: 96px; */ /* min-height: 48px; */ - qproperty-focusPolicy: NoFocus } QPushButton:hover, QToolButton:hover { @@ -30,7 +29,7 @@ QPushButton:pressed, QToolButton:pressed { } QLabel, QAbstractButton { - font: italic 11pt "Times New Roman"; + font: italic "Times New Roman"; } QFrame, QLabel#title { diff --git a/demos/embedded/styledemo/files/transparent.qss b/demos/embedded/styledemo/files/transparent.qss index e3a9912..b38eb36 100644 --- a/demos/embedded/styledemo/files/transparent.qss +++ b/demos/embedded/styledemo/files/transparent.qss @@ -6,7 +6,6 @@ QWidget#StyleWidget QLabel, QAbstractButton { - font: 13pt; color: beige; } diff --git a/demos/embedded/styledemo/styledemo.pro b/demos/embedded/styledemo/styledemo.pro index ee5e4d6..e0ef202 100644 --- a/demos/embedded/styledemo/styledemo.pro +++ b/demos/embedded/styledemo/styledemo.pro @@ -10,3 +10,7 @@ target.path = $$[QT_INSTALL_DEMOS]/embedded/styledemo sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.html sources.path = $$[QT_INSTALL_DEMOS]/embedded/styledemo INSTALLS += target sources + +include($$QT_SOURCE_TREE/demos/demobase.pri) + +symbian:TARGET.UID3 = 0xA000A63F diff --git a/demos/embedded/styledemo/stylewidget.ui b/demos/embedded/styledemo/stylewidget.ui index 586faea..9c5f253 100644 --- a/demos/embedded/styledemo/stylewidget.ui +++ b/demos/embedded/styledemo/stylewidget.ui @@ -5,16 +5,19 @@ <rect> <x>0</x> <y>0</y> - <width>339</width> - <height>230</height> + <width>172</width> + <height>220</height> </rect> </property> <property name="windowTitle" > <string>Form</string> </property> <layout class="QVBoxLayout" name="verticalLayout" > + <property name="spacing" > + <number>4</number> + </property> <property name="margin" > - <number>3</number> + <number>4</number> </property> <item> <widget class="QGroupBox" name="groupBox" > @@ -27,15 +30,15 @@ <property name="title" > <string>Styles</string> </property> - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>3</number> - </property> + <layout class="QGridLayout" name="gridLayout_2" > <property name="margin" > - <number>3</number> + <number>4</number> </property> - <item> - <widget class="QPushButton" name="noStyle" > + <property name="spacing" > + <number>4</number> + </property> + <item row="0" column="0" > + <widget class="QPushButton" name="transparentStyle" > <property name="sizePolicy" > <sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -43,23 +46,23 @@ </sizepolicy> </property> <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> + <enum>Qt::StrongFocus</enum> </property> <property name="text" > - <string>No-Style</string> + <string>Transp.</string> </property> <property name="checkable" > <bool>true</bool> </property> <property name="checked" > - <bool>true</bool> + <bool>false</bool> </property> <property name="autoExclusive" > <bool>true</bool> </property> </widget> </item> - <item> + <item row="2" column="0" > <widget class="QPushButton" name="blueStyle" > <property name="sizePolicy" > <sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" > @@ -68,7 +71,7 @@ </sizepolicy> </property> <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> + <enum>Qt::StrongFocus</enum> </property> <property name="text" > <string>Blue</string> @@ -84,7 +87,7 @@ </property> </widget> </item> - <item> + <item row="0" column="1" > <widget class="QPushButton" name="khakiStyle" > <property name="sizePolicy" > <sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" > @@ -93,7 +96,7 @@ </sizepolicy> </property> <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> + <enum>Qt::StrongFocus</enum> </property> <property name="text" > <string>Khaki</string> @@ -109,8 +112,8 @@ </property> </widget> </item> - <item> - <widget class="QPushButton" name="transparentStyle" > + <item row="2" column="1" > + <widget class="QPushButton" name="noStyle" > <property name="sizePolicy" > <sizepolicy vsizetype="MinimumExpanding" hsizetype="Minimum" > <horstretch>0</horstretch> @@ -118,16 +121,16 @@ </sizepolicy> </property> <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> + <enum>Qt::StrongFocus</enum> </property> <property name="text" > - <string>Transparent</string> + <string>None</string> </property> <property name="checkable" > <bool>true</bool> </property> <property name="checked" > - <bool>false</bool> + <bool>true</bool> </property> <property name="autoExclusive" > <bool>true</bool> @@ -166,7 +169,7 @@ </property> <layout class="QVBoxLayout" name="frameLayout" > <property name="margin" > - <number>3</number> + <number>0</number> </property> <item> <layout class="QHBoxLayout" name="horizontalLayout" > @@ -195,7 +198,7 @@ </sizepolicy> </property> <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> + <enum>Qt::WheelFocus</enum> </property> <property name="alignment" > <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> @@ -209,6 +212,9 @@ </item> <item> <layout class="QGridLayout" name="gridLayout" > + <property name="spacing" > + <number>4</number> + </property> <item row="0" column="0" > <widget class="QScrollBar" name="horizontalScrollBar" > <property name="sizePolicy" > @@ -237,10 +243,10 @@ </sizepolicy> </property> <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> + <enum>Qt::StrongFocus</enum> </property> <property name="text" > - <string>Show Scroller</string> + <string>Show</string> </property> <property name="checkable" > <bool>true</bool> @@ -275,10 +281,10 @@ </sizepolicy> </property> <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> + <enum>Qt::StrongFocus</enum> </property> <property name="text" > - <string>Enable Scroller</string> + <string>Enable</string> </property> <property name="checkable" > <bool>true</bool> @@ -330,7 +336,7 @@ <item> <widget class="QPushButton" name="close" > <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> + <enum>Qt::StrongFocus</enum> </property> <property name="text" > <string>Close</string> diff --git a/demos/embeddeddialogs/embeddeddialogs.pro b/demos/embeddeddialogs/embeddeddialogs.pro index a38e3e8..d9948a9 100644 --- a/demos/embeddeddialogs/embeddeddialogs.pro +++ b/demos/embeddeddialogs/embeddeddialogs.pro @@ -15,3 +15,5 @@ target.path = $$[QT_INSTALL_DEMOS]/embeddeddialogs sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.png *.jpg *.plist *.icns *.ico *.rc *.pro *.html *.doc images sources.path = $$[QT_INSTALL_DEMOS]/embeddeddialogs INSTALLS += target sources + +include($$QT_SOURCE_TREE/demos/demobase.pri) diff --git a/demos/gradients/gradients.pro b/demos/gradients/gradients.pro index 167572b..7789896 100644 --- a/demos/gradients/gradients.pro +++ b/demos/gradients/gradients.pro @@ -16,3 +16,5 @@ target.path = $$[QT_INSTALL_DEMOS]/gradients sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html sources.path = $$[QT_INSTALL_DEMOS]/gradients INSTALLS += target sources + +include($$QT_SOURCE_TREE/demos/demobase.pri) diff --git a/demos/interview/interview.pro b/demos/interview/interview.pro index c013755..19b2ca8 100644 --- a/demos/interview/interview.pro +++ b/demos/interview/interview.pro @@ -16,3 +16,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES README *.pro images sources.path = $$[QT_INSTALL_DEMOS]/interview INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + diff --git a/demos/macmainwindow/macmainwindow.pro b/demos/macmainwindow/macmainwindow.pro index f5165a7..cab3845 100644 --- a/demos/macmainwindow/macmainwindow.pro +++ b/demos/macmainwindow/macmainwindow.pro @@ -20,4 +20,6 @@ target.path = $$[QT_INSTALL_DEMOS]/macmainwindow sources.files = $$SOURCES *.pro *.html sources.path = $$[QT_INSTALL_DEMOS]/macmainwindow INSTALLS += target sources + +include($$QT_SOURCE_TREE/demos/demobase.pri) } diff --git a/demos/mainwindow/mainwindow.pro b/demos/mainwindow/mainwindow.pro index 9853a55..6e7d784 100644 --- a/demos/mainwindow/mainwindow.pro +++ b/demos/mainwindow/mainwindow.pro @@ -14,3 +14,5 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.png *.jpg *.pro sources.path = $$[QT_INSTALL_DEMOS]/mainwindow INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + diff --git a/demos/mediaplayer/mediaplayer.pro b/demos/mediaplayer/mediaplayer.pro index c64abd9..001989d 100644 --- a/demos/mediaplayer/mediaplayer.pro +++ b/demos/mediaplayer/mediaplayer.pro @@ -25,4 +25,4 @@ wince*{ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout } - +include($$QT_SOURCE_TREE/demos/demobase.pri) diff --git a/demos/pathstroke/pathstroke.pro b/demos/pathstroke/pathstroke.pro index 50b4de2..ce6ab3d 100644 --- a/demos/pathstroke/pathstroke.pro +++ b/demos/pathstroke/pathstroke.pro @@ -18,3 +18,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html sources.path = $$[QT_INSTALL_DEMOS]/pathstroke INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + +symbian:TARGET.UID3 = 0xA000A63E
\ No newline at end of file diff --git a/demos/qtdemo/qtdemo.pro b/demos/qtdemo/qtdemo.pro index 2534b75..18eac80 100644 --- a/demos/qtdemo/qtdemo.pro +++ b/demos/qtdemo/qtdemo.pro @@ -4,6 +4,8 @@ DESTDIR = $$QT_BUILD_TREE/bin OBJECTS_DIR = .obj MOC_DIR = .moc INSTALLS += target sources + +include($$QT_SOURCE_TREE/demos/demobase.pri) QT += xml network contains(QT_CONFIG, opengl) { diff --git a/demos/shared/shared.pri b/demos/shared/shared.pri index b551595..1541fa7 100644 --- a/demos/shared/shared.pri +++ b/demos/shared/shared.pri @@ -16,5 +16,6 @@ contains(CONFIG, debug_and_release_target) { hpux-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a hpuxi-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a -!hpuxi-acc*:!hpux-acc*:LIBS += -ldemo_shared +symbian:LIBS += -ldemo_shared.lib +!hpuxi-acc*:!hpux-acc*:!symbian:LIBS += -ldemo_shared diff --git a/demos/shared/shared.pro b/demos/shared/shared.pro index cabce25..a5e0e70 100644 --- a/demos/shared/shared.pro +++ b/demos/shared/shared.pro @@ -29,5 +29,8 @@ target.path = $$[QT_INSTALL_DEMOS]/shared sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.pri images sources.path = $$[QT_INSTALL_DEMOS]/shared INSTALLS += sources + +include($$QT_SOURCE_TREE/demos/demobase.pri) !cross_compile:INSTALLS += target +symbian:TARGET.UID3 = 0xA000A63C diff --git a/demos/spreadsheet/spreadsheet.pro b/demos/spreadsheet/spreadsheet.pro index b62f244..39c76da 100644 --- a/demos/spreadsheet/spreadsheet.pro +++ b/demos/spreadsheet/spreadsheet.pro @@ -31,3 +31,5 @@ sources.files = $$SOURCES $$RESOURCES *.pro images sources.path = $$[QT_INSTALL_DEMOS]/spreadsheet INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + diff --git a/demos/sqlbrowser/sqlbrowser.pro b/demos/sqlbrowser/sqlbrowser.pro index 920e8a0..1334bc1 100644 --- a/demos/sqlbrowser/sqlbrowser.pro +++ b/demos/sqlbrowser/sqlbrowser.pro @@ -18,6 +18,8 @@ sources.files = $$SOURCES $$HEADERS $$FORMS *.pro sources.path = $$[QT_INSTALL_DEMOS]/sqlbrowser INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + wince*: { DEPLOYMENT_PLUGIN += qsqlite } diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp index 128cd6a..7350a42 100644 --- a/demos/textedit/textedit.cpp +++ b/demos/textedit/textedit.cpp @@ -127,7 +127,9 @@ TextEdit::TextEdit(QWidget *parent) connect(textEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool))); connect(textEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool))); +#ifndef QT_NO_CLIPBOARD connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged())); +#endif QString initialFile = ":/example.html"; const QStringList args = QCoreApplication::arguments(); @@ -240,7 +242,9 @@ void TextEdit::setupEditActions() a->setShortcut(QKeySequence::Paste); tb->addAction(a); menu->addAction(a); +#ifndef QT_NO_CLIPBOARD actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); +#endif } void TextEdit::setupTextActions() @@ -638,7 +642,9 @@ void TextEdit::cursorPositionChanged() void TextEdit::clipboardDataChanged() { +#ifndef QT_NO_CLIPBOARD actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); +#endif } void TextEdit::about() diff --git a/demos/textedit/textedit.pro b/demos/textedit/textedit.pro index 1ef4256..6f15e70 100644 --- a/demos/textedit/textedit.pro +++ b/demos/textedit/textedit.pro @@ -19,3 +19,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.doc images sources.path = $$[QT_INSTALL_DEMOS]/textedit INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + diff --git a/demos/undo/undo.pro b/demos/undo/undo.pro index e26d07c..bf7017b 100644 --- a/demos/undo/undo.pro +++ b/demos/undo/undo.pro @@ -15,3 +15,5 @@ sources.files = $$SOURCES $$HEADERS *.pro icons $$RESOURCES $$FORMS sources.path = $$[QT_INSTALL_DEMOS]/undo INSTALLS += target sources +include($$QT_SOURCE_TREE/demos/demobase.pri) + |