diff options
Diffstat (limited to 'examples/dialogs')
21 files changed, 132 insertions, 21 deletions
diff --git a/examples/dialogs/classwizard/classwizard.pro b/examples/dialogs/classwizard/classwizard.pro index 0952e8f724..09cdce2b4c 100644 --- a/examples/dialogs/classwizard/classwizard.pro +++ b/examples/dialogs/classwizard/classwizard.pro @@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/classwizard INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/configdialog/configdialog.pro b/examples/dialogs/configdialog/configdialog.pro index c6e47485bb..24544a9826 100644 --- a/examples/dialogs/configdialog/configdialog.pro +++ b/examples/dialogs/configdialog/configdialog.pro @@ -14,3 +14,7 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/dialogs.pro b/examples/dialogs/dialogs.pro index f4ea5713df..5bdac5a63d 100644 --- a/examples/dialogs/dialogs.pro +++ b/examples/dialogs/dialogs.pro @@ -17,3 +17,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs INSTALLS += sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/dialogs/extension/extension.pro b/examples/dialogs/extension/extension.pro index 108906f483..db57fc8361 100644 --- a/examples/dialogs/extension/extension.pro +++ b/examples/dialogs/extension/extension.pro @@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/extension INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/extension/finddialog.cpp b/examples/dialogs/extension/finddialog.cpp index 313e8e4201..2ce0391d3c 100644 --- a/examples/dialogs/extension/finddialog.cpp +++ b/examples/dialogs/extension/finddialog.cpp @@ -63,9 +63,6 @@ FindDialog::FindDialog(QWidget *parent) //! [0] moreButton->setAutoDefault(false); - buttonBox = new QDialogButtonBox(Qt::Vertical); - buttonBox->addButton(findButton, QDialogButtonBox::ActionRole); - buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole); //! [1] //! [2] @@ -77,7 +74,42 @@ FindDialog::FindDialog(QWidget *parent) //! [2] //! [3] +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR) + // Create menu + QMenu *menu = new QMenu(this); + + // Create Find menu item + menu->addAction(tr("Find")); + + // Create More menu item + QAction *moreAction = menu->addAction(tr("More")); + moreAction->setCheckable(true); + + // Create Options CBA + QAction *optionAction = new QAction(tr("Options"), this); + + // Set defined menu into Options button + optionAction->setMenu(menu); + optionAction->setSoftKeyRole(QAction::PositiveSoftKey); + addAction(optionAction); + + // Connect More menu item to setVisible slot + connect(moreAction, SIGNAL(triggered(bool)), extension, SLOT(setVisible(bool))); + + // Create Exit CBA + QAction *backSoftKeyAction = new QAction(QString(tr("Exit")), this); + backSoftKeyAction->setSoftKeyRole(QAction::NegativeSoftKey); + + // Exit button closes the application + connect(backSoftKeyAction, SIGNAL(triggered()), qApp, SLOT(quit())); + addAction(backSoftKeyAction); +#else + buttonBox = new QDialogButtonBox(Qt::Vertical); + buttonBox->addButton(findButton, QDialogButtonBox::ActionRole); + buttonBox->addButton(moreButton, QDialogButtonBox::ActionRole); + connect(moreButton, SIGNAL(toggled(bool)), extension, SLOT(setVisible(bool))); +#endif QVBoxLayout *extensionLayout = new QVBoxLayout; extensionLayout->setMargin(0); @@ -96,13 +128,18 @@ FindDialog::FindDialog(QWidget *parent) leftLayout->addLayout(topLeftLayout); leftLayout->addWidget(caseCheckBox); leftLayout->addWidget(fromStartCheckBox); - leftLayout->addStretch(1); QGridLayout *mainLayout = new QGridLayout; +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) mainLayout->setSizeConstraint(QLayout::SetFixedSize); +#endif mainLayout->addLayout(leftLayout, 0, 0); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_SIMULATOR) mainLayout->addWidget(buttonBox, 0, 1); +#endif mainLayout->addWidget(extension, 1, 0, 1, 2); + mainLayout->setRowStretch(2, 1); + setLayout(mainLayout); setWindowTitle(tr("Extension")); diff --git a/examples/dialogs/extension/main.cpp b/examples/dialogs/extension/main.cpp index d487faab69..9937b6d0b5 100644 --- a/examples/dialogs/extension/main.cpp +++ b/examples/dialogs/extension/main.cpp @@ -46,5 +46,12 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); FindDialog dialog; - return dialog.exec(); + +#ifdef Q_OS_SYMBIAN + dialog.showMaximized(); +#else + dialog.show(); +#endif + + return app.exec(); } diff --git a/examples/dialogs/findfiles/findfiles.pro b/examples/dialogs/findfiles/findfiles.pro index ffae120bda..865fb8e0ba 100644 --- a/examples/dialogs/findfiles/findfiles.pro +++ b/examples/dialogs/findfiles/findfiles.pro @@ -9,3 +9,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/findfiles INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example diff --git a/examples/dialogs/findfiles/main.cpp b/examples/dialogs/findfiles/main.cpp index f2079f511b..c5a324a452 100644 --- a/examples/dialogs/findfiles/main.cpp +++ b/examples/dialogs/findfiles/main.cpp @@ -46,6 +46,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; +#ifdef Q_OS_SYMBIAN + window.showMaximized(); +#else window.show(); +#endif return app.exec(); } diff --git a/examples/dialogs/findfiles/window.cpp b/examples/dialogs/findfiles/window.cpp index 3d6c0fd398..f700e82d5e 100644 --- a/examples/dialogs/findfiles/window.cpp +++ b/examples/dialogs/findfiles/window.cpp @@ -44,7 +44,7 @@ //! [0] Window::Window(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { browseButton = createButton(tr("&Browse..."), SLOT(browse())); findButton = createButton(tr("&Find"), SLOT(find())); @@ -62,11 +62,8 @@ Window::Window(QWidget *parent) //! [0] //! [1] - QHBoxLayout *buttonsLayout = new QHBoxLayout; - buttonsLayout->addStretch(); - buttonsLayout->addWidget(findButton); - QGridLayout *mainLayout = new QGridLayout; + mainLayout->setSizeConstraint(QLayout::SetNoConstraint); mainLayout->addWidget(fileLabel, 0, 0); mainLayout->addWidget(fileComboBox, 0, 1, 1, 2); mainLayout->addWidget(textLabel, 1, 0); @@ -75,12 +72,14 @@ Window::Window(QWidget *parent) mainLayout->addWidget(directoryComboBox, 2, 1); mainLayout->addWidget(browseButton, 2, 2); mainLayout->addWidget(filesTable, 3, 0, 1, 3); - mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 3); - mainLayout->addLayout(buttonsLayout, 5, 0, 1, 3); + mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 2); + mainLayout->addWidget(findButton, 4, 2); setLayout(mainLayout); setWindowTitle(tr("Find Files")); +#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR) resize(700, 300); +#endif } //! [1] @@ -194,7 +193,12 @@ void Window::showFiles(const QStringList &files) filesTable->setItem(row, 1, sizeItem); } filesFoundLabel->setText(tr("%1 file(s) found").arg(files.size()) + +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + (" (Select file to open it)")); +#else (" (Double click on a file to open it)")); +#endif + filesFoundLabel->setWordWrap(true); } //! [8] @@ -214,6 +218,9 @@ QComboBox *Window::createComboBox(const QString &text) comboBox->setEditable(true); comboBox->addItem(text); comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + comboBox->setMinimumContentsLength(3); +#endif return comboBox; } //! [10] @@ -225,7 +232,7 @@ void Window::createFilesTable() filesTable->setSelectionBehavior(QAbstractItemView::SelectRows); QStringList labels; - labels << tr("File Name") << tr("Size"); + labels << tr("Filename") << tr("Size"); filesTable->setHorizontalHeaderLabels(labels); filesTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); filesTable->verticalHeader()->hide(); diff --git a/examples/dialogs/findfiles/window.h b/examples/dialogs/findfiles/window.h index 73b065233b..4dbb446e18 100644 --- a/examples/dialogs/findfiles/window.h +++ b/examples/dialogs/findfiles/window.h @@ -41,7 +41,7 @@ #ifndef WINDOW_H #define WINDOW_H -#include <QDialog> +#include <QWidget> #include <QDir> QT_BEGIN_NAMESPACE @@ -53,7 +53,7 @@ class QTableWidgetItem; QT_END_NAMESPACE //! [0] -class Window : public QDialog +class Window : public QWidget { Q_OBJECT diff --git a/examples/dialogs/licensewizard/licensewizard.pro b/examples/dialogs/licensewizard/licensewizard.pro index cdf6aa7fdc..4c43e7ae91 100644 --- a/examples/dialogs/licensewizard/licensewizard.pro +++ b/examples/dialogs/licensewizard/licensewizard.pro @@ -10,3 +10,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/licensewizard INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/sipdialog/sipdialog.pro b/examples/dialogs/sipdialog/sipdialog.pro index ffc9693604..015aa43dac 100644 --- a/examples/dialogs/sipdialog/sipdialog.pro +++ b/examples/dialogs/sipdialog/sipdialog.pro @@ -11,4 +11,7 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib - +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) +simulator: warning(This example might not fully work on Simulator platform) diff --git a/examples/dialogs/standarddialogs/dialog.cpp b/examples/dialogs/standarddialogs/dialog.cpp index 0b7728ece4..a59b3c5ef7 100644 --- a/examples/dialogs/standarddialogs/dialog.cpp +++ b/examples/dialogs/standarddialogs/dialog.cpp @@ -49,7 +49,7 @@ "will activate the detected escape button (if any).") Dialog::Dialog(QWidget *parent) - : QDialog(parent) + : QWidget(parent) { errorMessageDialog = new QErrorMessage(this); @@ -149,6 +149,7 @@ Dialog::Dialog(QWidget *parent) native = new QCheckBox(this); native->setText("Use native file dialog."); native->setChecked(true); + QGridLayout *layout = new QGridLayout; layout->setColumnStretch(1, 1); layout->setColumnMinimumWidth(1, 250); @@ -183,7 +184,19 @@ Dialog::Dialog(QWidget *parent) layout->addWidget(errorButton, 14, 0); layout->addWidget(errorLabel, 14, 1); layout->addWidget(native, 15, 0); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR) + QWidget *widget = new QWidget; + widget->setLayout(layout); + + QScrollArea *scrollArea = new QScrollArea(this); + scrollArea->setWidget(widget); + + QHBoxLayout *mainLayout = new QHBoxLayout; + mainLayout->addWidget(scrollArea); + setLayout(mainLayout); +#else setLayout(layout); +#endif setWindowTitle(tr("Standard Dialogs")); } diff --git a/examples/dialogs/standarddialogs/dialog.h b/examples/dialogs/standarddialogs/dialog.h index 9af17d130b..506fc00f90 100644 --- a/examples/dialogs/standarddialogs/dialog.h +++ b/examples/dialogs/standarddialogs/dialog.h @@ -41,7 +41,7 @@ #ifndef DIALOG_H #define DIALOG_H -#include <QDialog> +#include <QWidget> QT_BEGIN_NAMESPACE class QCheckBox; @@ -49,7 +49,7 @@ class QLabel; class QErrorMessage; QT_END_NAMESPACE -class Dialog : public QDialog +class Dialog : public QWidget { Q_OBJECT diff --git a/examples/dialogs/standarddialogs/main.cpp b/examples/dialogs/standarddialogs/main.cpp index 2aec376dab..5dbf2cf910 100644 --- a/examples/dialogs/standarddialogs/main.cpp +++ b/examples/dialogs/standarddialogs/main.cpp @@ -56,5 +56,11 @@ int main(int argc, char *argv[]) app.installTranslator(translator); Dialog dialog; - return dialog.exec(); +#ifdef Q_OS_SYMBIAN + dialog.showMaximized(); +#else + dialog.show(); +#endif + + return app.exec(); } diff --git a/examples/dialogs/standarddialogs/standarddialogs.pro b/examples/dialogs/standarddialogs/standarddialogs.pro index f7b3cef905..e8f63d0127 100644 --- a/examples/dialogs/standarddialogs/standarddialogs.pro +++ b/examples/dialogs/standarddialogs/standarddialogs.pro @@ -11,3 +11,4 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/dialogs/tabdialog/main.cpp b/examples/dialogs/tabdialog/main.cpp index 87265c3986..6c83aa0b80 100644 --- a/examples/dialogs/tabdialog/main.cpp +++ b/examples/dialogs/tabdialog/main.cpp @@ -53,5 +53,11 @@ int main(int argc, char *argv[]) fileName = "."; TabDialog tabdialog(fileName); - return tabdialog.exec(); +#ifdef Q_OS_SYMBIAN + tabdialog.showMaximized(); +#else + tabdialog.show(); +#endif + + return app.exec(); } diff --git a/examples/dialogs/tabdialog/tabdialog.cpp b/examples/dialogs/tabdialog/tabdialog.cpp index 62c921c84b..5d4d345a0c 100644 --- a/examples/dialogs/tabdialog/tabdialog.cpp +++ b/examples/dialogs/tabdialog/tabdialog.cpp @@ -65,6 +65,7 @@ TabDialog::TabDialog(const QString &fileName, QWidget *parent) //! [4] QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->setSizeConstraint(QLayout::SetNoConstraint); mainLayout->addWidget(tabWidget); mainLayout->addWidget(buttonBox); setLayout(mainLayout); diff --git a/examples/dialogs/tabdialog/tabdialog.pro b/examples/dialogs/tabdialog/tabdialog.pro index c67fcbd157..0486db9ca9 100644 --- a/examples/dialogs/tabdialog/tabdialog.pro +++ b/examples/dialogs/tabdialog/tabdialog.pro @@ -10,3 +10,6 @@ INSTALLS += target sources symbian: CONFIG += qt_example wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) +symbian: warning(This example might not fully work on Symbian platform) +maemo5: warning(This example might not fully work on Maemo platform) diff --git a/examples/dialogs/trivialwizard/trivialwizard.cpp b/examples/dialogs/trivialwizard/trivialwizard.cpp index 2a5c0ae5db..3dbc039b62 100644 --- a/examples/dialogs/trivialwizard/trivialwizard.cpp +++ b/examples/dialogs/trivialwizard/trivialwizard.cpp @@ -128,7 +128,11 @@ int main(int argc, char *argv[]) wizard.addPage(createConclusionPage()); wizard.setWindowTitle("Trivial Wizard"); +#ifdef Q_OS_SYMBIAN + wizard.showMaximized(); +#else wizard.show(); +#endif return app.exec(); } diff --git a/examples/dialogs/trivialwizard/trivialwizard.pro b/examples/dialogs/trivialwizard/trivialwizard.pro index 31422de763..0321ac8fdb 100644 --- a/examples/dialogs/trivialwizard/trivialwizard.pro +++ b/examples/dialogs/trivialwizard/trivialwizard.pro @@ -7,3 +7,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dialogs/trivialwizard INSTALLS += target sources symbian: CONFIG += qt_example +maemo5: CONFIG += qt_example +symbian: warning(This example might not fully work on Symbian platform) +simulator: warning(This example might not fully work on Simulator platform) |