mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
generic: replace obsolete Qt::MidButton with Qt::MiddleButton
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
59395b6c16
commit
05c4419b77
18 changed files with 40 additions and 40 deletions
|
@ -121,7 +121,7 @@ bool KCheckAccelerators::eventFilter(QObject* obj, QEvent* e)
|
|||
break;
|
||||
//case QEvent::MouseButtonDblClick:
|
||||
case QEvent::MouseButtonPress:
|
||||
if ( copyWidgetText && static_cast<QMouseEvent*>(e)->button() == Qt::MidButton ) {
|
||||
if ( copyWidgetText && static_cast<QMouseEvent*>(e)->button() == Qt::MiddleButton ) {
|
||||
//kWarning()<<"obj"<<obj;
|
||||
QWidget* w=static_cast<QWidget*>(obj)->childAt(static_cast<QMouseEvent*>(e)->pos());
|
||||
if (!w)
|
||||
|
|
|
@ -443,7 +443,7 @@ KRockerGesture::KRockerGesture(const QString &description)
|
|||
*current = Qt::RightButton;
|
||||
break;
|
||||
case 'M':
|
||||
*current = Qt::MidButton;
|
||||
*current = Qt::MiddleButton;
|
||||
break;
|
||||
case '1':
|
||||
*current = Qt::XButton1;
|
||||
|
@ -486,7 +486,7 @@ void KRockerGesture::setButtons(Qt::MouseButton hold, Qt::MouseButton thenPush)
|
|||
switch (button) {
|
||||
case Qt::LeftButton:
|
||||
case Qt::RightButton:
|
||||
case Qt::MidButton:
|
||||
case Qt::MiddleButton:
|
||||
case Qt::XButton1:
|
||||
case Qt::XButton2:
|
||||
break;
|
||||
|
@ -516,7 +516,7 @@ QString KRockerGesture::mouseButtonName(Qt::MouseButton button)
|
|||
case Qt::LeftButton:
|
||||
return i18nc("left mouse button", "left button");
|
||||
break;
|
||||
case Qt::MidButton:
|
||||
case Qt::MiddleButton:
|
||||
return i18nc("middle mouse button", "middle button");
|
||||
break;
|
||||
case Qt::RightButton:
|
||||
|
@ -562,7 +562,7 @@ QString KRockerGesture::toString() const
|
|||
case Qt::RightButton:
|
||||
desc = 'R';
|
||||
break;
|
||||
case Qt::MidButton:
|
||||
case Qt::MiddleButton:
|
||||
desc = 'M';
|
||||
break;
|
||||
case Qt::XButton1:
|
||||
|
|
|
@ -108,7 +108,7 @@ void KButtonGroupTest::testClicks()
|
|||
// QRadioButton's react only to LMB click events
|
||||
QTest::mouseClick(buttons[5], Qt::RightButton, 0, QPoint(), 10);
|
||||
QCOMPARE(kbuttongroup->selected(), 1);
|
||||
QTest::mouseClick(buttons[5], Qt::MidButton, 0, QPoint(), 10);
|
||||
QTest::mouseClick(buttons[5], Qt::MiddleButton, 0, QPoint(), 10);
|
||||
QCOMPARE(kbuttongroup->selected(), 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ TestWidget::TestWidget() : QWidget(0), m_lock(this)
|
|||
QMap<Qt::MouseButton, QString> buttons;
|
||||
buttons.insert(Qt::LeftButton, "Left Button");
|
||||
buttons.insert(Qt::RightButton, "Right Button");
|
||||
buttons.insert(Qt::MidButton, "Middle Button");
|
||||
buttons.insert(Qt::MiddleButton, "Middle Button");
|
||||
buttons.insert(Qt::XButton1, "First X Button");
|
||||
buttons.insert(Qt::XButton2, "Second X Button");
|
||||
|
||||
|
|
|
@ -175,15 +175,15 @@ void KTabWidget_UnitTest::testMiddleClickTabReordering()
|
|||
QPoint pos1 = tabWidget.getTabBar()->tabRect(1).center();
|
||||
|
||||
// Press MMB
|
||||
QTest::mousePress(tabWidget.getTabBar(), Qt::MidButton, Qt::NoModifier, pos0);
|
||||
QTest::mousePress(tabWidget.getTabBar(), Qt::MiddleButton, Qt::NoModifier, pos0);
|
||||
|
||||
// We need a first move event on tab 0 to initialize tab moving
|
||||
QMouseEvent moveEvent(QEvent::MouseMove, pos0, Qt::NoButton, Qt::MidButton, Qt::NoModifier);
|
||||
QMouseEvent moveEvent(QEvent::MouseMove, pos0, Qt::NoButton, Qt::MiddleButton, Qt::NoModifier);
|
||||
bool moveEventReceived = qApp->notify(tabWidget.getTabBar(), &moveEvent);
|
||||
QVERIFY(moveEventReceived);
|
||||
|
||||
// Move tab 0 to tab 1
|
||||
moveEvent = QMouseEvent(QEvent::MouseMove, pos1, Qt::NoButton, Qt::MidButton, Qt::NoModifier);
|
||||
moveEvent = QMouseEvent(QEvent::MouseMove, pos1, Qt::NoButton, Qt::MiddleButton, Qt::NoModifier);
|
||||
moveEventReceived = qApp->notify(tabWidget.getTabBar(), &moveEvent);
|
||||
QVERIFY(moveEventReceived);
|
||||
|
||||
|
@ -192,7 +192,7 @@ void KTabWidget_UnitTest::testMiddleClickTabReordering()
|
|||
QCOMPARE(tabWidget.widget(0), w1);
|
||||
QCOMPARE(tabWidget.widget(1), w0);
|
||||
|
||||
QTest::mouseRelease(tabWidget.getTabBar(), Qt::MidButton, Qt::NoModifier, pos1);
|
||||
QTest::mouseRelease(tabWidget.getTabBar(), Qt::MiddleButton, Qt::NoModifier, pos1);
|
||||
}
|
||||
|
||||
void KTabWidget_UnitTest::testTabMoved()
|
||||
|
|
|
@ -606,14 +606,14 @@ void tst_KToolBar::testClickingToolButton_data() {
|
|||
QTest::newRow("Control+Alt+LMB") << Qt::LeftButton << (Qt::ControlModifier | Qt::AltModifier);
|
||||
QTest::newRow("Shift+Control+Alt+LMB") << Qt::LeftButton << (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier);
|
||||
|
||||
QTest::newRow("MMB") << Qt::MidButton << Qt::KeyboardModifiers(Qt::NoModifier);
|
||||
QTest::newRow("Shift+MMB") << Qt::MidButton << Qt::KeyboardModifiers(Qt::ShiftModifier);
|
||||
QTest::newRow("Ctrl+MMB") << Qt::MidButton << Qt::KeyboardModifiers(Qt::ControlModifier);
|
||||
QTest::newRow("Alt+MMB") << Qt::MidButton << Qt::KeyboardModifiers(Qt::AltModifier);
|
||||
QTest::newRow("Shift+Control+MMB") << Qt::MidButton << (Qt::ShiftModifier | Qt::ControlModifier);
|
||||
QTest::newRow("Shift+Alt+MMB") << Qt::MidButton << (Qt::ShiftModifier | Qt::AltModifier);
|
||||
QTest::newRow("Control+Alt+MMB") << Qt::MidButton << (Qt::ControlModifier | Qt::AltModifier);
|
||||
QTest::newRow("Shift+Control+Alt+MMB") << Qt::MidButton << (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier);
|
||||
QTest::newRow("MMB") << Qt::MiddleButton << Qt::KeyboardModifiers(Qt::NoModifier);
|
||||
QTest::newRow("Shift+MMB") << Qt::MiddleButton << Qt::KeyboardModifiers(Qt::ShiftModifier);
|
||||
QTest::newRow("Ctrl+MMB") << Qt::MiddleButton << Qt::KeyboardModifiers(Qt::ControlModifier);
|
||||
QTest::newRow("Alt+MMB") << Qt::MiddleButton << Qt::KeyboardModifiers(Qt::AltModifier);
|
||||
QTest::newRow("Shift+Control+MMB") << Qt::MiddleButton << (Qt::ShiftModifier | Qt::ControlModifier);
|
||||
QTest::newRow("Shift+Alt+MMB") << Qt::MiddleButton << (Qt::ShiftModifier | Qt::AltModifier);
|
||||
QTest::newRow("Control+Alt+MMB") << Qt::MiddleButton << (Qt::ControlModifier | Qt::AltModifier);
|
||||
QTest::newRow("Shift+Control+Alt+MMB") << Qt::MiddleButton << (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier);
|
||||
}
|
||||
|
||||
void tst_KToolBar::testClickingToolButton() {
|
||||
|
|
|
@ -117,7 +117,7 @@ KModifierKeyInfoProvider::KModifierKeyInfoProvider()
|
|||
|
||||
// add known pointer buttons
|
||||
m_xkbButtons.insert(Qt::LeftButton, Button1Mask);
|
||||
m_xkbButtons.insert(Qt::MidButton, Button2Mask);
|
||||
m_xkbButtons.insert(Qt::MiddleButton, Button2Mask);
|
||||
m_xkbButtons.insert(Qt::RightButton, Button3Mask);
|
||||
m_xkbButtons.insert(Qt::XButton1, Button4Mask);
|
||||
m_xkbButtons.insert(Qt::XButton2, Button5Mask);
|
||||
|
|
|
@ -1105,7 +1105,7 @@ void KLineEdit::mouseDoubleClickEvent( QMouseEvent* e )
|
|||
void KLineEdit::mousePressEvent( QMouseEvent* e )
|
||||
{
|
||||
if ( (e->button() == Qt::LeftButton ||
|
||||
e->button() == Qt::MidButton ) &&
|
||||
e->button() == Qt::MiddleButton ) &&
|
||||
d->clearButton ) {
|
||||
d->clickInClear = ( d->clearButton == childAt(e->pos()) || d->clearButton->underMouse() );
|
||||
|
||||
|
@ -1122,7 +1122,7 @@ void KLineEdit::mousePressEvent( QMouseEvent* e )
|
|||
|
||||
// if middle clicking and if text is present in the clipboard then clear the selection
|
||||
// to prepare paste operation
|
||||
if ( e->button() == Qt::MidButton ) {
|
||||
if ( e->button() == Qt::MiddleButton ) {
|
||||
if ( hasSelectedText() && !isReadOnly() ) {
|
||||
if ( QApplication::clipboard()->text( QClipboard::Selection ).length() >0 ) {
|
||||
backspace();
|
||||
|
@ -1138,7 +1138,7 @@ void KLineEdit::mouseReleaseEvent( QMouseEvent* e )
|
|||
if ( d->clickInClear ) {
|
||||
if ( d->clearButton == childAt(e->pos()) || d->clearButton->underMouse() ) {
|
||||
QString newText;
|
||||
if ( e->button() == Qt::MidButton ) {
|
||||
if ( e->button() == Qt::MiddleButton ) {
|
||||
newText = QApplication::clipboard()->text( QClipboard::Selection );
|
||||
setText( newText );
|
||||
} else {
|
||||
|
|
|
@ -426,7 +426,7 @@ void KMenu::mousePressEvent(QMouseEvent* e)
|
|||
d->ctxMenu->hide();
|
||||
}
|
||||
|
||||
if( e->button() == Qt::MidButton)
|
||||
if( e->button() == Qt::MiddleButton)
|
||||
return;
|
||||
|
||||
QMenu::mousePressEvent(e);
|
||||
|
@ -438,7 +438,7 @@ void KMenu::mouseReleaseEvent(QMouseEvent* e)
|
|||
d->keyboardModifiers = e->modifiers();
|
||||
d->mouseButtons = e->buttons();
|
||||
|
||||
if ( e->button() == Qt::MidButton) {
|
||||
if ( e->button() == Qt::MiddleButton) {
|
||||
if(activeAction() ) {
|
||||
const QMetaObject *metaObject = activeAction()->metaObject();
|
||||
const int index = metaObject->indexOfMethod("triggered(Qt::MouseButtons,Qt::KeyboardModifiers)");
|
||||
|
|
|
@ -99,7 +99,7 @@ void KTabBar::mousePressEvent( QMouseEvent *event )
|
|||
emit emptyAreaContextMenu( mapToGlobal( event->pos() ) );
|
||||
}
|
||||
return;
|
||||
} else if (QTabBar::isMovable() && event->button() == Qt::MidButton) {
|
||||
} else if (QTabBar::isMovable() && event->button() == Qt::MiddleButton) {
|
||||
// compatibility feature for old middle mouse tab moving
|
||||
event->accept();
|
||||
QMouseEvent fakedMouseEvent(event->type(), event->pos(), Qt::LeftButton, Qt::LeftButton, event->modifiers());
|
||||
|
@ -127,7 +127,7 @@ void KTabBar::mouseMoveEvent( QMouseEvent *event )
|
|||
return;
|
||||
}
|
||||
}
|
||||
} else if ( event->buttons() == Qt::MidButton && !isMovable() ) {
|
||||
} else if ( event->buttons() == Qt::MiddleButton && !isMovable() ) {
|
||||
if ( d->mReorderStartTab == -1 ) {
|
||||
int delay = KGlobalSettings::dndEventDelay();
|
||||
QPoint newPos = event->pos();
|
||||
|
@ -155,7 +155,7 @@ void KTabBar::mouseMoveEvent( QMouseEvent *event )
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if ( event->button() == Qt::NoButton && event->buttons() == Qt::MidButton && isMovable() ) {
|
||||
} else if ( event->button() == Qt::NoButton && event->buttons() == Qt::MiddleButton && isMovable() ) {
|
||||
// compatibility feature for old middle mouse tab moving
|
||||
d->mMiddleMouseTabMoveInProgress = true;
|
||||
event->accept();
|
||||
|
@ -187,7 +187,7 @@ void KTabBar::mouseReleaseEvent( QMouseEvent *event )
|
|||
case Qt::LeftButton:
|
||||
break;
|
||||
|
||||
case Qt::MidButton:
|
||||
case Qt::MiddleButton:
|
||||
if (d->mMiddleMouseTabMoveInProgress && QTabBar::isMovable()) {
|
||||
// compatibility feature for old middle mouse tab moving
|
||||
d->mMiddleMouseTabMoveInProgress = false;
|
||||
|
|
|
@ -478,7 +478,7 @@ void KTabWidget::mousePressEvent( QMouseEvent *event )
|
|||
|
||||
void KTabWidget::mouseReleaseEvent( QMouseEvent *event )
|
||||
{
|
||||
if ( event->button() == Qt::MidButton ) {
|
||||
if ( event->button() == Qt::MiddleButton ) {
|
||||
if ( d->isEmptyTabbarSpace( event->pos() ) ) {
|
||||
emit( mouseMiddleClick() );
|
||||
return;
|
||||
|
|
|
@ -1239,7 +1239,7 @@ bool KToolBar::eventFilter(QObject * watched, QEvent * event)
|
|||
// Handle MMB on toolbar buttons
|
||||
if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) {
|
||||
QMouseEvent* me = static_cast<QMouseEvent*>(event);
|
||||
if (me->button() == Qt::MidButton /*&&
|
||||
if (me->button() == Qt::MiddleButton /*&&
|
||||
act->receivers(SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)))*/) {
|
||||
QAction* act = tbActions.first();
|
||||
if (me->type() == QEvent::MouseButtonPress)
|
||||
|
|
|
@ -120,7 +120,7 @@ void KUrlLabel::mouseReleaseEvent( QMouseEvent* event )
|
|||
emit leftClickedUrl( d->url );
|
||||
break;
|
||||
|
||||
case Qt::MidButton:
|
||||
case Qt::MiddleButton:
|
||||
emit middleClickedUrl();
|
||||
emit middleClickedUrl( d->url );
|
||||
break;
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
const QUrl url = hitTest.linkUrl();
|
||||
|
||||
if (!url.isEmpty()) {
|
||||
if ((pressedButtons & Qt::MidButton) ||
|
||||
if ((pressedButtons & Qt::MiddleButton) ||
|
||||
((pressedButtons & Qt::LeftButton) && (keyboardModifiers & Qt::ControlModifier))) {
|
||||
emit q->linkMiddleOrCtrlClicked(url);
|
||||
return true;
|
||||
|
@ -103,7 +103,7 @@ public:
|
|||
bool handleUrlPasteFromClipboard(QEvent* event)
|
||||
{
|
||||
QWebPage *page = q->page();
|
||||
if ((pressedButtons & Qt::MidButton) && page) {
|
||||
if ((pressedButtons & Qt::MiddleButton) && page) {
|
||||
|
||||
// WORKAROUND: Let the page handle the event first so that middle clicking
|
||||
// on scroll bars does not cause navigation to a url that might have been
|
||||
|
|
|
@ -410,7 +410,7 @@ void KUrlNavigator::Private::slotNavigatorButtonClicked(const KUrl& url, Qt::Mou
|
|||
{
|
||||
if (button & Qt::LeftButton) {
|
||||
q->setLocationUrl(url);
|
||||
} else if (button & Qt::MidButton) {
|
||||
} else if (button & Qt::MiddleButton) {
|
||||
emit q->tabRequested(url);
|
||||
}
|
||||
}
|
||||
|
@ -1092,7 +1092,7 @@ void KUrlNavigator::keyReleaseEvent(QKeyEvent* event)
|
|||
|
||||
void KUrlNavigator::mouseReleaseEvent(QMouseEvent* event)
|
||||
{
|
||||
if (event->button() == Qt::MidButton) {
|
||||
if (event->button() == Qt::MiddleButton) {
|
||||
const QRect bounds = d->m_toggleEditableMode->geometry();
|
||||
if (bounds.contains(event->pos())) {
|
||||
// The middle mouse button has been clicked above the
|
||||
|
|
|
@ -449,7 +449,7 @@ void KUrlNavigatorButton::slotMenuActionClicked(QAction* action)
|
|||
const int result = action->data().toInt();
|
||||
KUrl url = m_url;
|
||||
url.addPath(m_subDirs.at(result).first);
|
||||
emit clicked(url, Qt::MidButton);
|
||||
emit clicked(url, Qt::MiddleButton);
|
||||
}
|
||||
|
||||
void KUrlNavigatorButton::statFinished(KJob* job)
|
||||
|
|
|
@ -60,7 +60,7 @@ void KUrlNavigatorMenu::dropEvent(QDropEvent* event)
|
|||
|
||||
void KUrlNavigatorMenu::mouseReleaseEvent(QMouseEvent* event)
|
||||
{
|
||||
if (event->button() == Qt::MidButton) {
|
||||
if (event->button() == Qt::MiddleButton) {
|
||||
QAction* action = actionAt(event->pos());
|
||||
if (action != 0) {
|
||||
emit middleMouseButtonClicked(action);
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
m_selectedWidget = 0;
|
||||
m_bAllowNestedParts = false;
|
||||
m_bIgnoreScrollBars = false;
|
||||
m_activationButtonMask = Qt::LeftButton | Qt::MidButton | Qt::RightButton;
|
||||
m_activationButtonMask = Qt::LeftButton | Qt::MiddleButton | Qt::RightButton;
|
||||
m_reason = PartManager::NoReason;
|
||||
m_bIgnoreExplicitFocusRequest = false;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
QMouseEvent* mev = static_cast<QMouseEvent *>( ev );
|
||||
m_reason = mev->button() == Qt::LeftButton
|
||||
? PartManager::ReasonLeftClick
|
||||
: ( mev->button() == Qt::MidButton
|
||||
: ( mev->button() == Qt::MiddleButton
|
||||
? PartManager::ReasonMidClick
|
||||
: PartManager::ReasonRightClick );
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue