PictureCrypt  1.4.1
An image-steganography project
controllerpc.cpp
Go to the documentation of this file.
1 #include "controllerpc.h"
2 
10 {
11  // Layer creation
12  view = new ViewPC();
13  model = new ModelPC();
14  QThread * modelThread = new QThread();
15  model->moveToThread(modelThread);
16  modelThread->start();
17 
18  view->setVersion(model->versionString);
19  view->show();
20 
21  // Layers Connection
22  connect(view, SIGNAL(encrypt(QByteArray, QImage*, int, QString, int)), model, SLOT(encrypt(QByteArray, QImage*, int, QString, int)));
23  connect(view, SIGNAL(decrypt(QImage*,QString,int)), model, SLOT(decrypt(QImage*, QString, int)));
24  connect(view, SIGNAL(abortModel()), this, SLOT(abortCircuit()));
25  connect(view, SIGNAL(setJPHSDir(QString)), this, SLOT(setJPHSDir(QString)));
26 
27  connect(model, SIGNAL(alertView(QString,bool)), view, SLOT(alert(QString,bool)));
28  connect(model, SIGNAL(saveData(QByteArray)), view, SLOT(saveData(QByteArray)));
29  connect(model, SIGNAL(saveImage(QImage*)), view, SLOT(saveImage(QImage*)));
30  connect(model, SIGNAL(setProgress(int)), view, SLOT(setProgress(int)));
31 }
37 {
38  model->success = false;
39 }
44 void ControllerPC::setJPHSDir(QString dir)
45 {
46  model->defaultJPHSDir = dir;
47 }
QString versionString
versionString Version as string
Definition: modelpc.h:88
void setJPHSDir(QString dir)
ControllerPC::setJPHSDir Sets JPHS default dir.
The ModelPC class Model Layer of the app. Main class that does the work of PictureCrypt logic Control...
Definition: modelpc.h:33
void abortCircuit()
ControllerPC::abortCircuit Slot to be called when ProgressDialog in ViewPC is closed. It flags ModelPC to stop.
QString defaultJPHSDir
defaultJPHSDir Default JPHS directory
Definition: modelpc.h:92
ControllerPC()
ControllerPC::ControllerPC Constructor of controller Constructor runs auto-test for ModelPC...
Definition: controllerpc.cpp:9
The ViewPC class View layer of the app. Controls EncryptDialog and ProgressDialog.
Definition: viewpc.h:35
bool success
success Flag that true by default, but in case of error or cancelling of ProgressDialog it turns to f...
Definition: modelpc.h:80
void setVersion(QString version)
ViewPC::setVersion Set the version of the app from ControllerPC.
Definition: viewpc.cpp:239