##// END OF EJS Templates
Merge pull request 132 from SCIQLOP-Initialisation feature/initializationTestLogVera...
Merge pull request 132 from SCIQLOP-Initialisation feature/initializationTestLogVera Feature/initializationTestLogVera

File last commit:

r24:31a39fecd50d
r27:36eb6adb226c merge
Show More
SqpApplication.cpp
45 lines | 1.4 KiB | text/x-c | CppLexer
/ gui / src / SqpApplication.cpp
Initialisation de l'application multithread avec le spimpl....
r21 #include "SqpApplication.h"
#include <DataSource/DataSourceController.h>
#include <QThread>
Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication")
class SqpApplication::SqpApplicationPrivate {
public:
SqpApplicationPrivate() {}
Ajout des règles vera++
r24 virtual ~SqpApplicationPrivate()
Ajout de la méthode wait pour éviter de détruire un thread en cours...
r22 {
qCInfo(LOG_SqpApplication()) << tr("Desctruction du SqpApplicationPrivate");
m_DataSourceControllerThread.quit();
m_DataSourceControllerThread.wait();
}
Initialisation de l'application multithread avec le spimpl....
r21
std::unique_ptr<DataSourceController> m_DataSourceController;
QThread m_DataSourceControllerThread;
};
SqpApplication::SqpApplication(int &argc, char **argv)
: QApplication(argc, argv), impl{spimpl::make_unique_impl<SqpApplicationPrivate>()}
{
qCInfo(LOG_SqpApplication()) << tr("Construction du SqpApplication");
impl->m_DataSourceController = std::make_unique<DataSourceController>();
impl->m_DataSourceController->moveToThread(&impl->m_DataSourceControllerThread);
connect(&impl->m_DataSourceControllerThread, &QThread::started,
impl->m_DataSourceController.get(), &DataSourceController::initialize);
connect(&impl->m_DataSourceControllerThread, &QThread::finished,
impl->m_DataSourceController.get(), &DataSourceController::finalize);
impl->m_DataSourceControllerThread.start();
}
SqpApplication::~SqpApplication()
{
}
void SqpApplication::initialize()
{
}