remove remaining non-concurrent branches from concurrent samples
amends 677825f0bad9. Change-Id: I8bc3ade3a1602b9a2c0bdc837f4b19c67b2e0dba Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
parent
8b61ec5796
commit
f6a5e3d1e8
@ -40,8 +40,6 @@
|
||||
#include "imagescaling.h"
|
||||
#include "math.h"
|
||||
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
|
||||
const int imageSize = 100;
|
||||
|
||||
QImage scale(const QString &imageFileName)
|
||||
@ -141,5 +139,3 @@ void Images::finished()
|
||||
cancelButton->setEnabled(false);
|
||||
pauseButton->setEnabled(false);
|
||||
}
|
||||
|
||||
#endif // QT_NO_CONCURRENT
|
||||
|
@ -43,8 +43,6 @@
|
||||
#include <QtWidgets>
|
||||
#include <QtConcurrent>
|
||||
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
|
||||
class Images : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -65,18 +63,4 @@ private:
|
||||
QFutureWatcher<QImage> *imageScaling;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
// Dummy class required because QT_NO_CONCURRENT is not set when moc is run.
|
||||
class Images : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public Q_SLOTS:
|
||||
void open() {}
|
||||
void showImage(int) {}
|
||||
void finished() {}
|
||||
};
|
||||
|
||||
#endif // QT_NO_CONCURRENT
|
||||
|
||||
#endif // IMAGESCALING_H
|
||||
|
@ -40,8 +40,6 @@
|
||||
#include <QtWidgets>
|
||||
#include <QtConcurrent>
|
||||
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
|
||||
#include "imagescaling.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -53,21 +51,3 @@ int main(int argc, char *argv[])
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QString text("Qt Concurrent is not supported on this platform");
|
||||
|
||||
QLabel *label = new QLabel(text);
|
||||
label->setWordWrap(true);
|
||||
|
||||
label->show();
|
||||
qDebug() << text;
|
||||
|
||||
app.exec();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -41,8 +41,6 @@
|
||||
#include <QtWidgets>
|
||||
#include <QtConcurrent>
|
||||
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
|
||||
using namespace QtConcurrent;
|
||||
|
||||
const int iterations = 20;
|
||||
@ -88,22 +86,3 @@ int main(int argc, char **argv)
|
||||
// Query the future to check if was canceled.
|
||||
qDebug() << "Canceled?" << futureWatcher.future().isCanceled();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QString text("Qt Concurrent is not yet supported on this platform");
|
||||
|
||||
QLabel *label = new QLabel(text);
|
||||
label->setWordWrap(true);
|
||||
|
||||
label->show();
|
||||
qDebug() << text;
|
||||
|
||||
app.exec();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -44,8 +44,6 @@
|
||||
#include <qtconcurrentrun.h>
|
||||
#include <QApplication>
|
||||
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
|
||||
using namespace QtConcurrent;
|
||||
|
||||
void hello(QString name)
|
||||
@ -61,23 +59,3 @@ int main(int argc, char **argv)
|
||||
f1.waitForFinished();
|
||||
f2.waitForFinished();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QString text("Qt Concurrent is not yet supported on this platform");
|
||||
|
||||
QLabel *label = new QLabel(text);
|
||||
label->setWordWrap(true);
|
||||
|
||||
label->show();
|
||||
qDebug() << text;
|
||||
|
||||
app.exec();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -50,8 +50,6 @@
|
||||
|
||||
#include <qtconcurrentmap.h>
|
||||
|
||||
#ifndef QT_NO_CONCURRENT
|
||||
|
||||
using namespace QtConcurrent;
|
||||
|
||||
/*
|
||||
@ -155,23 +153,3 @@ int main(int argc, char** argv)
|
||||
}
|
||||
qDebug() << "MapReduce speedup x" << ((double)singleThreadTime - (double)mapReduceTime) / (double)mapReduceTime + 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QString text("Qt Concurrent is not yet supported on this platform");
|
||||
|
||||
QLabel *label = new QLabel(text);
|
||||
label->setWordWrap(true);
|
||||
|
||||
label->show();
|
||||
qDebug() << text;
|
||||
|
||||
app.exec();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user