-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotewidget.h
More file actions
54 lines (46 loc) · 1.18 KB
/
notewidget.h
File metadata and controls
54 lines (46 loc) · 1.18 KB
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
45
46
47
48
49
50
51
52
53
54
#ifndef NOTEWIDGET_H
#define NOTEWIDGET_H
#include <QWidget>
#include <QFont>
#include <QTextDocument>
#include "richtextedit.h"
#include <QTimer>
namespace Ui {
class NoteWidget;
}
class NoteWidget : public QWidget
{
Q_OBJECT
public:
explicit NoteWidget(QWidget *parent = nullptr);
NoteWidget(QWidget *parent,QString noteName,QString fileName,QFont font);
~NoteWidget();
public:
bool setFile(QString& fileName);
bool rename(QString& newName);
bool find(QString& text,QTextDocument::FindFlags flags);
bool save(QString& filePath, int type = 0);
void setTextFont(QFont& font);
void setCurrentFont(QFont& font);
void setFontColor(QColor& color);
void setBgColor(QPalette& palette);
void setTabWidth(int width);
bool isEmpty();
void deletefile();
bool load();
bool save();
void dealBackTab();
void insertTable(int row, int col, int percent);
public slots:
void sltTextChanged();
void sltFilterEntries();
private:
Ui::NoteWidget *ui;
QString m_filePath;
RichTextEdit* m_textEdit;
QString m_noteName;
QTimer* m_typingTimer;
bool m_textChanged;
QString m_filterText;
};
#endif // NOTEWIDGET_H