mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Fix the Image Visualizer zoom keys under Qt6
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
QImageViewer::QImageViewer (QWidget* parent) : QWidget(parent) {
|
QImageViewer::QImageViewer (QWidget* parent) : QWidget(parent) {
|
||||||
|
|
||||||
|
setFocusPolicy(Qt::StrongFocus); // So the widget can take focus and receive the +/-/ESC zoom keys.
|
||||||
|
|
||||||
_zoomFactor = 1.0;
|
_zoomFactor = 1.0;
|
||||||
|
|
||||||
// Setup the widgets
|
// Setup the widgets
|
||||||
@@ -174,7 +176,7 @@ void QImageViewer::keyPressEvent (QKeyEvent* event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QImageViewer::enterEvent (QEvent* event) {
|
void QImageViewer::enterEvent (QEnterEvent* event) {
|
||||||
|
|
||||||
Q_UNUSED(event);
|
Q_UNUSED(event);
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -38,8 +38,8 @@ class QImageViewer : public QWidget {
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void keyPressEvent (QKeyEvent* event);
|
void keyPressEvent (QKeyEvent* event);
|
||||||
void enterEvent (QEvent* event);
|
void enterEvent (QEnterEvent* event) override;
|
||||||
void leaveEvent (QEvent* event);
|
void leaveEvent (QEvent* event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QImage _image;
|
QImage _image;
|
||||||
|
|||||||
Reference in New Issue
Block a user