#ifndef STDAFX_H
#define STDAFX_H
#include <QWidget>
#include <QMessageBox>
#include <QFileDialog>
#include <QString>
#include <QPixmap>
#include <QTableWidgetItem>
#include <QList>
#include <QDir>
#include <QComboBox>
#include "ui_mainwidget.h"
#include "ui_result.h"
#include "imageprocessor.h"
#endif // STDAFX_H
#ifndef STDAFX_H
#define STDAFX_H
#include <QWidget>
#include <QMessageBox>
#include <QFileDialog>
#include <QString>
#include <QPixmap>
#include <QTableWidgetItem>
#include <QList>
#include <QDir>
#include <QComboBox>
#include "ui_mainwidget.h"
#include "ui_result.h"
#include "imageprocessor.h"
#endif // STDAFX_H
To copy to clipboard, switch view to plain text mode
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
#include "stdafx.h"
namespace Ui
{
class MainWidget;
}
{
Q_OBJECT
public:
explicit MainWidget
(QWidget *parent
= 0);
~MainWidget();
public slots:
void onLoadBtnClicked();
void onProcBtnClicked();
void onExportBtnClicked();
void onExportAllBtnClicked();
void onDeleteBtnClicked();
void onTabChanged();
void onMoveToGoodWndsBtnClicked();
void onMoveToBadWndsBtnClicked();
private:
Ui::MainWidget *ui;
Ui::ResWidget *resUi;
ImageProcessor *imageProc;
void setResUi();
void showGoodWnds();
void showBadWnds();
};
#endif // MAINWIDGET_H
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
#include "stdafx.h"
namespace Ui
{
class MainWidget;
}
class MainWidget : public QWidget
{
Q_OBJECT
public:
explicit MainWidget(QWidget *parent = 0);
~MainWidget();
public slots:
void onLoadBtnClicked();
void onProcBtnClicked();
void onExportBtnClicked();
void onExportAllBtnClicked();
void onDeleteBtnClicked();
void onTabChanged();
void onMoveToGoodWndsBtnClicked();
void onMoveToBadWndsBtnClicked();
private:
Ui::MainWidget *ui;
Ui::ResWidget *resUi;
QWidget *resWidget;
ImageProcessor *imageProc;
void setResUi();
void showGoodWnds();
void showBadWnds();
};
#endif // MAINWIDGET_H
To copy to clipboard, switch view to plain text mode
#include "mainwidget.h"
// CONSTRUCTORS
//
MainWidget
::MainWidget(QWidget *parent
) : ui(new Ui::MainWidget)
{
ui->setupUi(this);
// Connect buttons
QObject::connect(ui
->loadBtn,
SIGNAL(clicked
()),
this, SLOT(onLoadBtnClicked()));
QObject::connect(ui
->procBtn,
SIGNAL(clicked
()),
this, SLOT(onProcBtnClicked()));
imageProc = 0;
}
//
MainWidget::~MainWidget()
{
delete ui;
}
// SLOTS
//
void MainWidget::onProcBtnClicked()
{
if(0 == imageProc)
{
return;
}
setResUi();
showGoodWnds();
showBadWnds();
}
// PRIVATE FUNCTIONS
//
void MainWidget::setResUi()
{
// Load result window
resUi->setupUi(resWidget);
resWidget->show();
// Connect buttons of the result window
QObject::connect(resUi
->closeBtn,
SIGNAL(clicked
()),
resWidget, SLOT(close()));
QObject::connect(resUi
->exportBtn,
SIGNAL(clicked
()),
this, SLOT(onExportBtnClicked()));
QObject::connect(resUi
->exportAllBtn,
SIGNAL(clicked
()),
this, SLOT(onExportAllBtnClicked()));
QObject::connect(resUi
->deleteBtn,
SIGNAL(clicked
()),
this, SLOT(onDeleteBtnClicked()));
QObject::connect(resUi
->tabWidget,
SIGNAL(currentChanged
(int)),
this, SLOT(onTabChanged()));
QObject::connect(resUi
->moveToGoodBtn,
SIGNAL(clicked
()),
this, SLOT(onMoveToGoodWndsBtnClicked()));
QObject::connect(resUi
->moveToBadBtn,
SIGNAL(clicked
()),
this, SLOT(onMoveToBadWndsBtnClicked()));
//
resUi->tabWidget->setCurrentIndex(GOOD_TAB);
resUi->moveToGoodBtn->setEnabled(false);
}
#include "mainwidget.h"
// CONSTRUCTORS
//
MainWidget::MainWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::MainWidget)
{
ui->setupUi(this);
// Connect buttons
QObject::connect(ui->loadBtn, SIGNAL(clicked()),
this, SLOT(onLoadBtnClicked()));
QObject::connect(ui->procBtn, SIGNAL(clicked()),
this, SLOT(onProcBtnClicked()));
imageProc = 0;
}
//
MainWidget::~MainWidget()
{
delete ui;
}
// SLOTS
//
void MainWidget::onProcBtnClicked()
{
if(0 == imageProc)
{
return;
}
setResUi();
showGoodWnds();
showBadWnds();
}
// PRIVATE FUNCTIONS
//
void MainWidget::setResUi()
{
// Load result window
resWidget = new QWidget();
resUi->setupUi(resWidget);
resWidget->show();
// Connect buttons of the result window
QObject::connect(resUi->closeBtn, SIGNAL(clicked()),
resWidget, SLOT(close()));
QObject::connect(resUi->exportBtn, SIGNAL(clicked()),
this, SLOT(onExportBtnClicked()));
QObject::connect(resUi->exportAllBtn, SIGNAL(clicked()),
this, SLOT(onExportAllBtnClicked()));
QObject::connect(resUi->deleteBtn, SIGNAL(clicked()),
this, SLOT(onDeleteBtnClicked()));
QObject::connect(resUi->tabWidget, SIGNAL(currentChanged(int)),
this, SLOT(onTabChanged()));
QObject::connect(resUi->moveToGoodBtn, SIGNAL(clicked()),
this, SLOT(onMoveToGoodWndsBtnClicked()));
QObject::connect(resUi->moveToBadBtn, SIGNAL(clicked()),
this, SLOT(onMoveToBadWndsBtnClicked()));
//
resUi->tabWidget->setCurrentIndex(GOOD_TAB);
resUi->moveToGoodBtn->setEnabled(false);
}
To copy to clipboard, switch view to plain text mode
Bookmarks