mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
QT6: Mod Qt::MidButton Use Qt::MiddleButton
This commit is contained in:
@@ -423,7 +423,14 @@ void DiagramView::mousePressEvent(QMouseEvent *e)
|
||||
if (m_event_interface && m_event_interface->mousePressEvent(e)) return;
|
||||
|
||||
//Start drag view when hold the middle button
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
if (e->button() == Qt::MidButton)
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
if (e->button() == Qt::MiddleButton)
|
||||
#endif
|
||||
{
|
||||
m_drag_last_pos = e->pos();
|
||||
viewport()->setCursor(Qt::ClosedHandCursor);
|
||||
@@ -473,7 +480,14 @@ void DiagramView::mouseMoveEvent(QMouseEvent *e)
|
||||
if (m_event_interface && m_event_interface->mouseMoveEvent(e)) return;
|
||||
|
||||
//Drag the view
|
||||
if (e->buttons() == Qt::MidButton)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
if (e->button() == Qt::MidButton)
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
if (e->button() == Qt::MiddleButton)
|
||||
#endif
|
||||
{
|
||||
QScrollBar *h = horizontalScrollBar();
|
||||
QScrollBar *v = verticalScrollBar();
|
||||
@@ -534,7 +548,14 @@ void DiagramView::mouseReleaseEvent(QMouseEvent *e)
|
||||
if (m_event_interface && m_event_interface->mouseReleaseEvent(e)) return;
|
||||
|
||||
//Stop drag view
|
||||
if (e -> button() == Qt::MidButton)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
if (e->button() == Qt::MidButton)
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
if (e->button() == Qt::MiddleButton)
|
||||
#endif
|
||||
{
|
||||
viewport()->setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
@@ -373,7 +373,14 @@ ElementContent ElementView::pasteWithOffset(const QDomDocument &xml_document) {
|
||||
@param e QMouseEvent decrivant l'evenement souris
|
||||
*/
|
||||
void ElementView::mousePressEvent(QMouseEvent *e) {
|
||||
if (e->buttons() == Qt::MidButton)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
if (e->button() == Qt::MidButton)
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
if (e->button() == Qt::MiddleButton)
|
||||
#endif
|
||||
{
|
||||
setCursor( (Qt::ClosedHandCursor));
|
||||
reference_view_ = e->pos();
|
||||
@@ -387,7 +394,14 @@ void ElementView::mousePressEvent(QMouseEvent *e) {
|
||||
Manage the event move mouse
|
||||
*/
|
||||
void ElementView::mouseMoveEvent(QMouseEvent *e) {
|
||||
if (e->buttons() == Qt::MidButton)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
if (e->button() == Qt::MidButton)
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
if (e->button() == Qt::MiddleButton)
|
||||
#endif
|
||||
{
|
||||
QScrollBar *h = horizontalScrollBar();
|
||||
QScrollBar *v = verticalScrollBar();
|
||||
@@ -405,7 +419,15 @@ void ElementView::mouseMoveEvent(QMouseEvent *e) {
|
||||
Manage event release click mouse
|
||||
*/
|
||||
void ElementView::mouseReleaseEvent(QMouseEvent *e) {
|
||||
if (e -> button() == Qt::MidButton) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
if (e->button() == Qt::MidButton)
|
||||
#else
|
||||
#if TODO_LIST
|
||||
#pragma message("@TODO remove code for QT 6 or later")
|
||||
#endif
|
||||
if (e->button() == Qt::MiddleButton)
|
||||
#endif
|
||||
{
|
||||
setCursor(Qt::ArrowCursor);
|
||||
adjustSceneRect();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user