equal
deleted
inserted
replaced
32 |
32 |
33 #include "DataManager.h" |
33 #include "DataManager.h" |
34 #include "lineeditcursor.h" |
34 #include "lineeditcursor.h" |
35 #include "HatModel.h" |
35 #include "HatModel.h" |
36 #include "hatprompt.h" |
36 #include "hatprompt.h" |
|
37 |
|
38 void HatListView::moveUp() |
|
39 { |
|
40 setCurrentIndex(moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier)); |
|
41 } |
|
42 |
|
43 void HatListView::moveDown() |
|
44 { |
|
45 setCurrentIndex(moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier)); |
|
46 } |
|
47 |
|
48 void HatListView::moveLeft() |
|
49 { |
|
50 setCurrentIndex(moveCursor(QAbstractItemView::MoveLeft, Qt::NoModifier)); |
|
51 } |
|
52 |
|
53 void HatListView::moveRight() |
|
54 { |
|
55 setCurrentIndex(moveCursor(QAbstractItemView::MoveRight, Qt::NoModifier)); |
|
56 } |
37 |
57 |
38 HatPrompt::HatPrompt(int currentIndex, QWidget* parent) : QDialog(parent) |
58 HatPrompt::HatPrompt(int currentIndex, QWidget* parent) : QDialog(parent) |
39 { |
59 { |
40 setModal(true); |
60 setModal(true); |
41 setWindowFlags(Qt::Sheet); |
61 setWindowFlags(Qt::Sheet); |
126 dialogLayout->addWidget(btnSelect, 2, 2, 1, 1, Qt::AlignRight); |
146 dialogLayout->addWidget(btnSelect, 2, 2, 1, 1, Qt::AlignRight); |
127 } |
147 } |
128 |
148 |
129 void HatPrompt::moveUp() |
149 void HatPrompt::moveUp() |
130 { |
150 { |
131 list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier)); |
151 list->moveUp(); |
132 } |
152 } |
133 |
153 |
134 void HatPrompt::moveDown() |
154 void HatPrompt::moveDown() |
135 { |
155 { |
136 list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveDown, Qt::NoModifier)); |
156 list->moveDown(); |
137 } |
157 } |
138 |
158 |
139 void HatPrompt::moveLeft() |
159 void HatPrompt::moveLeft() |
140 { |
160 { |
141 list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveLeft, Qt::NoModifier)); |
161 list->moveLeft(); |
142 } |
162 } |
143 |
163 |
144 void HatPrompt::moveRight() |
164 void HatPrompt::moveRight() |
145 { |
165 { |
146 list->setCurrentIndex(list->moveCursor(QAbstractItemView::MoveRight, Qt::NoModifier)); |
166 list->moveRight(); |
147 } |
167 } |
148 |
168 |
149 void HatPrompt::onAccepted() |
169 void HatPrompt::onAccepted() |
150 { |
170 { |
151 hatChosen(list->currentIndex()); |
171 hatChosen(list->currentIndex()); |