author | Wuzzy <almikes@aol.com> |
Thu, 24 Nov 2016 15:45:46 +0100 | |
changeset 12066 | d4860f0ce4a0 |
parent 11046 | 47a8c19ecb60 |
permissions | -rw-r--r-- |
8374 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
8374 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
9998
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
8374 | 17 |
*/ |
18 |
||
19 |
#ifndef HATPROMPT_H |
|
20 |
#define HATPROMPT_H |
|
21 |
||
22 |
#include <QWidget> |
|
23 |
#include <QDialog> |
|
24 |
#include <QListView> |
|
25 |
||
26 |
class QLineEdit; |
|
27 |
class QModelIndex; |
|
28 |
class QSortFilterProxyModel; |
|
29 |
class LineEditCursor; |
|
30 |
||
31 |
class HatListView : public QListView |
|
32 |
{ |
|
8434 | 33 |
friend class HatPrompt; |
8374 | 34 |
|
8434 | 35 |
public: |
8385
9e8924ff9813
Convert feedback page to dialog (+some fixes from unC0Rr)
dag10
parents:
8374
diff
changeset
|
36 |
HatListView(QWidget* parent = 0) : QListView(parent){} |
8623 | 37 |
void moveUp(); |
38 |
void moveDown(); |
|
39 |
void moveLeft(); |
|
40 |
void moveRight(); |
|
8374 | 41 |
}; |
42 |
||
43 |
class HatPrompt : public QDialog |
|
44 |
{ |
|
45 |
Q_OBJECT |
|
46 |
||
47 |
public: |
|
48 |
HatPrompt(int currentIndex = 0, QWidget* parent = 0); |
|
49 |
||
50 |
private: |
|
51 |
LineEditCursor * txtFilter; |
|
52 |
HatListView * list; |
|
53 |
QSortFilterProxyModel * filterModel; |
|
54 |
||
55 |
private slots: |
|
8434 | 56 |
void onAccepted(); |
8374 | 57 |
void hatChosen(const QModelIndex & index); |
58 |
void filterChanged(const QString & text); |
|
59 |
void moveUp(); |
|
60 |
void moveDown(); |
|
61 |
void moveLeft(); |
|
62 |
void moveRight(); |
|
63 |
}; |
|
64 |
||
65 |
#endif // HATPROMPT_H |