Replace Qt's MidButton with MiddleButton
The latter has been the preferred name since Qt 4.7.0. Added a comment on where the old name is exposed to QML that it's only for backwards compatibility. Pick-to: 5.15 Change-Id: I2c5088d597dd7327cc5899d06afb180d0ec2893e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
b4d36a05be
commit
3debb37250
|
@ -81,7 +81,7 @@ Rectangle {
|
|||
buttonID = 'LeftButton'
|
||||
else if (mouse.button == Qt.RightButton)
|
||||
buttonID = 'RightButton'
|
||||
else if (mouse.button == Qt.MidButton)
|
||||
else if (mouse.button == Qt.MiddleButton)
|
||||
buttonID = 'MiddleButton'
|
||||
else if (mouse.button == Qt.BackButton)
|
||||
buttonID = 'BackButton'
|
||||
|
|
|
@ -51,7 +51,7 @@ Module {
|
|||
"NoButton": 0,
|
||||
"LeftButton": 1,
|
||||
"RightButton": 2,
|
||||
"MidButton": 4,
|
||||
"MidButton": 4, // For backwards compatibility
|
||||
"MiddleButton": 4,
|
||||
"BackButton": 8,
|
||||
"XButton1": 8,
|
||||
|
|
|
@ -1192,7 +1192,7 @@ void QQuickTextControlPrivate::mouseReleaseEvent(QMouseEvent *e, const QPointF &
|
|||
#if QT_CONFIG(clipboard)
|
||||
setClipboardSelection();
|
||||
selectionChanged(true);
|
||||
} else if (e->button() == Qt::MidButton
|
||||
} else if (e->button() == Qt::MiddleButton
|
||||
&& (interactionFlags & Qt::TextEditable)
|
||||
&& QGuiApplication::clipboard()->supportsSelection()) {
|
||||
setCursorPosition(pos);
|
||||
|
|
|
@ -1628,7 +1628,7 @@ void QQuickTextInput::mouseReleaseEvent(QMouseEvent *event)
|
|||
if (QGuiApplication::clipboard()->supportsSelection()) {
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
d->copy(QClipboard::Selection);
|
||||
} else if (!d->m_readOnly && event->button() == Qt::MidButton) {
|
||||
} else if (!d->m_readOnly && event->button() == Qt::MiddleButton) {
|
||||
d->deselect();
|
||||
d->insert(QGuiApplication::clipboard()->text(QClipboard::Selection));
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ Rectangle {
|
|||
}
|
||||
Image {
|
||||
source: "resources/mouse_middle.png"
|
||||
visible: buttons & Qt.MidButton
|
||||
visible: buttons & Qt.MiddleButton
|
||||
}
|
||||
Image {
|
||||
source: "resources/mouse_right.png"
|
||||
|
|
Loading…
Reference in New Issue