From f19290bd6d0babefd660aa589f004b1b1a8c2a30 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 15 Mar 2010 13:48:29 +0200 Subject: Added exit softkey to Wiggly example Part of QtP delta reduction effort, original task: QTTH-42 Reviewed-by: Janne Anttila --- examples/widgets/wiggly/dialog.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/widgets/wiggly/dialog.cpp b/examples/widgets/wiggly/dialog.cpp index 02d3272..0838472 100644 --- a/examples/widgets/wiggly/dialog.cpp +++ b/examples/widgets/wiggly/dialog.cpp @@ -56,6 +56,17 @@ Dialog::Dialog(QWidget *parent, bool smallScreen) layout->addWidget(lineEdit); setLayout(layout); +#ifdef QT_SOFTKEYS_ENABLED + QAction *exitAction = new QAction(tr("Exit"), this); + exitAction->setSoftKeyRole(QAction::NegativeSoftKey); + connect (exitAction, SIGNAL(triggered()),this, SLOT(close())); + addAction (exitAction); + + Qt::WindowFlags flags = windowFlags(); + flags |= Qt::WindowSoftkeysVisibleHint; + setWindowFlags(flags); +#endif + connect(lineEdit, SIGNAL(textChanged(QString)), wigglyWidget, SLOT(setText(QString))); if (!smallScreen){ -- cgit v0.12