-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmainwindow.h
44 lines (36 loc) · 1 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include "articlebutton.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
virtual void showEvent(QShowEvent *);
~MainWindow();
signals:
void newArticleAdd();
void articleTitleChanged(const QString &title);
void articleContentChanged(const QString &content);
void articleOpen(int idx);
void mainWindowLoaded();
void articleDelete(int idx);
public slots:
void addArticle(const Article &article);
void articleBufferChanged(const Article &article);
void changeSelectedArticle(int idx);
void ShowContextMenu(const QPoint &pos);
private:
Ui::MainWindow *ui;
QList<ArticleButton *> buttons;
ArticleButton *currentSelectedButton = nullptr;
QTimer *titleTimer = nullptr, *contentTimer = nullptr;
int inputTimeout = 500;
bool isTextChanged = false;
};
#endif // MAINWINDOW_H