summaryrefslogtreecommitdiffstats
path: root/examples/network/threadedfortuneserver
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-23 14:24:07 +0200
commit0748751c9f097d9d866605306bbdd4b96e2a5c4e (patch)
tree1838365e6ad6592a26e193289d2136cb89319972 /examples/network/threadedfortuneserver
parent5feefb0c039dae04290d1fca7c2f24276b6f7582 (diff)
Squashed commit of the changes from the mobile-examples repository
(4.7-generated-declarative branch).
Diffstat (limited to 'examples/network/threadedfortuneserver')
-rw-r--r--examples/network/threadedfortuneserver/dialog.cpp18
-rw-r--r--examples/network/threadedfortuneserver/dialog.h4
-rw-r--r--examples/network/threadedfortuneserver/main.cpp6
-rw-r--r--examples/network/threadedfortuneserver/threadedfortuneserver.pro9
4 files changed, 31 insertions, 6 deletions
diff --git a/examples/network/threadedfortuneserver/dialog.cpp b/examples/network/threadedfortuneserver/dialog.cpp
index b69f42cc85..27bf253b1a 100644
--- a/examples/network/threadedfortuneserver/dialog.cpp
+++ b/examples/network/threadedfortuneserver/dialog.cpp
@@ -47,11 +47,18 @@
#include "fortuneserver.h"
Dialog::Dialog(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
statusLabel = new QLabel;
+ statusLabel->setWordWrap(true);
+#ifdef Q_OS_SYMBIAN
+ QAction *quitAction = new QAction(tr("Exit"), this);
+ quitAction->setSoftKeyRole(QAction::NegativeSoftKey);
+ addAction(quitAction);
+#else
quitButton = new QPushButton(tr("Quit"));
quitButton->setAutoDefault(false);
+#endif
if (!server.listen()) {
QMessageBox::critical(this, tr("Threaded Fortune Server"),
@@ -78,6 +85,13 @@ Dialog::Dialog(QWidget *parent)
"Run the Fortune Client example now.")
.arg(ipAddress).arg(server.serverPort()));
+#ifdef Q_OS_SYMBIAN
+ connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(statusLabel);
+ setLayout(mainLayout);
+#else
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
QHBoxLayout *buttonLayout = new QHBoxLayout;
@@ -89,6 +103,6 @@ Dialog::Dialog(QWidget *parent)
mainLayout->addWidget(statusLabel);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
-
+#endif
setWindowTitle(tr("Threaded Fortune Server"));
}
diff --git a/examples/network/threadedfortuneserver/dialog.h b/examples/network/threadedfortuneserver/dialog.h
index 10ae3ebaa2..19a6fc2f47 100644
--- a/examples/network/threadedfortuneserver/dialog.h
+++ b/examples/network/threadedfortuneserver/dialog.h
@@ -41,7 +41,7 @@
#ifndef DIALOG_H
#define DIALOG_H
-#include <QDialog>
+#include <QWidget>
#include "fortuneserver.h"
QT_BEGIN_NAMESPACE
@@ -49,7 +49,7 @@ class QLabel;
class QPushButton;
QT_END_NAMESPACE
-class Dialog : public QDialog
+class Dialog : public QWidget
{
Q_OBJECT
diff --git a/examples/network/threadedfortuneserver/main.cpp b/examples/network/threadedfortuneserver/main.cpp
index 396f9244b6..1e245e9e01 100644
--- a/examples/network/threadedfortuneserver/main.cpp
+++ b/examples/network/threadedfortuneserver/main.cpp
@@ -49,7 +49,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
+#ifdef Q_OS_SYMBIAN
+ dialog.showMaximized();
+#else
dialog.show();
+#endif
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
- return dialog.exec();
+ return app.exec();
}
diff --git a/examples/network/threadedfortuneserver/threadedfortuneserver.pro b/examples/network/threadedfortuneserver/threadedfortuneserver.pro
index a76974a57e..335666bd76 100644
--- a/examples/network/threadedfortuneserver/threadedfortuneserver.pro
+++ b/examples/network/threadedfortuneserver/threadedfortuneserver.pro
@@ -13,4 +13,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threadedfortuneserver.pr
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/threadedfortuneserver
INSTALLS += target sources
-symbian: CONFIG += qt_example
+symbian: {
+ CONFIG += qt_example
+ TARGET.CAPABILITY = NetworkServices
+}
+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)