forked from goldendict/goldendict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
groupcombobox.hh
47 lines (30 loc) · 948 Bytes
/
groupcombobox.hh
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
/* This file is (c) 2008-2012 Konstantin Isakov <[email protected]>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __GROUPCOMBOBOX_HH_INCLUDED__
#define __GROUPCOMBOBOX_HH_INCLUDED__
#include <QComboBox>
#include <QAction>
#include "instances.hh"
/// This is a combo box which is for choosing the dictionary group
class GroupComboBox: public QComboBox
{
Q_OBJECT
public:
GroupComboBox( QWidget * parent );
/// Fills combo-box with the given groups
void fill( Instances::Groups const & );
/// Chooses the given group in the combobox. If there's no such group,
/// does nothing.
void setCurrentGroup( unsigned id );
/// Returns current group.
unsigned getCurrentGroup() const;
protected:
/// We handle shortcut events here.
virtual bool event( QEvent * event );
private slots:
void popupGroups();
private:
QAction popupAction;
QMap< int, int > shortcuts;
};
#endif