summaryrefslogtreecommitdiffstats
path: root/examples/threads
diff options
context:
space:
mode:
Diffstat (limited to 'examples/threads')
-rw-r--r--examples/threads/mandelbrot/main.cpp4
-rw-r--r--examples/threads/mandelbrot/mandelbrot.pro4
-rw-r--r--examples/threads/mandelbrot/mandelbrotwidget.cpp16
-rw-r--r--examples/threads/mandelbrot/mandelbrotwidget.h26
-rw-r--r--examples/threads/queuedcustomtype/main.cpp4
-rw-r--r--examples/threads/queuedcustomtype/queuedcustomtype.pro2
-rw-r--r--examples/threads/semaphores/semaphores.cpp29
-rw-r--r--examples/threads/semaphores/semaphores.pro2
-rw-r--r--examples/threads/threads.pro2
-rw-r--r--examples/threads/waitconditions/waitconditions.cpp46
-rw-r--r--examples/threads/waitconditions/waitconditions.pro2
11 files changed, 1 insertions, 136 deletions
diff --git a/examples/threads/mandelbrot/main.cpp b/examples/threads/mandelbrot/main.cpp
index 5211c2051c..610534d4a3 100644
--- a/examples/threads/mandelbrot/main.cpp
+++ b/examples/threads/mandelbrot/main.cpp
@@ -47,11 +47,7 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MandelbrotWidget widget;
-#if defined(Q_WS_S60)
- widget.showMaximized();
-#else
widget.show();
-#endif
return app.exec();
}
//! [0]
diff --git a/examples/threads/mandelbrot/mandelbrot.pro b/examples/threads/mandelbrot/mandelbrot.pro
index 0e053af072..dc2ab6973b 100644
--- a/examples/threads/mandelbrot/mandelbrot.pro
+++ b/examples/threads/mandelbrot/mandelbrot.pro
@@ -4,7 +4,7 @@ SOURCES = main.cpp \
mandelbrotwidget.cpp \
renderthread.cpp
-unix:!mac:!symbian:!vxworks:!integrity:LIBS += -lm
+unix:!mac:!vxworks:!integrity:LIBS += -lm
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/mandelbrot
@@ -12,6 +12,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mandelbrot.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/mandelbrot
INSTALLS += target sources
-symbian: CONFIG += qt_example
QT += widgets
-maemo5: CONFIG += qt_example
diff --git a/examples/threads/mandelbrot/mandelbrotwidget.cpp b/examples/threads/mandelbrot/mandelbrotwidget.cpp
index 7cee70f547..0db19a71c6 100644
--- a/examples/threads/mandelbrot/mandelbrotwidget.cpp
+++ b/examples/threads/mandelbrot/mandelbrotwidget.cpp
@@ -74,20 +74,6 @@ MandelbrotWidget::MandelbrotWidget(QWidget *parent)
#endif
resize(550, 400);
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
- ZoomButton *zoomIn = new ZoomButton(tr("Zoom In"), ZoomInFactor, this);
- ZoomButton *zoomOut = new ZoomButton(tr("Zoom Out"), ZoomOutFactor, this);
-
- QGridLayout *layout = new QGridLayout(this);
- layout->addWidget(zoomIn, 0, 1);
- layout->addWidget(zoomOut, 1, 1);
- layout->setColumnStretch(0, 10);
- layout->setRowStretch(2, 10);
- setLayout(layout);
-
- connect(zoomIn, SIGNAL(zoom(double)), this, SLOT(zoom(double)));
- connect(zoomOut, SIGNAL(zoom(double)), this, SLOT(zoom(double)));
-#endif
}
//! [1]
@@ -129,7 +115,6 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */)
}
//! [8] //! [9]
-#if !defined(Q_WS_S60) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
QString text = tr("Use mouse wheel or the '+' and '-' keys to zoom. "
"Press and hold left mouse button to scroll.");
QFontMetrics metrics = painter.fontMetrics();
@@ -142,7 +127,6 @@ void MandelbrotWidget::paintEvent(QPaintEvent * /* event */)
painter.setPen(Qt::white);
painter.drawText((width() - textWidth) / 2,
metrics.leading() + metrics.ascent(), text);
-#endif
}
//! [9]
diff --git a/examples/threads/mandelbrot/mandelbrotwidget.h b/examples/threads/mandelbrot/mandelbrotwidget.h
index 53bbeb6469..ead394cc6a 100644
--- a/examples/threads/mandelbrot/mandelbrotwidget.h
+++ b/examples/threads/mandelbrot/mandelbrotwidget.h
@@ -45,32 +45,6 @@
#include <QWidget>
#include "renderthread.h"
-#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
-#include <QPushButton>
-
-class ZoomButton : public QPushButton
-{
- Q_OBJECT
-public:
- ZoomButton(const QString &text, double zoomFactor, QWidget *parent = NULL)
- : QPushButton(text, parent), m_ZoomFactor(zoomFactor)
- {
- connect(this, SIGNAL(clicked()), this, SLOT(handleClick()));
- }
-
-signals:
- void zoom(double zoomFactor);
-
-private slots:
- void handleClick()
- {
- emit zoom(m_ZoomFactor);
- }
-
-private:
- const double m_ZoomFactor;
-};
-#endif
//! [0]
class MandelbrotWidget : public QWidget
diff --git a/examples/threads/queuedcustomtype/main.cpp b/examples/threads/queuedcustomtype/main.cpp
index 356352a326..d70a88a095 100644
--- a/examples/threads/queuedcustomtype/main.cpp
+++ b/examples/threads/queuedcustomtype/main.cpp
@@ -119,11 +119,7 @@ int main(int argc, char *argv[])
qsrand(QTime::currentTime().elapsed());
Window window;
-#if defined(Q_WS_S60)
- window.showMaximized();
-#else
window.show();
-#endif
window.loadImage(createImage(256, 256));
//! [main finish]
diff --git a/examples/threads/queuedcustomtype/queuedcustomtype.pro b/examples/threads/queuedcustomtype/queuedcustomtype.pro
index 415f4f14dd..a2da59e55f 100644
--- a/examples/threads/queuedcustomtype/queuedcustomtype.pro
+++ b/examples/threads/queuedcustomtype/queuedcustomtype.pro
@@ -13,6 +13,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS mandelbrot.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/threads/mandelbrot
INSTALLS += target sources
-symbian: CONFIG += qt_example
-maemo5: CONFIG += qt_example
diff --git a/examples/threads/semaphores/semaphores.cpp b/examples/threads/semaphores/semaphores.cpp
index 3632895c61..9b818f394e 100644
--- a/examples/threads/semaphores/semaphores.cpp
+++ b/examples/threads/semaphores/semaphores.cpp
@@ -44,11 +44,7 @@
#include <stdlib.h>
//! [0]
-#ifdef Q_WS_S60
-const int DataSize = 300;
-#else
const int DataSize = 100000;
-#endif
const int BufferSize = 8192;
char buffer[BufferSize];
@@ -84,14 +80,8 @@ public:
{
for (int i = 0; i < DataSize; ++i) {
usedBytes.acquire();
- #ifdef Q_WS_S60
- QString text(buffer[i % BufferSize]);
- freeBytes.release();
- emit stringConsumed(text);
- #else
fprintf(stderr, "%c", buffer[i % BufferSize]);
freeBytes.release();
- #endif
}
fprintf(stderr, "\n");
}
@@ -108,24 +98,6 @@ protected:
int main(int argc, char *argv[])
//! [5] //! [6]
{
-#ifdef Q_WS_S60
- // Self made console for Symbian
- QApplication app(argc, argv);
- QPlainTextEdit console;
- console.setReadOnly(true);
- console.setTextInteractionFlags(Qt::NoTextInteraction);
- console.showMaximized();
-
- Producer producer;
- Consumer consumer;
-
- QObject::connect(&consumer, SIGNAL(stringConsumed(const QString&)), &console, SLOT(insertPlainText(QString)), Qt::BlockingQueuedConnection);
-
- producer.start();
- consumer.start();
-
- app.exec();
-#else
QCoreApplication app(argc, argv);
Producer producer;
Consumer consumer;
@@ -134,7 +106,6 @@ int main(int argc, char *argv[])
producer.wait();
consumer.wait();
return 0;
-#endif
}
//! [6]
diff --git a/examples/threads/semaphores/semaphores.pro b/examples/threads/semaphores/semaphores.pro
index 96ab3a525f..98159bb69c 100644
--- a/examples/threads/semaphores/semaphores.pro
+++ b/examples/threads/semaphores/semaphores.pro
@@ -10,7 +10,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS semaphores.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/semaphores
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/threads/threads.pro b/examples/threads/threads.pro
index 9bdf900f5b..2a8cfb0fc2 100644
--- a/examples/threads/threads.pro
+++ b/examples/threads/threads.pro
@@ -10,6 +10,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS threads.pro README
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads
INSTALLS += target sources
-symbian: CONFIG += qt_example
QT += widgets
-maemo5: CONFIG += qt_example
diff --git a/examples/threads/waitconditions/waitconditions.cpp b/examples/threads/waitconditions/waitconditions.cpp
index 0063db5b91..36c358308a 100644
--- a/examples/threads/waitconditions/waitconditions.cpp
+++ b/examples/threads/waitconditions/waitconditions.cpp
@@ -44,11 +44,7 @@
#include <stdlib.h>
//! [0]
-#ifdef Q_WS_S60
-const int DataSize = 300;
-#else
const int DataSize = 100000;
-#endif
const int BufferSize = 8192;
char buffer[BufferSize];
@@ -107,11 +103,7 @@ public:
bufferNotEmpty.wait(&mutex);
mutex.unlock();
- #ifdef Q_WS_S60
- emit stringConsumed(QString(buffer[i % BufferSize]));
- #else
fprintf(stderr, "%c", buffer[i % BufferSize]);
- #endif
mutex.lock();
--numUsedBytes;
@@ -126,48 +118,11 @@ signals:
};
//! [4]
-#ifdef Q_WS_S60
-class PlainTextEdit : public QPlainTextEdit
-{
- Q_OBJECT
-public:
- PlainTextEdit(QWidget *parent = NULL) : QPlainTextEdit(parent), producer(NULL), consumer(NULL)
- {
- setTextInteractionFlags(Qt::NoTextInteraction);
-
- producer = new Producer(this);
- consumer = new Consumer(this);
-
- QObject::connect(consumer, SIGNAL(stringConsumed(const QString &)), SLOT(insertPlainText(const QString &)), Qt::BlockingQueuedConnection);
-
- QTimer::singleShot(0, this, SLOT(startThreads()));
- }
-
-protected:
- Producer *producer;
- Consumer *consumer;
-
-protected slots:
- void startThreads()
- {
- producer->start();
- consumer->start();
- }
-};
-#endif
//! [5]
int main(int argc, char *argv[])
//! [5] //! [6]
{
-#ifdef Q_WS_S60
- QApplication app(argc, argv);
-
- PlainTextEdit console;
- console.showMaximized();
-
- return app.exec();
-#else
QCoreApplication app(argc, argv);
Producer producer;
Consumer consumer;
@@ -176,7 +131,6 @@ int main(int argc, char *argv[])
producer.wait();
consumer.wait();
return 0;
-#endif
}
//! [6]
diff --git a/examples/threads/waitconditions/waitconditions.pro b/examples/threads/waitconditions/waitconditions.pro
index e326afa081..6a3d63b641 100644
--- a/examples/threads/waitconditions/waitconditions.pro
+++ b/examples/threads/waitconditions/waitconditions.pro
@@ -18,7 +18,5 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS waitconditions.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/waitconditions
INSTALLS += target sources
-symbian: CONFIG += qt_example
-maemo5: CONFIG += qt_example
simulator: warning(This example might not fully work on Simulator platform)