Skip to content

Commit

Permalink
Changed a application structure
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkonrom committed Sep 14, 2017
1 parent 3984494 commit f068c29
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ void MainWindow::createActions(){

void MainWindow::setImage(const QImage &newImage)
{
image = newImage;
ui->inputLabel->setPixmap(QPixmap::fromImage(image));
inputImage = newImage;
ui->inputLabel->setPixmap(QPixmap::fromImage(inputImage));
//scaleFactor = 1.0;

/*scrollArea->setVisible(true);
Expand Down Expand Up @@ -57,7 +57,7 @@ bool MainWindow::loadFile(const QString &fileName)
setWindowFilePath(fileName);

const QString message = tr("Opened \"%1\", %2x%3, Depth: %4")
.arg(QDir::toNativeSeparators(fileName)).arg(image.width()).arg(image.height()).arg(image.depth());
.arg(QDir::toNativeSeparators(fileName)).arg(inputImage.width()).arg(inputImage.height()).arg(inputImage.depth());
statusBar()->showMessage(message);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private slots:
void createActions();
void setImage(const QImage &newImage);

QImage image;
QImage inputImage;

};

Expand Down
10 changes: 10 additions & 0 deletions operation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "operation.h"

Operation::Operation(QImage inputImage)
{
this->inputImage = inputImage;
}

QImage Operation::execute(QImage source){
return source;
}
14 changes: 14 additions & 0 deletions operation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef OPERATION_H
#define OPERATION_H
#include <QImage>

class Operation
{
public:
explicit Operation(QImage);
private:
QImage inputImage;
virtual QImage execute(QImage);
};

#endif // OPERATION_H

0 comments on commit f068c29

Please sign in to comment.