2018-05-17 14:35:17 +08:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
#include "qqtcore.h"
|
|
|
|
|
|
|
|
MainWindow::MainWindow ( QWidget* parent ) :
|
|
|
|
QMainWindow ( parent ),
|
|
|
|
ui ( new Ui::MainWindow )
|
|
|
|
{
|
|
|
|
ui->setupUi ( this );
|
|
|
|
ui->widget;
|
|
|
|
ui->widget->setPixmap ( "" );
|
|
|
|
|
|
|
|
connect ( ui->widget, SIGNAL ( click() ),
|
|
|
|
this, SLOT ( setSum() ) );
|
|
|
|
connect ( ui->widget, SIGNAL ( doubleClick() ),
|
|
|
|
this, SLOT ( set2Sum() ) );
|
|
|
|
connect ( ui->widget, SIGNAL ( longClick() ),
|
|
|
|
this, SLOT ( set3Sum() ) );
|
2018-05-17 19:45:16 +08:00
|
|
|
|
2018-06-13 12:14:37 +08:00
|
|
|
connect ( ui->widget_4, SIGNAL ( click() ),
|
|
|
|
this, SLOT ( set31Sum() ) );
|
|
|
|
connect ( ui->widget_4, SIGNAL ( doubleClick() ),
|
|
|
|
this, SLOT ( set32Sum() ) );
|
|
|
|
connect ( ui->widget_4, SIGNAL ( longClick() ),
|
|
|
|
this, SLOT ( set33Sum() ) );
|
|
|
|
|
2018-05-17 19:45:16 +08:00
|
|
|
connect ( ui->widget_2, SIGNAL ( click() ),
|
|
|
|
this, SLOT ( set4Sum() ) );
|
|
|
|
connect ( ui->widget_2, SIGNAL ( longClick() ),
|
|
|
|
this, SLOT ( set5Sum() ) );
|
2018-05-18 20:15:52 +08:00
|
|
|
|
|
|
|
connect ( ui->widget_3, SIGNAL ( click() ),
|
|
|
|
this, SLOT ( set6Sum() ) );
|
2018-05-17 14:35:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::setSum()
|
|
|
|
{
|
|
|
|
sender();
|
|
|
|
ui->textBrowser->append ( QString ( "%1 click" ).arg ( ui->widget->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::set2Sum()
|
|
|
|
{
|
|
|
|
ui->textBrowser->append ( QString ( "%1 double click" ).arg ( ui->widget->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::set3Sum()
|
|
|
|
{
|
|
|
|
ui->textBrowser->append ( QString ( "%1 long click" ).arg ( ui->widget->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|
2018-05-17 19:45:16 +08:00
|
|
|
|
2018-06-13 12:14:37 +08:00
|
|
|
void MainWindow::set31Sum()
|
|
|
|
{
|
|
|
|
ui->textBrowser->append ( QString ( "child %1 click" ).arg ( ui->widget_4->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::set32Sum()
|
|
|
|
{
|
|
|
|
ui->textBrowser->append ( QString ( "child %1 double click" ).arg ( ui->widget_4->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::set33Sum()
|
|
|
|
{
|
|
|
|
ui->textBrowser->append ( QString ( "child %1 long click" ).arg ( ui->widget_4->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|
|
|
|
|
2018-05-17 19:45:16 +08:00
|
|
|
void MainWindow::set4Sum()
|
|
|
|
{
|
|
|
|
ui->textBrowser_2->append ( QString ( "%1 click" ).arg ( ui->widget_2->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::set5Sum()
|
|
|
|
{
|
|
|
|
ui->textBrowser_2->append ( QString ( "%1 long click" ).arg ( ui->widget_2->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|
2018-05-18 20:15:52 +08:00
|
|
|
|
|
|
|
void MainWindow::set6Sum()
|
|
|
|
{
|
|
|
|
ui->textBrowser_3->append ( QString ( "%1 click" ).arg ( ui->widget_3->clickHelper()->totalClickNum() ) );;
|
|
|
|
}
|