Changeset View
Changeset View
Standalone View
Standalone View
lib/redeyereduction/redeyereductiontool.cpp
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Line(s) | |||||
172 | 172 | | |||
173 | void RedEyeReductionTool::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) | 173 | void RedEyeReductionTool::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) | ||
174 | { | 174 | { | ||
175 | if (event->buttons() != Qt::LeftButton) { | 175 | if (event->buttons() != Qt::LeftButton) { | ||
176 | event->ignore(); | 176 | event->ignore(); | ||
177 | return; | 177 | return; | ||
178 | } | 178 | } | ||
179 | event->accept(); | 179 | event->accept(); | ||
180 | d->mToolWidget->mainDialogButtonBox->accepted(); | 180 | emit d->mToolWidget->mainDialogButtonBox->accepted(); | ||
181 | } | 181 | } | ||
182 | 182 | | |||
183 | void RedEyeReductionTool::keyPressEvent(QKeyEvent* event) | 183 | void RedEyeReductionTool::keyPressEvent(QKeyEvent* event) | ||
184 | { | 184 | { | ||
185 | QDialogButtonBox *buttons; | 185 | QDialogButtonBox *buttons; | ||
186 | if (d->mStatus == Adjusting) { | 186 | if (d->mStatus == Adjusting) { | ||
187 | buttons = d->mToolWidget->mainDialogButtonBox; | 187 | buttons = d->mToolWidget->mainDialogButtonBox; | ||
188 | } else { | 188 | } else { | ||
189 | buttons = d->mToolWidget->helpDialogButtonBox; | 189 | buttons = d->mToolWidget->helpDialogButtonBox; | ||
190 | } | 190 | } | ||
191 | 191 | | |||
192 | switch (event->key()) { | 192 | switch (event->key()) { | ||
193 | case Qt::Key_Escape: | 193 | case Qt::Key_Escape: | ||
194 | event->accept(); | 194 | event->accept(); | ||
195 | buttons->rejected(); | 195 | emit buttons->rejected(); | ||
196 | break; | 196 | break; | ||
197 | case Qt::Key_Return: | 197 | case Qt::Key_Return: | ||
198 | case Qt::Key_Enter: { | 198 | case Qt::Key_Enter: { | ||
199 | event->accept(); | 199 | event->accept(); | ||
200 | auto focusButton = static_cast<QPushButton*>(buttons->focusWidget()); | 200 | auto focusButton = static_cast<QPushButton*>(buttons->focusWidget()); | ||
201 | if (focusButton && buttons->buttonRole(focusButton) == QDialogButtonBox::RejectRole) { | 201 | if (focusButton && buttons->buttonRole(focusButton) == QDialogButtonBox::RejectRole) { | ||
202 | buttons->rejected(); | 202 | emit buttons->rejected(); | ||
203 | } else { | 203 | } else { | ||
204 | buttons->accepted(); | 204 | emit buttons->accepted(); | ||
205 | } | 205 | } | ||
206 | break; | 206 | break; | ||
207 | } | 207 | } | ||
208 | default: | 208 | default: | ||
209 | break; | 209 | break; | ||
210 | } | 210 | } | ||
211 | } | 211 | } | ||
212 | 212 | | |||
Show All 31 Lines |