Lock func merge
This commit is contained in:
@@ -85,6 +85,11 @@ void InputObject::initUi()
|
|||||||
bool InputObject::eventFilter(QObject* obj, QEvent* event)
|
bool InputObject::eventFilter(QObject* obj, QEvent* event)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (event->type() == QEvent::MouseButtonPress)
|
||||||
|
{
|
||||||
|
emit touchScreen();
|
||||||
|
qDebug() << "touchScreen()";
|
||||||
|
}
|
||||||
//mouse button release means setfocus is useless
|
//mouse button release means setfocus is useless
|
||||||
if (event->type() == QEvent::MouseButtonRelease)
|
if (event->type() == QEvent::MouseButtonRelease)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,24 +9,26 @@ class QTextEdit;
|
|||||||
//#define CUTE_STYLE
|
//#define CUTE_STYLE
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class InputObject;
|
class InputObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
class InputObject : public QWidget
|
class InputObject : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit InputObject(QWidget *parent = nullptr);
|
explicit InputObject(QWidget* parent = nullptr);
|
||||||
~InputObject();
|
~InputObject();
|
||||||
bool eventFilter(QObject *obj, QEvent *event);
|
bool eventFilter(QObject* obj, QEvent* event);
|
||||||
void ShowPanel();
|
void ShowPanel();
|
||||||
|
signals:
|
||||||
|
void touchScreen();
|
||||||
private:
|
private:
|
||||||
Ui::InputObject *ui;
|
Ui::InputObject* ui;
|
||||||
void initUi();
|
void initUi();
|
||||||
// void ShowPanel();
|
// void ShowPanel();
|
||||||
void HidePanel();
|
void HidePanel();
|
||||||
QDateEdit *curDateEdit = nullptr;
|
QDateEdit* curDateEdit = nullptr;
|
||||||
QLineEdit* curLine = nullptr;
|
QLineEdit* curLine = nullptr;
|
||||||
QTextEdit* curText = nullptr;
|
QTextEdit* curText = nullptr;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ int main(int argc, char* argv[])
|
|||||||
InputObject* obj = new InputObject();
|
InputObject* obj = new InputObject();
|
||||||
a.installEventFilter(obj);
|
a.installEventFilter(obj);
|
||||||
SQLHelper::Open();
|
SQLHelper::Open();
|
||||||
UserOperationLog::Default()->init();
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
|
QObject::connect(obj, SIGNAL(touchScreen()), &w, SLOT(refreshTimer()));
|
||||||
|
|
||||||
|
|
||||||
QStringList app_args = a.arguments();
|
QStringList app_args = a.arguments();
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QTimer>
|
||||||
#include "StdOutRedirector.h"
|
#include "StdOutRedirector.h"
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
@@ -21,7 +23,13 @@ public:
|
|||||||
void requestLogin();
|
void requestLogin();
|
||||||
QTextEdit* getEdit();
|
QTextEdit* getEdit();
|
||||||
void debugConsoleOn();
|
void debugConsoleOn();
|
||||||
|
public slots:
|
||||||
|
void coverScreen();
|
||||||
|
void refreshTimer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QTimer* screenTimer = nullptr;
|
||||||
|
int counter = 30000;
|
||||||
Ui::MainWindow* ui;
|
Ui::MainWindow* ui;
|
||||||
GUIMessageDialog* msgDialog = nullptr;
|
GUIMessageDialog* msgDialog = nullptr;
|
||||||
StdOutRedirector* redir = nullptr;
|
StdOutRedirector* redir = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user