summaryrefslogtreecommitdiff
path: root/src/frontend/displaywindow/bttoolbarpopupaction.h
blob: ebbc8481dd32a9f77d2f806cf61a9a3da8b21674 (plain)
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
/*********
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2011 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/

#ifndef BT_TOOLBAR_POPUP_ACTION_H
#define BT_TOOLBAR_POPUP_ACTION_H

#include <QWidgetAction>


class QIcon;
class QMenu;
class QString;
class QToolButton;

// This class manages the toolbar display for going forward and backward in history.
class BtToolBarPopupAction : public QWidgetAction {
        Q_OBJECT
    public:

        BtToolBarPopupAction(const QIcon& icon, const QString& text, QObject* parent);
        ~BtToolBarPopupAction();

// return the QMenu object so a popup menu can be constructed
        QMenu* popupMenu() const;

// Function to catch the Shortcut event and emit the triggered signal
        virtual bool event(QEvent* e);

    protected:
        QWidget* createWidget(QWidget* parent);

    private slots:

// Slot to emit a triggered signal when the toolbar button is pressed
        void buttonPressed();

    private:
        QMenu* m_menu;
        QToolButton* m_button;
        QIcon m_icon;
        QString m_text;
};

#endif