This commit is contained in:
NissimHadar 2018-05-01 14:25:33 -07:00
parent e9d28cf275
commit b722c80b3f
2 changed files with 11 additions and 7 deletions

View file

@ -10,8 +10,6 @@
// //
#include "AutoTester.h" #include "AutoTester.h"
#include <QMessageBox>
AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) { AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
ui.setupUi(this); ui.setupUi(this);
ui.checkBoxInteractiveMode->setChecked(true); ui.checkBoxInteractiveMode->setChecked(true);
@ -91,11 +89,17 @@ void AutoTester::saveImage(int index) {
QPixmap pixmap; QPixmap pixmap;
pixmap.loadFromData(downloaders[index]->downloadedData()); pixmap.loadFromData(downloaders[index]->downloadedData());
int sdf = pixmap.width();
QImage image = pixmap.toImage(); QImage image = pixmap.toImage();
image = image.convertToFormat(QImage::Format_ARGB32); image = image.convertToFormat(QImage::Format_ARGB32);
QString fullPathname = _directoryName + "/" + _filenames[index]; QString fullPathname = _directoryName + "/" + _filenames[index];
image.save(fullPathname, 0, 100); if (!image.save(fullPathname, 0, 100)) {
QMessageBox messageBox;
messageBox.information(0, "Test Aborted", "Failed to save image: " + _filenames[index]);
ui.progressBar->setVisible(false);
return;
}
++_numberOfImagesDownloaded; ++_numberOfImagesDownloaded;
@ -109,4 +113,4 @@ void AutoTester::saveImage(int index) {
void AutoTester::about() { void AutoTester::about() {
QMessageBox messageBox; QMessageBox messageBox;
messageBox.information(0, "About", QString("Built ") + __DATE__ + " : " + __TIME__); messageBox.information(0, "About", QString("Built ") + __DATE__ + " : " + __TIME__);
} }

View file

@ -52,9 +52,9 @@ private:
// Used to enable passing a parameter to slots // Used to enable passing a parameter to slots
QSignalMapper* signalMapper; QSignalMapper* signalMapper;
int _numberOfImagesToDownload; int _numberOfImagesToDownload { 0 };
int _numberOfImagesDownloaded; int _numberOfImagesDownloaded { 0 };
int _index; int _index { 0 };
}; };
#endif // hifi_AutoTester_h #endif // hifi_AutoTester_h