mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
QT6: QMouseEvent
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include "qtextorientationwidget.h"
|
||||
#include <algorithm>
|
||||
#include <QMouseEvent>
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@@ -254,8 +255,14 @@ void QTextOrientationWidget::paintEvent(QPaintEvent *event) {
|
||||
*/
|
||||
void QTextOrientationWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
if (read_only_) return;
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
bool drawn_angle_hovered = positionIsASquare(event -> localPos(), &highlight_angle_);
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
bool drawn_angle_hovered = positionIsASquare(event -> position(), &highlight_angle_);
|
||||
#endif
|
||||
|
||||
if (must_highlight_angle_ != drawn_angle_hovered) {
|
||||
must_highlight_angle_ = drawn_angle_hovered;
|
||||
@@ -271,8 +278,14 @@ void QTextOrientationWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
if (read_only_) return;
|
||||
|
||||
double clicked_angle;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
bool drawn_angle_clicked = positionIsASquare(event -> localPos(), &clicked_angle);
|
||||
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
bool drawn_angle_clicked = positionIsASquare(event -> position(), &clicked_angle);
|
||||
#endif
|
||||
if (drawn_angle_clicked) {
|
||||
setOrientation(clicked_angle);
|
||||
emit(orientationChanged(clicked_angle));
|
||||
|
||||
Reference in New Issue
Block a user