代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/qt5-qtbase 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From: zhanghao <zhanghao@uniontech.com>
Date: Tue Jan 12 10:36:47 2021 +0800
Subject: Fix QComboBox popup menu will hide when press arrow button more than double click time.
---
Index: qtbase-opensource-src-5.11/src/widgets/widgets/qcombobox.cpp
===================================================================
--- qtbase-opensource-src-5.11.orig/src/widgets/widgets/qcombobox.cpp
+++ qtbase-opensource-src-5.11/src/widgets/widgets/qcombobox.cpp
@@ -744,6 +744,8 @@ bool QComboBoxPrivateContainer::eventFil
if (indexUnderMouse.isValid()
&& !QComboBoxDelegate::isSeparator(indexUnderMouse)) {
view->setCurrentIndex(indexUnderMouse);
+ if(maybeIgnoreMouseButtonRelease)
+ maybeIgnoreMouseButtonRelease = false;
}
}
break;
@@ -751,11 +753,9 @@ bool QComboBoxPrivateContainer::eventFil
maybeIgnoreMouseButtonRelease = false;
break;
case QEvent::MouseButtonRelease: {
- bool ignoreEvent = maybeIgnoreMouseButtonRelease && popupTimer.elapsed() < QApplication::doubleClickInterval();
-
QMouseEvent *m = static_cast<QMouseEvent *>(e);
if (isVisible() && view->rect().contains(m->pos()) && view->currentIndex().isValid()
- && !blockMouseReleaseTimer.isActive() && !ignoreEvent
+ && !blockMouseReleaseTimer.isActive() && !maybeIgnoreMouseButtonRelease
&& (view->currentIndex().flags() & Qt::ItemIsEnabled)
&& (view->currentIndex().flags() & Qt::ItemIsSelectable)) {
combo->hidePopup();
@@ -806,7 +806,8 @@ void QComboBoxPrivateContainer::mousePre
void QComboBoxPrivateContainer::mouseReleaseEvent(QMouseEvent *e)
{
Q_UNUSED(e);
- if (!blockMouseReleaseTimer.isActive()){
+ bool ignoreEvent = popupTimer.elapsed() > QApplication::doubleClickInterval();
+ if (!blockMouseReleaseTimer.isActive() && !ignoreEvent) {
combo->hidePopup();
emit resetButton();
}
@@ -2848,7 +2849,7 @@ void QComboBox::showPopup()
#endif
if (startTimer) {
container->popupTimer.start();
- container->maybeIgnoreMouseButtonRelease = true;
+ container->maybeIgnoreMouseButtonRelease = usePopup;
}
}
@@ -3161,13 +3161,6 @@ void QComboBoxPrivate::showPopupFromMouseEvent(QMouseEvent *e)
}
#endif
q->showPopup();
- // The code below ensures that regular mousepress and pick item still works
- // If it was not called the viewContainer would ignore event since it didn't have
- // a mousePressEvent first.
- if (viewContainer()) {
- viewContainer()->blockMouseReleaseTimer.start(QApplication::doubleClickInterval());
- viewContainer()->maybeIgnoreMouseButtonRelease = false;
- }
} else {
#ifdef QT_KEYPAD_NAVIGATION
if (QApplication::keypadNavigationEnabled() && sc == QStyle::SC_ComboBoxEditField && lineEdit) {
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。