author | nemo |
Sat, 03 Jan 2015 17:27:33 -0500 | |
branch | 0.9.21 |
changeset 10739 | d886f319e7b3 |
parent 10108 | c68cf030eded |
child 11046 | 47a8c19ecb60 |
permissions | -rw-r--r-- |
8374 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
9998 | 3 |
* Copyright (c) 2004-2014 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 |