Changeset View
Changeset View
Standalone View
Standalone View
lib/redeyereduction/redeyereductiontool.cpp
Show All 16 Lines | |||||
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software | ||
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | 19 | | |||
20 | */ | 20 | */ | ||
21 | // Self | 21 | // Self | ||
22 | #include "redeyereductiontool.h" | 22 | #include "redeyereductiontool.h" | ||
23 | 23 | | |||
24 | // Qt | 24 | // Qt | ||
25 | #include <QDialogButtonBox> | ||||
25 | #include <QGraphicsSceneMouseEvent> | 26 | #include <QGraphicsSceneMouseEvent> | ||
26 | #include <QPainter> | 27 | #include <QPainter> | ||
27 | #include <QPushButton> | 28 | #include <QPushButton> | ||
28 | #include <QRect> | 29 | #include <QRect> | ||
29 | #include <QDebug> | 30 | #include <QDebug> | ||
30 | 31 | | |||
31 | // KDE | 32 | // KDE | ||
32 | 33 | | |||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | |||||
153 | } | 154 | } | ||
154 | 155 | | |||
155 | void RedEyeReductionTool::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) | 156 | void RedEyeReductionTool::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) | ||
156 | { | 157 | { | ||
157 | // Just prevent the event from reaching the image view | 158 | // Just prevent the event from reaching the image view | ||
158 | event->accept(); | 159 | event->accept(); | ||
159 | } | 160 | } | ||
160 | 161 | | |||
162 | void RedEyeReductionTool::keyPressEvent(QKeyEvent* event) | ||||
163 | { | ||||
164 | QDialogButtonBox *buttons = d->mToolWidget->findChild<QDialogButtonBox *>(); | ||||
165 | switch (event->key()) { | ||||
166 | case Qt::Key_Escape: | ||||
167 | event->accept(); | ||||
168 | buttons->rejected(); | ||||
169 | break; | ||||
170 | case Qt::Key_Return: | ||||
171 | case Qt::Key_Enter: | ||||
172 | event->accept(); | ||||
173 | buttons->accepted(); | ||||
174 | break; | ||||
175 | default: | ||||
176 | break; | ||||
177 | } | ||||
178 | } | ||||
179 | | ||||
161 | void RedEyeReductionTool::toolActivated() | 180 | void RedEyeReductionTool::toolActivated() | ||
162 | { | 181 | { | ||
163 | imageView()->setCursor(Qt::CrossCursor); | 182 | imageView()->setCursor(Qt::CrossCursor); | ||
164 | } | 183 | } | ||
165 | 184 | | |||
166 | void RedEyeReductionTool::slotApplyClicked() | 185 | void RedEyeReductionTool::slotApplyClicked() | ||
167 | { | 186 | { | ||
168 | QRectF docRectF = d->rectF(); | 187 | QRectF docRectF = d->rectF(); | ||
Show All 23 Lines |