Changeset View
Changeset View
Standalone View
Standalone View
lib/redeyereduction/redeyereductiontool.cpp
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Line(s) | |||||
168 | { | 168 | { | ||
169 | QDialogButtonBox *buttons = d->mToolWidget->findChild<QDialogButtonBox *>(); | 169 | QDialogButtonBox *buttons = d->mToolWidget->findChild<QDialogButtonBox *>(); | ||
170 | switch (event->key()) { | 170 | switch (event->key()) { | ||
171 | case Qt::Key_Escape: | 171 | case Qt::Key_Escape: | ||
172 | event->accept(); | 172 | event->accept(); | ||
173 | buttons->rejected(); | 173 | buttons->rejected(); | ||
174 | break; | 174 | break; | ||
175 | case Qt::Key_Return: | 175 | case Qt::Key_Return: | ||
176 | case Qt::Key_Enter: | 176 | case Qt::Key_Enter: { | ||
177 | event->accept(); | 177 | event->accept(); | ||
178 | auto focusButton = static_cast<QPushButton*>(buttons->focusWidget()); | ||||
179 | if (focusButton && buttons->buttonRole(focusButton) == QDialogButtonBox::RejectRole) { | ||||
180 | buttons->rejected(); | ||||
181 | } else { | ||||
178 | buttons->accepted(); | 182 | buttons->accepted(); | ||
183 | } | ||||
muhlenpfordt: The red eye tool uses `QDialogButtonBox::Close`. This results in a crash when pressing one of… | |||||
Ah, I only tested with the master branch and kinda missed that lonely Close button. Yay for reviews! I'll do this in a more generic way. rkflx: Ah, I only tested with the master branch and kinda missed that lonely {nav Close} button. Yay… | |||||
179 | break; | 184 | break; | ||
185 | } | ||||
180 | default: | 186 | default: | ||
181 | break; | 187 | break; | ||
182 | } | 188 | } | ||
183 | } | 189 | } | ||
184 | 190 | | |||
185 | void RedEyeReductionTool::toolActivated() | 191 | void RedEyeReductionTool::toolActivated() | ||
186 | { | 192 | { | ||
187 | imageView()->setCursor(Qt::CrossCursor); | 193 | imageView()->setCursor(Qt::CrossCursor); | ||
Show All 28 Lines |
The red eye tool uses QDialogButtonBox::Close. This results in a crash when pressing one of the buttons with Return.
(Attention: In master both are used!)