Lock func merge

This commit is contained in:
Krad
2021-11-23 17:16:31 +08:00
parent f226f57fb7
commit a9a0aad00f
4 changed files with 25 additions and 10 deletions

View File

@@ -85,6 +85,11 @@ void InputObject::initUi()
bool InputObject::eventFilter(QObject* obj, QEvent* event)
{
if (event->type() == QEvent::MouseButtonPress)
{
emit touchScreen();
qDebug() << "touchScreen()";
}
//mouse button release means setfocus is useless
if (event->type() == QEvent::MouseButtonRelease)
{

View File

@@ -21,6 +21,8 @@ public:
~InputObject();
bool eventFilter(QObject* obj, QEvent* event);
void ShowPanel();
signals:
void touchScreen();
private:
Ui::InputObject* ui;
void initUi();

View File

@@ -55,8 +55,8 @@ int main(int argc, char* argv[])
InputObject* obj = new InputObject();
a.installEventFilter(obj);
SQLHelper::Open();
UserOperationLog::Default()->init();
MainWindow w;
QObject::connect(obj, SIGNAL(touchScreen()), &w, SLOT(refreshTimer()));
QStringList app_args = a.arguments();

View File

@@ -2,6 +2,8 @@
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDebug>
#include <QTimer>
#include "StdOutRedirector.h"
namespace Ui {
class MainWindow;
@@ -21,7 +23,13 @@ public:
void requestLogin();
QTextEdit* getEdit();
void debugConsoleOn();
public slots:
void coverScreen();
void refreshTimer();
private:
QTimer* screenTimer = nullptr;
int counter = 30000;
Ui::MainWindow* ui;
GUIMessageDialog* msgDialog = nullptr;
StdOutRedirector* redir = nullptr;