Skip to content
Snippets Groups Projects
Commit 3b03db53 authored by Jan Möbius's avatar Jan Möbius
Browse files

Support Builds with VS2010 and Qt 4.8

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13286 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6681d133
Branches
Tags
No related merge requests found
......@@ -67,12 +67,12 @@
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__ * 10)
#if QT_VERSION >= 0x040800
#if QT_VERSION > 0x040800
#ifdef WIN32
#pragma message("Detected QT Version 4.8 or higher!")
#pragma message("Detected QT Version higher than 4.8!")
#pragma message("OpenFlipper has not been tested with this QT Version.")
#else
#warning Detected QT Version 4.8 or higher!
#warning Detected QT Version higher than 4.8!
#warning OpenFlipper has not been tested with this QT Version.
#endif
#endif
......
......@@ -975,9 +975,6 @@ public:
private:
void writeImageQPixmap(QPixmap* _pixmap, const QString _name) const;
void writeImageQImage(QImage* _image, const QString _name) const;
// Store pointers to QFuture and QFutureWatcher
std::map<QFutureWatcher<void>*,QFuture<void>*> watcher_garbage_;
......
......@@ -770,10 +770,16 @@ void CoreWidget::applicationSnapshotName(QString _name) {
snapshotCounter_ = 0;
}
void writeImageQPixmap(QPixmap* _pixmap, const QString _name) {
_pixmap->save(_name);
delete _pixmap;
}
void CoreWidget::writeImageAsynchronously(QPixmap* _pixmap, const QString _name) {
QFuture<void>* future = new QFuture<void>();
*future = QtConcurrent::run(this, &CoreWidget::writeImageQPixmap, _pixmap, _name);
*future = QtConcurrent::run(writeImageQPixmap, _pixmap, _name);
QFutureWatcher<void>* watcher = new QFutureWatcher<void>();
watcher->setFuture(*future);
......@@ -782,16 +788,18 @@ void CoreWidget::writeImageAsynchronously(QPixmap* _pixmap, const QString _name)
connect(watcher, SIGNAL(finished()), this, SLOT(delete_garbage()));
}
void CoreWidget::writeImageQPixmap(QPixmap* _pixmap, const QString _name) const {
_pixmap->save(_name);
delete _pixmap;
void writeImageQImage(QImage* _image, const QString _name) {
_image->save(_name);
delete _image;
}
void CoreWidget::writeImageAsynchronously(QImage* _image, const QString _name) {
QFuture<void>* future = new QFuture<void>();
*future = QtConcurrent::run(this, &CoreWidget::writeImageQImage, _image, _name);
*future = QtConcurrent::run(writeImageQImage, _image, _name);
QFutureWatcher<void>* watcher = new QFutureWatcher<void>();
watcher->setFuture(*future);
......@@ -800,11 +808,7 @@ void CoreWidget::writeImageAsynchronously(QImage* _image, const QString _name) {
connect(watcher, SIGNAL(finished()), this, SLOT(delete_garbage()));
}
void CoreWidget::writeImageQImage(QImage* _image, const QString _name) const {
_image->save(_name);
delete _image;
}
void CoreWidget::delete_garbage() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment