author | unc0rr |
Sun, 12 Jan 2014 16:12:25 +0400 | |
changeset 9975 | 9fcdaa2be27e |
parent 9080 | 9b42757d7e71 |
child 9998 | 736015b847e3 |
permissions | -rw-r--r-- |
8374 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
9080 | 3 |
* Copyright (c) 2004-2013 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 |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
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 |