-
Notifications
You must be signed in to change notification settings - Fork 24
/
recentdocuments.h
39 lines (31 loc) · 938 Bytes
/
recentdocuments.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
#ifndef RECENTDOCUMENTS_H
#define RECENTDOCUMENTS_H
#include <QObject>
#include <QList>
#include <QStringList>
class QAction;
class QSettings;
class RecentDocuments : public QObject
{
Q_OBJECT
public:
explicit RecentDocuments(int max_documents, QObject *parent = 0);
QList<QAction*> actions() const { return m_actions; }
void clear();
void accessing(const QString& name);
void readFromSettings(QSettings& settings, const QString& section);
void writeToSettings(QSettings& settings, const QString& section);
signals:
void recentDocument(const QString& name);
private slots:
void onCleatActionTriggered();
void onRecentDocumentsActionTriggered(int index);
private:
const int m_maxDocuments;
QList<QAction*> m_actions;
QList<QAction*> m_recentDocumentsActions;
QAction* m_separatorAction;
QAction* m_clearAction;
QStringList m_documents;
};
#endif // RECENTDOCUMENTS_H