-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNoteList.h
More file actions
70 lines (46 loc) · 1.37 KB
/
Copy pathNoteList.h
File metadata and controls
70 lines (46 loc) · 1.37 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef NOTELIST_H
#define NOTELIST_H
#include <QTreeWidget>
#include <QTreeWidgetItem>
class _CNoteStg;
class QNoteList : public QTreeWidget
{
Q_OBJECT
protected:
_CNoteStg * m_pStg;
bool m_bBlockChkSignal;
struct _CSortState{
int m_iLogicalIndex;
Qt::SortOrder m_iSortOrder;
_CSortState() : m_iLogicalIndex(0), m_iSortOrder(Qt::AscendingOrder){return;}
};
_CSortState m_xCurrentSortState;
class _CTreeWidgetItem : public QTreeWidgetItem{
public:
_CTreeWidgetItem(QTreeWidget* pTree) : QTreeWidgetItem(pTree){return;}
virtual bool operator<(const QTreeWidgetItem &other)const;
};
enum _TCol{
_COL_CONTENT = 0
, _COL_CREATED
, _COL_DISPLAY
, _COL_READONLY
};
public:
explicit QNoteList(_CNoteStg* pDb, QWidget* parent = 0);
int indexOfNote(const QString& sName) const;
void addNote(const QString& sName);
void removeNote(const QString& sName);
void refreshNote(const QString& sName, bool bAutoAddDel);
protected:
void loadNotes();
virtual void resizeEvent(QResizeEvent* e);
signals:
void noteVisibilityChanged(const QString& sName, bool bVisible);
void noteReadOnlyChanged(const QString& sName, bool bReadOnly);
protected slots:
void onNoteDisplayChecked(QTreeWidgetItem* pItem, int nCol);
void onNoteReadOnlyChecked(QTreeWidgetItem* pItem, int nCol);
void onAttempToSortByColumn(int iLogicalIndex);
};
#endif // NOTELIST_H