diff options
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 05724e3d92..3125e001d9 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -780,10 +780,10 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e) if (isVisible()) { QMouseEvent *m = static_cast<QMouseEvent *>(e); QWidget *widget = static_cast<QWidget *>(o); - QPoint vector = widget->mapToGlobal(m->pos()) - initialClickPosition; + QPoint vector = widget->mapToGlobal(m->position().toPoint()) - initialClickPosition; if (vector.manhattanLength() > 9 && blockMouseReleaseTimer.isActive()) blockMouseReleaseTimer.stop(); - QModelIndex indexUnderMouse = view->indexAt(m->pos()); + QModelIndex indexUnderMouse = view->indexAt(m->position().toPoint()); if (indexUnderMouse.isValid() && !QComboBoxDelegate::isSeparator(indexUnderMouse)) { view->setCurrentIndex(indexUnderMouse); @@ -797,7 +797,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e) bool ignoreEvent = maybeIgnoreMouseButtonRelease && popupTimer.elapsed() < QApplication::doubleClickInterval(); QMouseEvent *m = static_cast<QMouseEvent *>(e); - if (isVisible() && view->rect().contains(m->pos()) && view->currentIndex().isValid() + if (isVisible() && view->rect().contains(m->position().toPoint()) && view->currentIndex().isValid() && !blockMouseReleaseTimer.isActive() && !ignoreEvent && (view->currentIndex().flags() & Qt::ItemIsEnabled) && (view->currentIndex().flags() & Qt::ItemIsSelectable)) { @@ -838,7 +838,7 @@ void QComboBoxPrivateContainer::mousePressEvent(QMouseEvent *e) opt.subControls = QStyle::SC_All; opt.activeSubControls = QStyle::SC_ComboBoxArrow; QStyle::SubControl sc = combo->style()->hitTestComplexControl(QStyle::CC_ComboBox, &opt, - combo->mapFromGlobal(e->globalPos()), + combo->mapFromGlobal(e->globalPosition().toPoint()), combo); if ((combo->isEditable() && sc == QStyle::SC_ComboBoxArrow) || (!combo->isEditable() && sc != QStyle::SC_None)) @@ -3072,7 +3072,7 @@ bool QComboBox::event(QEvent *event) case QEvent::HoverLeave: case QEvent::HoverMove: if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event)) - d->updateHoverControl(he->pos()); + d->updateHoverControl(he->position().toPoint()); break; case QEvent::ShortcutOverride: if (d->lineEdit) @@ -3111,7 +3111,7 @@ void QComboBoxPrivate::showPopupFromMouseEvent(QMouseEvent *e) Q_Q(QComboBox); QStyleOptionComboBox opt; q->initStyleOption(&opt); - QStyle::SubControl sc = q->style()->hitTestComplexControl(QStyle::CC_ComboBox, &opt, e->pos(), q); + QStyle::SubControl sc = q->style()->hitTestComplexControl(QStyle::CC_ComboBox, &opt, e->position().toPoint(), q); if (e->button() == Qt::LeftButton && !(sc == QStyle::SC_None && e->type() == QEvent::MouseButtonRelease) @@ -3127,7 +3127,7 @@ void QComboBoxPrivate::showPopupFromMouseEvent(QMouseEvent *e) #endif // We've restricted the next couple of lines, because by not calling // viewContainer(), we avoid creating the QComboBoxPrivateContainer. - viewContainer()->initialClickPosition = q->mapToGlobal(e->pos()); + viewContainer()->initialClickPosition = q->mapToGlobal(e->position().toPoint()); } q->showPopup(); // The code below ensures that regular mousepress and pick item still works |