diff options
Diffstat (limited to 'examples/network/broadcastreceiver/receiver.cpp')
-rw-r--r-- | examples/network/broadcastreceiver/receiver.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
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")); } |