dtkRecentFilesMenu.h 781 Bytes
Newer Older
1 2 3
// Version: $Id$
//
//
4

5 6 7
// Commentary:
//
//
8

9 10 11
// Change Log:
//
//
12

13
// Code:
14

15
#pragma once
16

17
#include <QtWidgets>
18

19
#include <dtkWidgetsExport.h>
20 21

class DTKWIDGETS_EXPORT dtkRecentFilesMenu : public QMenu
22 23 24 25 26 27
{
    Q_OBJECT
    Q_PROPERTY(int maxCount READ maxCount WRITE setMaxCount)

public:
    dtkRecentFilesMenu(QWidget *parent = 0);
28
    dtkRecentFilesMenu(const QString& title, QWidget *parent = 0);
29 30 31 32

    int maxCount(void) const;

public slots:
33
    void addRecentFile(const QString& fileName);
34 35 36 37
    void clearMenu(void);
    void setMaxCount(int);

signals:
38
    void recentFileTriggered(const QString& filename);
39 40 41 42 43 44 45 46 47

private slots:
    void menuTriggered(QAction *action);
    void updateRecentFileActions(void);

private:
    int m_maxCount;
};

48 49
//
// dtkRecentFilesMenu.h ends here