1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 Tobias Gläßer
4 **
5 ** This file is part of AQEMU.
6 **
7 ** This program is free software; you can redistribute it and/or modify
8 ** it under the terms of the GNU General Public License as published by
9 ** the Free Software Foundation; either version 2 of the License.
10 **
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ** GNU General Public License for more details.
15 **
16 ** You should have received a copy of the GNU General Public License
17 ** along with this program; if not, write to the Free Software
18 ** Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 ** Boston, MA  02110-1301, USA.
20 **
21 ****************************************************************************/
22 
23 #ifndef SETTINGS_WIDGET_H
24 #define SETTINGS_WIDGET_H
25 
26 #include <QWidget>
27 #include <QListWidget>
28 #include <QWheelEvent>
29 #include <QList>
30 #include <QMap>
31 
32 class QTabWidget;
33 class QStackedWidget;
34 class QBoxLayout;
35 class QSize;
36 class QSplitter;
37 
38 class My_List_Widget : public QListWidget
39 {
40     Q_OBJECT
41 
42     public:
43         My_List_Widget(QWidget* parent);
44 
45     protected:
46         virtual void wheelEvent(QWheelEvent* e);
47 };
48 
49 class Settings_Widget : public QWidget
50 {
51     Q_OBJECT
52 
53     public:
54         Settings_Widget(QTabWidget*, QBoxLayout::Direction dir, bool erase_margins = false, bool erase_parent_margins = true);
55         ~Settings_Widget();
56         void setIconSize(QSize);
57         void addToGroup(QString);
58         static void syncGroupIconSizes(QString);
59 
60     private:
61         My_List_Widget* list;
62         QStackedWidget* stack;
63         QSplitter* splitter;
64 
65         QString my_Group;
66         static QMap<QString,QList<Settings_Widget*>> groups;
67 };
68 
69 #endif
70 
71 
72