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 <QMessageBox>
AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
ui.setupUi(this);
ui.checkBoxInteractiveMode->setChecked(true);
@ -91,11 +89,17 @@ void AutoTester::saveImage(int index) {
QPixmap pixmap;
pixmap.loadFromData(downloaders[index]->downloadedData());
int sdf = pixmap.width();
QImage image = pixmap.toImage();
image = image.convertToFormat(QImage::Format_ARGB32);
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;
@ -109,4 +113,4 @@ void AutoTester::saveImage(int index) {
void AutoTester::about() {
QMessageBox messageBox;
messageBox.information(0, "About", QString("Built ") + __DATE__ + " : " + __TIME__);
}
}

View file

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