summaryrefslogtreecommitdiffstats
path: root/examples/network
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
parent5feefb0c039dae04290d1fca7c2f24276b6f7582 (diff)
Squashed commit of the changes from the mobile-examples repository
(4.7-generated-declarative branch).
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp8
-rw-r--r--examples/network/bearermonitor/bearermonitor.h4
-rw-r--r--examples/network/bearermonitor/bearermonitor.pro9
-rw-r--r--examples/network/blockingfortuneclient/blockingclient.cpp54
-rw-r--r--examples/network/blockingfortuneclient/blockingclient.h10
-rw-r--r--examples/network/blockingfortuneclient/blockingfortuneclient.pro9
-rw-r--r--examples/network/blockingfortuneclient/main.cpp6
-rw-r--r--examples/network/broadcastreceiver/broadcastreceiver.pro6
-rw-r--r--examples/network/broadcastreceiver/main.cpp6
-rw-r--r--examples/network/broadcastreceiver/receiver.cpp18
-rw-r--r--examples/network/broadcastreceiver/receiver.h9
-rw-r--r--examples/network/broadcastsender/broadcastsender.pro6
-rw-r--r--examples/network/broadcastsender/main.cpp6
-rw-r--r--examples/network/broadcastsender/sender.cpp3
-rw-r--r--examples/network/broadcastsender/sender.h4
-rw-r--r--examples/network/download/download.pro5
-rw-r--r--examples/network/downloadmanager/downloadmanager.pro12
-rw-r--r--examples/network/fortuneclient/fortuneclient.pro5
-rw-r--r--examples/network/fortuneserver/fortuneserver.pro5
-rw-r--r--examples/network/googlesuggest/googlesuggest.pro7
-rw-r--r--examples/network/http/http.pro6
-rw-r--r--examples/network/http/httpwindow.cpp25
-rw-r--r--examples/network/http/httpwindow.h10
-rw-r--r--examples/network/http/main.cpp17
-rw-r--r--examples/network/loopback/dialog.cpp31
-rw-r--r--examples/network/loopback/dialog.h7
-rw-r--r--examples/network/loopback/loopback.pro6
-rw-r--r--examples/network/loopback/main.cpp6
-rw-r--r--examples/network/network-chat/network-chat.pro4
-rw-r--r--examples/network/network.pro1
-rw-r--r--examples/network/qftp/ftpwindow.cpp8
-rw-r--r--examples/network/qftp/qftp.pro4
-rw-r--r--examples/network/securesocketclient/certificateinfo.cpp4
-rw-r--r--examples/network/securesocketclient/certificateinfo.ui68
-rw-r--r--examples/network/securesocketclient/main.cpp4
-rw-r--r--examples/network/securesocketclient/securesocketclient.pro3
-rw-r--r--examples/network/securesocketclient/sslclient.cpp7
-rw-r--r--examples/network/securesocketclient/sslclient.ui223
-rw-r--r--examples/network/securesocketclient/sslerrors.ui57
-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
-rw-r--r--examples/network/torrent/torrent.pro5
44 files changed, 517 insertions, 208 deletions
diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index 942b19ce01..43ae8e9027 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -63,7 +63,7 @@ BearerMonitor::BearerMonitor(QWidget *parent)
delete tabWidget->currentWidget();
sessionGroup->hide();
#endif
-#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI)
+#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(MAEMO_UI) || defined(Q_WS_SIMULATOR)
setWindowState(Qt::WindowMaximized);
#endif
updateConfigurations();
@@ -87,7 +87,7 @@ BearerMonitor::BearerMonitor(QWidget *parent)
this, SLOT(configurationChanged(const QNetworkConfiguration)));
connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations()));
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork()));
connect(unregisterButton, SIGNAL(clicked()), this, SLOT(unregisterNetwork()));
#else
@@ -226,7 +226,7 @@ void BearerMonitor::updateConfigurations()
if (defaultConfiguration.type() == QNetworkConfiguration::ServiceNetwork)
updateSnapConfiguration(defaultItem, defaultConfiguration);
- } else if (defaultConfiguration.isValid()) {
+ } else {
configurationAdded(defaultConfiguration);
}
@@ -260,7 +260,7 @@ void BearerMonitor::onlineStateChanged(bool isOnline)
onlineState->setText(tr("Offline"));
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
void BearerMonitor::registerNetwork()
{
QTreeWidgetItem *item = treeWidget->currentItem();
diff --git a/examples/network/bearermonitor/bearermonitor.h b/examples/network/bearermonitor/bearermonitor.h
index a06522fafa..f4dbf81dee 100644
--- a/examples/network/bearermonitor/bearermonitor.h
+++ b/examples/network/bearermonitor/bearermonitor.h
@@ -43,7 +43,7 @@
#include <qnetworkconfigmanager.h>
#include <qnetworksession.h>
-#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE)
+#if defined (Q_OS_SYMBIAN) || defined(Q_OS_WINCE) || defined(Q_WS_SIMULATOR)
#include "ui_bearermonitor_240_320.h"
#elif defined(MAEMO_UI)
#include "ui_bearermonitor_maemo.h"
@@ -72,7 +72,7 @@ private slots:
void onlineStateChanged(bool isOnline);
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) || defined(Q_WS_SIMULATOR)
void registerNetwork();
void unregisterNetwork();
#endif
diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro
index bd9bd68e5c..a91f064f3e 100644
--- a/examples/network/bearermonitor/bearermonitor.pro
+++ b/examples/network/bearermonitor/bearermonitor.pro
@@ -23,4 +23,11 @@ wince*:LIBS += -lws2
CONFIG += console
-symbian:TARGET.CAPABILITY = NetworkServices ReadUserData
+symbian: {
+ TARGET.CAPABILITY = NetworkServices ReadUserData
+ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+}
+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/network/blockingfortuneclient/blockingclient.cpp b/examples/network/blockingfortuneclient/blockingclient.cpp
index f5def3d927..bd2fb829a9 100644
--- a/examples/network/blockingfortuneclient/blockingclient.cpp
+++ b/examples/network/blockingfortuneclient/blockingclient.cpp
@@ -44,7 +44,7 @@
#include "blockingclient.h"
BlockingClient::BlockingClient(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
hostLabel = new QLabel(tr("&Server name:"));
portLabel = new QLabel(tr("S&erver port:"));
@@ -68,12 +68,35 @@ BlockingClient::BlockingClient(QWidget *parent)
portLineEdit = new QLineEdit;
portLineEdit->setValidator(new QIntValidator(1, 65535, this));
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ Qt::InputMethodHint hints = Qt::ImhDigitsOnly;
+ portLineEdit->setInputMethodHints(hints);
+#endif
+
hostLabel->setBuddy(hostLineEdit);
portLabel->setBuddy(portLineEdit);
statusLabel = new QLabel(tr("This examples requires that you run the "
"Fortune Server example as well."));
+ statusLabel->setWordWrap(true);
+
+#ifdef Q_OS_SYMBIAN
+ QMenu *menu = new QMenu(this);
+ fortuneAction = menu->addAction(tr("Get Fortune"));
+ fortuneAction->setVisible(false);
+
+ QAction *optionsAction = new QAction(tr("Options"), this);
+ optionsAction->setMenu(menu);
+ optionsAction->setSoftKeyRole(QAction::PositiveSoftKey);
+ addAction(optionsAction);
+
+ exitAction = new QAction(tr("Exit"), this);
+ exitAction->setSoftKeyRole(QAction::NegativeSoftKey);
+ addAction(exitAction);
+ connect(fortuneAction, SIGNAL(triggered()), this, SLOT(requestNewFortune()));
+ connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
+#else
getFortuneButton = new QPushButton(tr("Get Fortune"));
getFortuneButton->setDefault(true);
getFortuneButton->setEnabled(false);
@@ -84,13 +107,14 @@ BlockingClient::BlockingClient(QWidget *parent)
buttonBox->addButton(getFortuneButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
+ connect(getFortuneButton, SIGNAL(clicked()), this, SLOT(requestNewFortune()));
+ connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
+#endif
+
connect(hostLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(enableGetFortuneButton()));
connect(portLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(enableGetFortuneButton()));
- connect(getFortuneButton, SIGNAL(clicked()),
- this, SLOT(requestNewFortune()));
- connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
//! [0]
connect(&thread, SIGNAL(newFortune(QString)),
this, SLOT(showFortune(QString)));
@@ -105,7 +129,9 @@ BlockingClient::BlockingClient(QWidget *parent)
mainLayout->addWidget(portLabel, 1, 0);
mainLayout->addWidget(portLineEdit, 1, 1);
mainLayout->addWidget(statusLabel, 2, 0, 1, 2);
+#ifndef Q_OS_SYMBIAN
mainLayout->addWidget(buttonBox, 3, 0, 1, 2);
+#endif
setLayout(mainLayout);
setWindowTitle(tr("Blocking Fortune Client"));
@@ -115,7 +141,11 @@ BlockingClient::BlockingClient(QWidget *parent)
//! [2]
void BlockingClient::requestNewFortune()
{
+#ifdef Q_OS_SYMBIAN
+ fortuneAction->setVisible(false);
+#else
getFortuneButton->setEnabled(false);
+#endif
thread.requestNewFortune(hostLineEdit->text(),
portLineEdit->text().toInt());
}
@@ -133,7 +163,11 @@ void BlockingClient::showFortune(const QString &nextFortune)
//! [4]
currentFortune = nextFortune;
statusLabel->setText(currentFortune);
+#ifdef Q_OS_SYMBIAN
+ fortuneAction->setVisible(true);
+#else
getFortuneButton->setEnabled(true);
+#endif
}
//! [4]
@@ -158,11 +192,19 @@ void BlockingClient::displayError(int socketError, const QString &message)
.arg(message));
}
+#ifdef Q_OS_SYMBIAN
+ fortuneAction->setVisible(true);
+#else
getFortuneButton->setEnabled(true);
+#endif
}
void BlockingClient::enableGetFortuneButton()
{
- getFortuneButton->setEnabled(!hostLineEdit->text().isEmpty()
- && !portLineEdit->text().isEmpty());
+ bool enable(!hostLineEdit->text().isEmpty() && !portLineEdit->text().isEmpty());
+#ifdef Q_OS_SYMBIAN
+ fortuneAction->setVisible(enable);
+#else
+ getFortuneButton->setEnabled(enable);
+#endif
}
diff --git a/examples/network/blockingfortuneclient/blockingclient.h b/examples/network/blockingfortuneclient/blockingclient.h
index 8b76fa6596..83ff93b228 100644
--- a/examples/network/blockingfortuneclient/blockingclient.h
+++ b/examples/network/blockingfortuneclient/blockingclient.h
@@ -41,7 +41,7 @@
#ifndef BLOCKINGCLIENT_H
#define BLOCKINGCLIENT_H
-#include <QDialog>
+#include <QWidget>
#include "fortunethread.h"
@@ -50,10 +50,11 @@ class QDialogButtonBox;
class QLabel;
class QLineEdit;
class QPushButton;
+class QAction;
QT_END_NAMESPACE
//! [0]
-class BlockingClient : public QDialog
+class BlockingClient : public QWidget
{
Q_OBJECT
@@ -72,9 +73,14 @@ private:
QLineEdit *hostLineEdit;
QLineEdit *portLineEdit;
QLabel *statusLabel;
+#ifdef Q_OS_SYMBIAN
+ QAction *fortuneAction;
+ QAction *exitAction;
+#else
QPushButton *getFortuneButton;
QPushButton *quitButton;
QDialogButtonBox *buttonBox;
+#endif
FortuneThread thread;
QString currentFortune;
diff --git a/examples/network/blockingfortuneclient/blockingfortuneclient.pro b/examples/network/blockingfortuneclient/blockingfortuneclient.pro
index 2faedaa810..ea64f00b92 100644
--- a/examples/network/blockingfortuneclient/blockingfortuneclient.pro
+++ b/examples/network/blockingfortuneclient/blockingfortuneclient.pro
@@ -11,4 +11,11 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blockingfortuneclient.pr
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/blockingfortuneclient
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)
diff --git a/examples/network/blockingfortuneclient/main.cpp b/examples/network/blockingfortuneclient/main.cpp
index d1ff1659af..97ce59fdb3 100644
--- a/examples/network/blockingfortuneclient/main.cpp
+++ b/examples/network/blockingfortuneclient/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
BlockingClient client;
+#ifdef Q_OS_SYMBIAN
+ client.showMaximized();
+#else
client.show();
- return client.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/broadcastreceiver/broadcastreceiver.pro b/examples/network/broadcastreceiver/broadcastreceiver.pro
index 458585def3..adef726ed0 100644
--- a/examples/network/broadcastreceiver/broadcastreceiver.pro
+++ b/examples/network/broadcastreceiver/broadcastreceiver.pro
@@ -9,4 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastreceiver.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/broadcastreceiver
INSTALLS += target sources
-symbian: CONFIG += qt_example
+symbian: {
+ CONFIG += qt_example
+ TARGET.CAPABILITY = NetworkServices
+}
+maemo5: CONFIG += qt_example
diff --git a/examples/network/broadcastreceiver/main.cpp b/examples/network/broadcastreceiver/main.cpp
index 041163178d..80d0bba869 100644
--- a/examples/network/broadcastreceiver/main.cpp
+++ b/examples/network/broadcastreceiver/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Receiver receiver;
+#ifdef Q_OS_SYMBIAN
+ receiver.showMaximized();
+#else
receiver.show();
- return receiver.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/broadcastreceiver/receiver.cpp b/examples/network/broadcastreceiver/receiver.cpp
index bd45a3cb35..04feffbc80 100644
--- a/examples/network/broadcastreceiver/receiver.cpp
+++ b/examples/network/broadcastreceiver/receiver.cpp
@@ -44,10 +44,18 @@
#include "receiver.h"
Receiver::Receiver(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
statusLabel = new QLabel(tr("Listening for broadcasted messages"));
+ statusLabel->setWordWrap(true);
+
+#ifdef Q_OS_SYMBIAN
+ quitAction = new QAction(tr("Exit"), this);
+ quitAction->setSoftKeyRole(QAction::NegativeSoftKey);
+ addAction(quitAction);
+#else
quitButton = new QPushButton(tr("&Quit"));
+#endif
//! [0]
udpSocket = new QUdpSocket(this);
@@ -58,6 +66,13 @@ Receiver::Receiver(QWidget *parent)
connect(udpSocket, SIGNAL(readyRead()),
this, SLOT(processPendingDatagrams()));
//! [1]
+#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;
@@ -69,6 +84,7 @@ Receiver::Receiver(QWidget *parent)
mainLayout->addWidget(statusLabel);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
+#endif
setWindowTitle(tr("Broadcast Receiver"));
}
diff --git a/examples/network/broadcastreceiver/receiver.h b/examples/network/broadcastreceiver/receiver.h
index 80b35a5571..3084da1e26 100644
--- a/examples/network/broadcastreceiver/receiver.h
+++ b/examples/network/broadcastreceiver/receiver.h
@@ -41,15 +41,16 @@
#ifndef RECEIVER_H
#define RECEIVER_H
-#include <QDialog>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QLabel;
class QPushButton;
class QUdpSocket;
+class QAction;
QT_END_NAMESPACE
-class Receiver : public QDialog
+class Receiver : public QWidget
{
Q_OBJECT
@@ -61,7 +62,11 @@ private slots:
private:
QLabel *statusLabel;
+#ifdef Q_OS_SYMBIAN
+ QAction *quitAction;
+#else
QPushButton *quitButton;
+#endif
QUdpSocket *udpSocket;
};
diff --git a/examples/network/broadcastsender/broadcastsender.pro b/examples/network/broadcastsender/broadcastsender.pro
index eb76c38071..d2bf78d414 100644
--- a/examples/network/broadcastsender/broadcastsender.pro
+++ b/examples/network/broadcastsender/broadcastsender.pro
@@ -9,4 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS broadcastsender.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/broadcastsender
INSTALLS += target sources
-symbian: CONFIG += qt_example
+symbian: {
+ CONFIG += qt_example
+ TARGET.CAPABILITY = NetworkServices
+}
+maemo5: CONFIG += qt_example
diff --git a/examples/network/broadcastsender/main.cpp b/examples/network/broadcastsender/main.cpp
index 56e35c9540..88be21d2d8 100644
--- a/examples/network/broadcastsender/main.cpp
+++ b/examples/network/broadcastsender/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Sender sender;
+#ifdef Q_OS_SYMBIAN
+ sender.showMaximized();
+#else
sender.show();
- return sender.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/broadcastsender/sender.cpp b/examples/network/broadcastsender/sender.cpp
index d753094637..7ce877d586 100644
--- a/examples/network/broadcastsender/sender.cpp
+++ b/examples/network/broadcastsender/sender.cpp
@@ -44,9 +44,10 @@
#include "sender.h"
Sender::Sender(QWidget *parent)
- : QDialog(parent)
+ : QWidget(parent)
{
statusLabel = new QLabel(tr("Ready to broadcast datagrams on port 45454"));
+ statusLabel->setWordWrap(true);
startButton = new QPushButton(tr("&Start"));
quitButton = new QPushButton(tr("&Quit"));
diff --git a/examples/network/broadcastsender/sender.h b/examples/network/broadcastsender/sender.h
index d592051efd..666269f38e 100644
--- a/examples/network/broadcastsender/sender.h
+++ b/examples/network/broadcastsender/sender.h
@@ -41,7 +41,7 @@
#ifndef SENDER_H
#define SENDER_H
-#include <QDialog>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QDialogButtonBox;
@@ -51,7 +51,7 @@ class QTimer;
class QUdpSocket;
QT_END_NAMESPACE
-class Sender : public QDialog
+class Sender : public QWidget
{
Q_OBJECT
diff --git a/examples/network/download/download.pro b/examples/network/download/download.pro
index 4bea359f16..a3b270d252 100644
--- a/examples/network/download/download.pro
+++ b/examples/network/download/download.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT = core network
@@ -19,3 +18,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/download
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)
diff --git a/examples/network/downloadmanager/downloadmanager.pro b/examples/network/downloadmanager/downloadmanager.pro
index 8855aae94c..2f83f41afc 100644
--- a/examples/network/downloadmanager/downloadmanager.pro
+++ b/examples/network/downloadmanager/downloadmanager.pro
@@ -3,7 +3,6 @@
######################################################################
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT = core network
@@ -20,3 +19,14 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/downloadmanager
INSTALLS += target sources
symbian: CONFIG += qt_example
+maemo5: CONFIG += qt_example
+
+OTHER_FILES += \
+ debian/changelog \
+ debian/compat \
+ debian/control \
+ debian/copyright \
+ debian/README \
+ debian/rules
+symbian: warning(This example might not fully work on Symbian platform)
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/network/fortuneclient/fortuneclient.pro b/examples/network/fortuneclient/fortuneclient.pro
index 2e3ec01abb..2737f9862a 100644
--- a/examples/network/fortuneclient/fortuneclient.pro
+++ b/examples/network/fortuneclient/fortuneclient.pro
@@ -14,3 +14,8 @@ symbian {
TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
+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/network/fortuneserver/fortuneserver.pro b/examples/network/fortuneserver/fortuneserver.pro
index c34c565a0f..1d84c49593 100644
--- a/examples/network/fortuneserver/fortuneserver.pro
+++ b/examples/network/fortuneserver/fortuneserver.pro
@@ -15,3 +15,8 @@ symbian {
TARGET.CAPABILITY = "NetworkServices ReadUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
+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/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro
index e118dc9c26..9b8fa9423d 100644
--- a/examples/network/googlesuggest/googlesuggest.pro
+++ b/examples/network/googlesuggest/googlesuggest.pro
@@ -7,3 +7,10 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/googlesuggest
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/googlesuggest
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+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/network/http/http.pro b/examples/network/http/http.pro
index 74a8e49d90..7da0979935 100644
--- a/examples/network/http/http.pro
+++ b/examples/network/http/http.pro
@@ -10,4 +10,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS http.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/http
INSTALLS += target sources
-symbian: CONFIG += qt_example
+symbian: {
+ CONFIG += qt_example
+ TARGET.CAPABILITY = NetworkServices
+}
+maemo5: CONFIG += qt_example
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index 874994ab92..6497a33508 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -45,7 +45,11 @@
#include "ui_authenticationdialog.h"
HttpWindow::HttpWindow(QWidget *parent)
+#ifdef Q_WS_MAEMO_5
+ : QWidget(parent)
+#else
: QDialog(parent)
+#endif
{
#ifndef QT_NO_OPENSSL
urlLineEdit = new QLineEdit("https://qt.nokia.com/");
@@ -57,6 +61,7 @@ HttpWindow::HttpWindow(QWidget *parent)
urlLabel->setBuddy(urlLineEdit);
statusLabel = new QLabel(tr("Please enter the URL of a file you want to "
"download."));
+ statusLabel->setWordWrap(true);
downloadButton = new QPushButton(tr("Download"));
downloadButton->setDefault(true);
@@ -67,7 +72,9 @@ HttpWindow::HttpWindow(QWidget *parent)
buttonBox->addButton(downloadButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
+#ifndef Q_WS_MAEMO_5
progressDialog = new QProgressDialog(this);
+#endif
connect(urlLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(enableDownloadButton()));
@@ -78,7 +85,9 @@ HttpWindow::HttpWindow(QWidget *parent)
connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
+#ifndef Q_WS_MAEMO_5
connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
+#endif
connect(downloadButton, SIGNAL(clicked()), this, SLOT(downloadFile()));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
@@ -117,7 +126,7 @@ void HttpWindow::downloadFile()
fileName = "index.html";
if (QFile::exists(fileName)) {
- if (QMessageBox::question(this, tr("HTTP"),
+ if (QMessageBox::question(this, tr("HTTP"),
tr("There already exists a file called %1 in "
"the current directory. Overwrite?").arg(fileName),
QMessageBox::Yes|QMessageBox::No, QMessageBox::No)
@@ -136,9 +145,10 @@ void HttpWindow::downloadFile()
return;
}
-
+#ifndef Q_WS_MAEMO_5
progressDialog->setWindowTitle(tr("HTTP"));
progressDialog->setLabelText(tr("Downloading %1.").arg(fileName));
+#endif
downloadButton->setEnabled(false);
// schedule the request
@@ -164,11 +174,15 @@ void HttpWindow::httpFinished()
file = 0;
}
reply->deleteLater();
+#ifndef Q_WS_MAEMO_5
progressDialog->hide();
+#endif
return;
}
+#ifndef Q_WS_MAEMO_5
progressDialog->hide();
+#endif
file->flush();
file->close();
@@ -194,7 +208,7 @@ void HttpWindow::httpFinished()
}
} else {
QString fileName = QFileInfo(QUrl(urlLineEdit->text()).path()).fileName();
- statusLabel->setText(tr("Downloaded %1 to current directory.").arg(fileName));
+ statusLabel->setText(tr("Downloaded %1 to %2.").arg(fileName).arg(QDir::currentPath()));
downloadButton->setEnabled(true);
}
@@ -219,8 +233,13 @@ void HttpWindow::updateDataReadProgress(qint64 bytesRead, qint64 totalBytes)
if (httpRequestAborted)
return;
+#ifndef Q_WS_MAEMO_5
progressDialog->setMaximum(totalBytes);
progressDialog->setValue(bytesRead);
+#else
+ Q_UNUSED(bytesRead);
+ Q_UNUSED(totalBytes);
+#endif
}
void HttpWindow::enableDownloadButton()
diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h
index 0ec87af48a..8bbe1a261a 100644
--- a/examples/network/http/httpwindow.h
+++ b/examples/network/http/httpwindow.h
@@ -41,7 +41,11 @@
#ifndef HTTPWINDOW_H
#define HTTPWINDOW_H
+#ifdef Q_WS_MAEMO_5
+#include <QWidget>
+#else
#include <QDialog>
+#endif
#include <QNetworkAccessManager>
#include <QUrl>
@@ -59,7 +63,11 @@ class QNetworkReply;
QT_END_NAMESPACE
+#ifdef Q_WS_MAEMO_5
+class HttpWindow : public QWidget
+#else
class HttpWindow : public QDialog
+#endif
{
Q_OBJECT
@@ -84,7 +92,9 @@ private:
QLabel *statusLabel;
QLabel *urlLabel;
QLineEdit *urlLineEdit;
+#ifndef Q_WS_MAEMO_5
QProgressDialog *progressDialog;
+#endif
QPushButton *downloadButton;
QPushButton *quitButton;
QDialogButtonBox *buttonBox;
diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp
index 4c4f61c775..e4f157476c 100644
--- a/examples/network/http/main.cpp
+++ b/examples/network/http/main.cpp
@@ -39,13 +39,28 @@
****************************************************************************/
#include <QApplication>
+#include <QDir>
#include "httpwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+
+#if defined(Q_OS_SYMBIAN)
+ // Change current directory from default private to c:\data
+ // in order that user can access the downloaded content
+ QDir::setCurrent("c:\\data");
+#elif defined(Q_WS_MAEMO_5)
+ QDir::setCurrent("/home/user");
+#endif
+
HttpWindow httpWin;
+
+#if defined(Q_OS_SYMBIAN)
+ httpWin.showMaximized();
+#else
httpWin.show();
- return httpWin.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/loopback/dialog.cpp b/examples/network/loopback/dialog.cpp
index 50a191e9ee..14154b47cc 100644
--- a/examples/network/loopback/dialog.cpp
+++ b/examples/network/loopback/dialog.cpp
@@ -58,6 +58,22 @@ Dialog::Dialog(QWidget *parent)
serverProgressBar = new QProgressBar;
serverStatusLabel = new QLabel(tr("Server ready"));
+#ifdef Q_OS_SYMBIAN
+ QMenu *menu = new QMenu(this);
+
+ QAction *optionsAction = new QAction(tr("Options"), this);
+ optionsAction->setSoftKeyRole(QAction::PositiveSoftKey);
+ optionsAction->setMenu(menu);
+ addAction(optionsAction);
+
+ startAction = menu->addAction(tr("Start"), this, SLOT(start()));
+
+ quitAction = new QAction(tr("Exit"), this);
+ quitAction->setSoftKeyRole(QAction::NegativeSoftKey);
+ addAction(quitAction);
+
+ connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
+#else
startButton = new QPushButton(tr("&Start"));
quitButton = new QPushButton(tr("&Quit"));
@@ -67,6 +83,7 @@ Dialog::Dialog(QWidget *parent)
connect(startButton, SIGNAL(clicked()), this, SLOT(start()));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
+#endif
connect(&tcpServer, SIGNAL(newConnection()),
this, SLOT(acceptConnection()));
connect(&tcpClient, SIGNAL(connected()), this, SLOT(startTransfer()));
@@ -82,7 +99,9 @@ Dialog::Dialog(QWidget *parent)
mainLayout->addWidget(serverStatusLabel);
mainLayout->addStretch(1);
mainLayout->addSpacing(10);
+#ifndef Q_OS_SYMBIAN
mainLayout->addWidget(buttonBox);
+#endif
setLayout(mainLayout);
setWindowTitle(tr("Loopback"));
@@ -90,7 +109,11 @@ Dialog::Dialog(QWidget *parent)
void Dialog::start()
{
+#ifdef Q_OS_SYMBIAN
+ startAction->setVisible(false);
+#else
startButton->setEnabled(false);
+#endif
#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(Qt::WaitCursor);
@@ -146,7 +169,11 @@ void Dialog::updateServerProgress()
if (bytesReceived == TotalBytes) {
tcpServerConnection->close();
+#ifdef Q_OS_SYMBIAN
+ startAction->setVisible(true);
+#else
startButton->setEnabled(true);
+#endif
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
@@ -183,7 +210,11 @@ void Dialog::displayError(QAbstractSocket::SocketError socketError)
serverProgressBar->reset();
clientStatusLabel->setText(tr("Client ready"));
serverStatusLabel->setText(tr("Server ready"));
+#ifdef Q_OS_SYMBIAN
+ startAction->setVisible(true);
+#else
startButton->setEnabled(true);
+#endif
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
diff --git a/examples/network/loopback/dialog.h b/examples/network/loopback/dialog.h
index 09b4366e19..b48c090d3f 100644
--- a/examples/network/loopback/dialog.h
+++ b/examples/network/loopback/dialog.h
@@ -52,6 +52,7 @@ class QProgressBar;
class QPushButton;
class QTcpServer;
class QTcpSocket;
+class QAction;
QT_END_NAMESPACE
class Dialog : public QDialog
@@ -74,9 +75,15 @@ private:
QProgressBar *serverProgressBar;
QLabel *clientStatusLabel;
QLabel *serverStatusLabel;
+
+#ifdef Q_OS_SYMBIAN
+ QAction *startAction;
+ QAction *quitAction;
+#else
QPushButton *startButton;
QPushButton *quitButton;
QDialogButtonBox *buttonBox;
+#endif
QTcpServer tcpServer;
QTcpSocket tcpClient;
diff --git a/examples/network/loopback/loopback.pro b/examples/network/loopback/loopback.pro
index ea175b3e3c..3565058e12 100644
--- a/examples/network/loopback/loopback.pro
+++ b/examples/network/loopback/loopback.pro
@@ -9,4 +9,8 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS loopback.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/loopback
INSTALLS += target sources
-symbian: CONFIG += qt_example
+symbian: {
+ CONFIG += qt_example
+ TARGET.CAPABILITY = NetworkServices
+}
+maemo5: CONFIG += qt_example
diff --git a/examples/network/loopback/main.cpp b/examples/network/loopback/main.cpp
index 6810b795fc..7f26fd4357 100644
--- a/examples/network/loopback/main.cpp
+++ b/examples/network/loopback/main.cpp
@@ -46,6 +46,10 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Dialog dialog;
+#ifdef Q_OS_SYMBIAN
+ dialog.showMaximized();
+#else
dialog.show();
- return dialog.exec();
+#endif
+ return app.exec();
}
diff --git a/examples/network/network-chat/network-chat.pro b/examples/network/network-chat/network-chat.pro
index 7c1514f727..ca4e8beaa6 100644
--- a/examples/network/network-chat/network-chat.pro
+++ b/examples/network/network-chat/network-chat.pro
@@ -24,3 +24,7 @@ symbian {
TARGET.CAPABILITY = "NetworkServices ReadUserData WriteUserData"
TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
}
+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/network/network.pro b/examples/network/network.pro
index 09765a622a..b8416bb31f 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -35,3 +35,4 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network
INSTALLS += sources
symbian: CONFIG += qt_example
+maemo5: CONFIG += qt_example
diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp
index c3e629f4f2..c0a2b73428 100644
--- a/examples/network/qftp/ftpwindow.cpp
+++ b/examples/network/qftp/ftpwindow.cpp
@@ -51,7 +51,7 @@ FtpWindow::FtpWindow(QWidget *parent)
ftpServerLabel->setBuddy(ftpServerLineEdit);
statusLabel = new QLabel(tr("Please enter the name of an FTP server."));
-#ifdef Q_OS_SYMBIAN
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
// Use word wrapping to fit the text on screen
statusLabel->setWordWrap( true );
#endif
@@ -243,6 +243,12 @@ void FtpWindow::downloadFile()
void FtpWindow::cancelDownload()
{
ftp->abort();
+
+ if (file->exists()) {
+ file->close();
+ file->remove();
+ }
+ delete file;
}
//![5]
diff --git a/examples/network/qftp/qftp.pro b/examples/network/qftp/qftp.pro
index 0e62d153d9..5775f0172a 100644
--- a/examples/network/qftp/qftp.pro
+++ b/examples/network/qftp/qftp.pro
@@ -16,3 +16,7 @@ symbian {
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
TARGET.CAPABILITY="NetworkServices ReadUserData WriteUserData"
}
+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/network/securesocketclient/certificateinfo.cpp b/examples/network/securesocketclient/certificateinfo.cpp
index ff3a4d2f3c..b1a9acb0b2 100644
--- a/examples/network/securesocketclient/certificateinfo.cpp
+++ b/examples/network/securesocketclient/certificateinfo.cpp
@@ -47,7 +47,7 @@ CertificateInfo::CertificateInfo(QWidget *parent)
form = new Ui_CertificateInfo;
form->setupUi(this);
- connect(form->certificationPathView, SIGNAL(currentRowChanged(int)),
+ connect(form->certificationPathView, SIGNAL(currentIndexChanged(int)),
this, SLOT(updateCertificateInfo(int)));
}
@@ -69,7 +69,7 @@ void CertificateInfo::setCertificateChain(const QList<QSslCertificate> &chain)
.arg(cert.subjectInfo(QSslCertificate::CommonName)));
}
- form->certificationPathView->setCurrentRow(0);
+ form->certificationPathView->setCurrentIndex(0);
}
void CertificateInfo::updateCertificateInfo(int index)
diff --git a/examples/network/securesocketclient/certificateinfo.ui b/examples/network/securesocketclient/certificateinfo.ui
index 3761fe8f50..c5238eb3e1 100644
--- a/examples/network/securesocketclient/certificateinfo.ui
+++ b/examples/network/securesocketclient/certificateinfo.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>CertificateInfo</class>
- <widget class="QDialog" name="CertificateInfo" >
- <property name="geometry" >
+ <widget class="QDialog" name="CertificateInfo">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,42 +10,57 @@
<height>397</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Display Certificate Information</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
<item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
+ <widget class="QLabel" name="label">
+ <property name="text">
<string>Certification Path</string>
</property>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QListWidget" name="certificationPathView" />
- </item>
- </layout>
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_2" >
- <property name="title" >
+ <widget class="QComboBox" name="certificationPathView">
+ <property name="minimumContentsLength">
+ <number>3</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
<string>Certificate Information</string>
</property>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QListWidget" name="certificateInfoView" />
- </item>
- </layout>
</widget>
</item>
<item>
- <layout class="QHBoxLayout" >
+ <widget class="QListWidget" name="certificateInfoView">
+ <property name="font">
+ <font>
+ <pointsize>8</pointsize>
+ </font>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -53,8 +69,8 @@
</spacer>
</item>
<item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="standardButtons" >
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
@@ -71,11 +87,11 @@
<receiver>CertificateInfo</receiver>
<slot>accept()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>343</x>
<y>374</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>352</x>
<y>422</y>
</hint>
diff --git a/examples/network/securesocketclient/main.cpp b/examples/network/securesocketclient/main.cpp
index c15534b523..ca50f31dcf 100644
--- a/examples/network/securesocketclient/main.cpp
+++ b/examples/network/securesocketclient/main.cpp
@@ -56,7 +56,11 @@ int main(int argc, char **argv)
}
SslClient client;
+#ifdef Q_OS_SYMBIAN
+ client.showMaximized();
+#else
client.show();
+#endif
return app.exec();
}
diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro
index f6276dd0bf..ae4b15ffbe 100644
--- a/examples/network/securesocketclient/securesocketclient.pro
+++ b/examples/network/securesocketclient/securesocketclient.pro
@@ -18,4 +18,7 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000CF67
CONFIG += qt_example
+ TARGET.CAPABILITY = NetworkServices
}
+maemo5: CONFIG += qt_example
+
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp
index 43b81cd984..11e6ffd537 100644
--- a/examples/network/securesocketclient/sslclient.cpp
+++ b/examples/network/securesocketclient/sslclient.cpp
@@ -82,7 +82,6 @@ void SslClient::updateEnabledState()
form->connectButton->setEnabled(unconnected && !form->hostNameEdit->text().isEmpty());
bool connected = socket && socket->state() == QAbstractSocket::ConnectedState;
- form->sessionBox->setEnabled(connected);
form->sessionOutput->setEnabled(connected);
form->sessionInput->setEnabled(connected);
form->sessionInputLabel->setEnabled(connected);
@@ -193,6 +192,9 @@ void SslClient::sslErrors(const QList<QSslError> &errors)
ui.sslErrorList->addItem(error.errorString());
executingDialog = true;
+#ifdef Q_OS_SYMBIAN
+ errorDialog.showMaximized();
+#endif
if (errorDialog.exec() == QDialog::Accepted)
socket->ignoreSslErrors();
executingDialog = false;
@@ -206,6 +208,9 @@ void SslClient::displayCertificateInfo()
{
CertificateInfo *info = new CertificateInfo(this);
info->setCertificateChain(socket->peerCertificateChain());
+#ifdef Q_OS_SYMBIAN
+ info->showMaximized();
+#endif
info->exec();
info->deleteLater();
}
diff --git a/examples/network/securesocketclient/sslclient.ui b/examples/network/securesocketclient/sslclient.ui
index 5a24751168..4b81fe46eb 100644
--- a/examples/network/securesocketclient/sslclient.ui
+++ b/examples/network/securesocketclient/sslclient.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>Form</class>
- <widget class="QWidget" name="Form" >
- <property name="geometry" >
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,147 +10,149 @@
<height>320</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Secure Socket Client</string>
</property>
- <layout class="QVBoxLayout" >
- <item>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="hostNameLabel" >
- <property name="text" >
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="2">
+ <layout class="QGridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="hostNameLabel">
+ <property name="text">
<string>Host name:</string>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="hostNameEdit" >
- <property name="text" >
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="hostNameEdit">
+ <property name="text">
<string>imap.example.com</string>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="portLabel" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="portLabel">
+ <property name="text">
<string>Port:</string>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <widget class="QSpinBox" name="portBox" >
- <property name="minimum" >
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="portBox">
+ <property name="minimum">
<number>1</number>
</property>
- <property name="maximum" >
+ <property name="maximum">
<number>65535</number>
</property>
- <property name="value" >
+ <property name="value">
<number>993</number>
</property>
</widget>
</item>
</layout>
</item>
- <item>
- <widget class="QPushButton" name="connectButton" >
- <property name="enabled" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Active session</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="connectButton">
+ <property name="enabled">
<bool>true</bool>
</property>
- <property name="text" >
+ <property name="text">
<string>Connect to host</string>
</property>
- <property name="default" >
+ <property name="default">
<bool>true</bool>
</property>
</widget>
</item>
- <item>
- <widget class="QGroupBox" name="sessionBox" >
- <property name="enabled" >
+ <item row="2" column="0" colspan="2">
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QLabel" name="cipherText">
+ <property name="text">
+ <string>Cryptographic Cipher:</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="cipherLabel">
+ <property name="text">
+ <string>&lt;none&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="0" colspan="2">
+ <widget class="QTextEdit" name="sessionOutput">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="title" >
- <string>Active session</string>
+ <property name="focusPolicy">
+ <enum>Qt::StrongFocus</enum>
</property>
- <layout class="QVBoxLayout" >
- <item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="cipherText" >
- <property name="text" >
- <string>Cryptographic Cipher:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="cipherLabel" >
- <property name="text" >
- <string>&lt;none></string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QTextEdit" name="sessionOutput" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::NoFocus</enum>
- </property>
- <property name="readOnly" >
- <bool>true</bool>
- </property>
- <property name="html" >
- <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="html">
+ <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLabel" name="sessionInputLabel" >
- <property name="text" >
- <string>Input:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="sessionInput" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="sendButton" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::TabFocus</enum>
- </property>
- <property name="text" >
- <string>&amp;Send</string>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
</widget>
</item>
+ <item row="4" column="0" colspan="2">
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QLabel" name="sessionInputLabel">
+ <property name="text">
+ <string>Input:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="sessionInput">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="sendButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::TabFocus</enum>
+ </property>
+ <property name="text">
+ <string>&amp;Send</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<resources/>
@@ -160,11 +163,11 @@ p, li { white-space: pre-wrap; }
<receiver>connectButton</receiver>
<slot>animateClick()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>126</x>
<y>20</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>142</x>
<y>78</y>
</hint>
@@ -176,11 +179,11 @@ p, li { white-space: pre-wrap; }
<receiver>sendButton</receiver>
<slot>animateClick()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>142</x>
<y>241</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>297</x>
<y>234</y>
</hint>
diff --git a/examples/network/securesocketclient/sslerrors.ui b/examples/network/securesocketclient/sslerrors.ui
index 4aac18cddb..1aadbfeca5 100644
--- a/examples/network/securesocketclient/sslerrors.ui
+++ b/examples/network/securesocketclient/sslerrors.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>SslErrors</class>
- <widget class="QDialog" name="SslErrors" >
- <property name="geometry" >
+ <widget class="QDialog" name="SslErrors">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,44 +10,48 @@
<height>216</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Unable To Validate The Connection</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout">
<item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600; color:#ff0000;">Warning&lt;/span>&lt;span style=" color:#ff0000;">:&lt;/span>&lt;span style=" color:#000000;"> One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click &lt;/span>&lt;span style=" color:#000000;">Ignore&lt;/span>&lt;span style=" color:#000000;"> to continue, or &lt;/span>&lt;span style=" color:#000000;">Cancel&lt;/span>&lt;span style=" color:#000000;"> to abort the connection.&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600; color:#ff0000;&quot;&gt;Warning&lt;/span&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; One or more errors with this connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and click &lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;Ignore&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; to continue, or &lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt;Cancel&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; to abort the connection.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
- <property name="wordWrap" >
+ <property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <widget class="QListWidget" name="sslErrorList" />
+ <widget class="QListWidget" name="sslErrorList">
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
<item>
- <layout class="QHBoxLayout" >
+ <layout class="QHBoxLayout">
<item>
- <widget class="QPushButton" name="certificateChainButton" >
- <property name="text" >
+ <widget class="QPushButton" name="certificateChainButton">
+ <property name="text">
<string>View Certificate Chain</string>
</property>
- <property name="autoDefault" >
+ <property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
@@ -55,15 +60,15 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
- <widget class="QPushButton" name="pushButton" >
- <property name="text" >
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
<string>Ignore</string>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="pushButton_2" >
- <property name="text" >
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="text">
<string>Cancel</string>
</property>
</widget>
@@ -80,11 +85,11 @@ p, li { white-space: pre-wrap; }
<receiver>SslErrors</receiver>
<slot>accept()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>235</x>
<y>185</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>228</x>
<y>287</y>
</hint>
@@ -96,11 +101,11 @@ p, li { white-space: pre-wrap; }
<receiver>SslErrors</receiver>
<slot>reject()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>325</x>
<y>192</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>333</x>
<y>231</y>
</hint>
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)
diff --git a/examples/network/torrent/torrent.pro b/examples/network/torrent/torrent.pro
index 0dc3aa7950..3565978d8c 100644
--- a/examples/network/torrent/torrent.pro
+++ b/examples/network/torrent/torrent.pro
@@ -37,3 +37,8 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/torrent
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)