Skip to content

7 files changed

+285
-2
lines changed

debian/changelog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
qtbase-opensource-src (5.15.8-1+deepin7) UNRELEASED; urgency=medium
2+
3+
* Fix Clear WA_UnderMouse attribute when widget gets hidden
4+
-- QTBUG-104805-QColorDialog-Buttons-are-highlighted-incorrectly.patch
5+
* Fix the tips still show when cursor move to another action
6+
-- QTBUG-89082-The-previous-tips-is-still-displayed-when-mouse-move-to-another-Action-without-tips.patch
7+
* QMenu: toggle action submenu disappears immediately
8+
-- QMenu-toggle-action-submenu-disappears-immediately.patch
9+
* Fix QTextEdit or QPlanTextEdit palette not updated
10+
-- Fix-QTextEdit-or-QPlanTextEdit-palette-not-updated.patch
11+
* remove fix_action_distance_lineedit.patch, and allow styles to
12+
control the margin around icons in QLineEdit.
13+
14+
-- Tian ShiLin <[email protected]> Fri, 19 Apr 2024 10:28:01 +0800
15+
116
qtbase-opensource-src (5.15.8-1+deepin6) unstable; urgency=medium
217

318
* xcb: update xkb_state mask as much as possible
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
Author: Tian Shilin<[email protected]>
2+
Date: Thu May 16 11:05:24 2024
3+
Subject:Add setting the ICON size and margin attribute in lineedit
4+
upstream: https://codereview.qt-project.org/c/qt/qtbase/+/337970
5+
https://codereview.qt-project.org/c/qt/qtbase/+/363114
6+
7+
Remove _d_dtk_lineeditActionMargin、_d_dtk_lineeditActionWidth、
8+
_d_dtk_lineeditActionHeight.
9+
10+
When the font is large enough, using PM_SmallIconSize will get a large
11+
lineedit,but the icon is very small. This is very unsightly, and the
12+
style plug-in hopes to be able to define the size of the icon by itself.
13+
14+
The styles can't control the margin of the icon container, and its value
15+
is hardcoded to a quarter of the iconSize, which is very unfriendly.
16+
Add a PixelMetric enum value to allow styles to control the margin.
17+
18+
19+
Index: qtbase-opensource-src/src/widgets/styles/qcommonstyle.cpp
20+
===================================================================
21+
--- qtbase-opensource-src.orig/src/widgets/styles/qcommonstyle.cpp
22+
+++ qtbase-opensource-src/src/widgets/styles/qcommonstyle.cpp
23+
@@ -4847,7 +4847,12 @@ QT_WARNING_POP
24+
case PM_IconViewIconSize:
25+
ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget);
26+
break;
27+
-
28+
+ case PM_LineEditIconSize:
29+
+ ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget);
30+
+ break;
31+
+ case PM_LineEditIconMargin:
32+
+ ret = proxy()->pixelMetric(PM_LineEditIconSize, opt, widget) / 4;
33+
+ break;
34+
case PM_LargeIconSize:
35+
ret = int(QStyleHelper::dpiScaled(32, opt));
36+
break;
37+
Index: qtbase-opensource-src/src/widgets/styles/qfusionstyle.cpp
38+
===================================================================
39+
--- qtbase-opensource-src.orig/src/widgets/styles/qfusionstyle.cpp
40+
+++ qtbase-opensource-src/src/widgets/styles/qfusionstyle.cpp
41+
@@ -3045,6 +3045,9 @@ int QFusionStyle::pixelMetric(PixelMetri
42+
case PM_ListViewIconSize:
43+
val = 24;
44+
break;
45+
+ case PM_LineEditIconSize:
46+
+ val = 24;
47+
+ break;
48+
case PM_DialogButtonsSeparator:
49+
case PM_ScrollBarSliderMin:
50+
val = 26;
51+
Index: qtbase-opensource-src/src/widgets/styles/qstyle.cpp
52+
===================================================================
53+
--- qtbase-opensource-src.orig/src/widgets/styles/qstyle.cpp
54+
+++ qtbase-opensource-src/src/widgets/styles/qstyle.cpp
55+
@@ -1501,6 +1501,12 @@ void QStyle::drawItemPixmap(QPainter *pa
56+
\value PM_TitleBarButtonSize The size of buttons on a title bar.
57+
This enum value has been introduced in Qt 5.8.
58+
59+
+ \value PM_LineEditIconSize The default size for icons in a line edit.
60+
+ This enum value has been introduced in Qt 6.2.
61+
+
62+
+ \value PM_LineEditIconMargin The margin around icons in a line edit.
63+
+ This enum value has been introduced in Qt 6.3.
64+
+
65+
\value PM_CustomBase Base value for custom pixel metrics. Custom
66+
values must be greater than this value.
67+
68+
Index: qtbase-opensource-src/src/widgets/styles/qstyle.h
69+
===================================================================
70+
--- qtbase-opensource-src.orig/src/widgets/styles/qstyle.h
71+
+++ qtbase-opensource-src/src/widgets/styles/qstyle.h
72+
@@ -587,6 +587,9 @@ public:
73+
PM_TitleBarButtonIconSize,
74+
PM_TitleBarButtonSize,
75+
76+
+ PM_LineEditIconSize,
77+
+ PM_LineEditIconMargin,
78+
+
79+
// do not add any values below/greater than this
80+
PM_CustomBase = 0xf0000000
81+
};
82+
Index: qtbase-opensource-src/src/widgets/widgets/qlineedit_p.cpp
83+
===================================================================
84+
--- qtbase-opensource-src.orig/src/widgets/widgets/qlineedit_p.cpp
85+
+++ qtbase-opensource-src/src/widgets/widgets/qlineedit_p.cpp
86+
@@ -496,8 +496,8 @@ QLineEditPrivate::SideWidgetParameters Q
87+
{
88+
Q_Q(const QLineEdit);
89+
SideWidgetParameters result;
90+
- result.iconSize = q->style()->pixelMetric(QStyle::PM_SmallIconSize, nullptr, q);
91+
- result.margin = result.iconSize / 4;
92+
+ result.iconSize = q->style()->pixelMetric(QStyle::PM_LineEditIconSize, nullptr, q);
93+
+ result.margin = q->style()->pixelMetric(QStyle::PM_LineEditIconMargin, nullptr, q);
94+
result.widgetWidth = result.iconSize + 6;
95+
result.widgetHeight = result.iconSize + 2;
96+
return result;
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Author: Tian Shilin<[email protected]>
2+
Date: Fri Apr 19 10:20:24 2024
3+
Subject:Fix QTextEdit/QPlanTextEdit palette not updated
4+
Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/542094
5+
6+
QPlainTextEdit/QTextEdit, etc. never received ActivationChange
7+
when used as child widget. Set palette to control on
8+
WindowActivate/WindowDeactivate
9+
10+
11+
Index: qtbase-opensource-src/src/widgets/widgets/qplaintextedit.cpp
12+
===================================================================
13+
--- qtbase-opensource-src.orig/src/widgets/widgets/qplaintextedit.cpp
14+
+++ qtbase-opensource-src/src/widgets/widgets/qplaintextedit.cpp
15+
@@ -1601,6 +1601,8 @@ bool QPlainTextEdit::event(QEvent *e)
16+
return true;
17+
}
18+
#endif // QT_NO_GESTURES
19+
+ else if (e->type() == QEvent::WindowActivate || e->type() == QEvent::WindowDeactivate)
20+
+ d->control->setPalette(palette());
21+
return QAbstractScrollArea::event(e);
22+
}
23+
24+
Index: qtbase-opensource-src/src/widgets/widgets/qtextedit.cpp
25+
===================================================================
26+
--- qtbase-opensource-src.orig/src/widgets/widgets/qtextedit.cpp
27+
+++ qtbase-opensource-src/src/widgets/widgets/qtextedit.cpp
28+
@@ -1098,7 +1098,6 @@ bool QTextEdit::event(QEvent *e)
29+
#ifndef QT_NO_CONTEXTMENU
30+
if (e->type() == QEvent::ContextMenu
31+
&& static_cast<QContextMenuEvent *>(e)->reason() == QContextMenuEvent::Keyboard) {
32+
- Q_D(QTextEdit);
33+
ensureCursorVisible();
34+
const QPoint cursorPos = cursorRect().center();
35+
QContextMenuEvent ce(QContextMenuEvent::Keyboard, cursorPos, d->viewport->mapToGlobal(cursorPos));
36+
@@ -1106,19 +1105,18 @@ bool QTextEdit::event(QEvent *e)
37+
const bool result = QAbstractScrollArea::event(&ce);
38+
e->setAccepted(ce.isAccepted());
39+
return result;
40+
- } else if (e->type() == QEvent::ShortcutOverride
41+
- || e->type() == QEvent::ToolTip) {
42+
+ } else if (e->type() == QEvent::ShortcutOverride || e->type() == QEvent::ToolTip) {
43+
d->sendControlEvent(e);
44+
- }
45+
-#else
46+
- Q_UNUSED(d)
47+
+ } else
48+
#endif // QT_NO_CONTEXTMENU
49+
#ifdef QT_KEYPAD_NAVIGATION
50+
if (e->type() == QEvent::EnterEditFocus || e->type() == QEvent::LeaveEditFocus) {
51+
if (QApplicationPrivate::keypadNavigationEnabled())
52+
d->sendControlEvent(e);
53+
- }
54+
+ } else
55+
#endif
56+
+ if (e->type() == QEvent::WindowActivate || e->type() == QEvent::WindowDeactivate)
57+
+ d->control->setPalette(palette());
58+
return QAbstractScrollArea::event(e);
59+
}
60+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Author: Tian Shilin<[email protected]>
2+
Date: Fri Apr 19 10:20:24 2024
3+
Subject: QMenu: toggle action submenu disappears immediately
4+
Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/466589
5+
6+
When the submenu is popped up, the submenu should be collapsed
7+
immediately when the action is switched.
8+
9+
10+
Index: qtbase-opensource-src/src/widgets/widgets/qmenu.cpp
11+
===================================================================
12+
--- qtbase-opensource-src.orig/src/widgets/widgets/qmenu.cpp
13+
+++ qtbase-opensource-src/src/widgets/widgets/qmenu.cpp
14+
@@ -633,8 +633,12 @@ void QMenuPrivate::popupAction(QAction *
15+
q->internalDelayedPopup();
16+
else if (action->menu() && !action->menu()->isVisible())
17+
delayState.start(delay, action);
18+
- else if (!action->menu())
19+
+ else if (!action->menu()) {
20+
delayState.stop();
21+
+ if (activeMenu)
22+
+ hideMenu(activeMenu);
23+
+ }
24+
+
25+
if (activateFirst && action->menu())
26+
action->menu()->d_func()->setFirstActionActive();
27+
}
28+
Index: qtbase-opensource-src/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
29+
===================================================================
30+
--- qtbase-opensource-src.orig/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
31+
+++ qtbase-opensource-src/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
32+
@@ -1207,7 +1207,6 @@ void tst_QMenu::click_while_dismissing_s
33+
menu.show();
34+
QSignalSpy spy(action, &QAction::triggered);
35+
QSignalSpy menuShownSpy(&sub, &QMenu::aboutToShow);
36+
- QSignalSpy menuHiddenSpy(&sub, &QMenu::aboutToHide);
37+
QVERIFY(QTest::qWaitForWindowExposed(&menu));
38+
QWindow *menuWindow = menu.windowHandle();
39+
QVERIFY(menuWindow);
40+
@@ -1218,7 +1217,6 @@ void tst_QMenu::click_while_dismissing_s
41+
#ifdef Q_OS_WINRT
42+
QEXPECT_FAIL("", "WinRT does not support QTest::mouseMove", Abort);
43+
#endif
44+
- QVERIFY(menuShownSpy.wait());
45+
QVERIFY(sub.isVisible());
46+
QVERIFY(QTest::qWaitForWindowExposed(&sub));
47+
//press over the submenu entry
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Author: Tian Shilin<[email protected]>
2+
Date: Fri Apr 19 10:20:24 2024
3+
Subject: QDialog buttons are highlighted incorrectly
4+
Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/431809
5+
6+
This patch clears WA_UnderMouse attribute in widget hideChildren() and
7+
subsequently, widgets that are hidden will not inherit this attribute
8+
on the next show operation. To test flag Qt::X11BypassWindowManagerHint
9+
is needed when is_closing=0(e.g. Closing DDialog by Cancel or Ok Bt).
10+
11+
12+
Index: qtbase-opensource-src/src/widgets/kernel/qwidget.cpp
13+
===================================================================
14+
--- qtbase-opensource-src.orig/src/widgets/kernel/qwidget.cpp
15+
+++ qtbase-opensource-src/src/widgets/kernel/qwidget.cpp
16+
@@ -8212,6 +8212,7 @@ void QWidgetPrivate::showChildren(bool s
17+
18+
void QWidgetPrivate::hideChildren(bool spontaneous)
19+
{
20+
+ Q_Q(QWidget);
21+
QList<QObject*> childList = children;
22+
for (int i = 0; i < childList.size(); ++i) {
23+
QWidget *widget = qobject_cast<QWidget*>(childList.at(i));
24+
@@ -8243,6 +8244,14 @@ void QWidgetPrivate::hideChildren(bool s
25+
}
26+
#endif
27+
}
28+
+
29+
+ // If the window of this widget is not closed, then the leave event
30+
+ // will eventually handle the widget under mouse use case.
31+
+ // Otherwise, we need to explicitly handle it here.
32+
+ if (QWidget* widgetWindow = q->window();
33+
+ widgetWindow && widgetWindow->data->is_closing) {
34+
+ q->setAttribute(Qt::WA_UnderMouse, false);
35+
+ }
36+
}
37+
38+
bool QWidgetPrivate::close_helper(CloseMode mode)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Author: Tian Shilin<[email protected]>
2+
Date: Fri Apr 19 10:20:24 2024
3+
Subject: Fix the tips still show when cursor move to another action
4+
Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/325086
5+
6+
In this case, the previous action's tip is still displayed
7+
when the cursor moves from one action with tip to another action
8+
without tip.
9+
10+
11+
Index: qtbase-opensource-src/src/widgets/widgets/qmenu.cpp
12+
===================================================================
13+
--- qtbase-opensource-src.orig/src/widgets/widgets/qmenu.cpp
14+
+++ qtbase-opensource-src/src/widgets/widgets/qmenu.cpp
15+
@@ -3069,6 +3069,8 @@ QMenu::event(QEvent *e)
16+
const QString toolTip = action->d_func()->tooltip;
17+
if (!toolTip.isEmpty())
18+
QToolTip::showText(ev->globalPos(), toolTip, this);
19+
+ else
20+
+ QToolTip::hideText();
21+
return true;
22+
}
23+
}

debian/patches/series

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ revert_startBlocking_removal.diff
2727
0009-fix_qss_border_cap_style.patch
2828
fix_qrasterpaintengine_rect_for_hidpi.patch
2929
dnot_add_application_path_to_library_path_for_default.patch
30-
fix_action_distance_lineedit.patch
30+
#fix_action_distance_lineedit.patch
3131
add-sunway-support.patch
3232
QTBUG-85978-85985-QLineEdit-Fix-the-problem-under-the-touch-screen.patch
3333
QTBUG-85088-QGraphicsView-show-error-after-lose-focus.patch
@@ -36,7 +36,7 @@ remove-the-X11-True-and-False.patch
3636
feat-touch-screen-QListView-sliding-acceleration.patch
3737
fix-QDoubleSpinbox-and-QSpinbox-not-change-value-when-mouse-scroll.patch
3838
fix-_NET_SUPPORTED-attribute-cannot-be-updated.patch
39-
add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch
39+
Add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch
4040
QTBUG-92468-fix-qtextedit-cursor-drawn-incorrectly.patch
4141
QTBUG-92460-don-use-large-icons-in-qlineedit.patch
4242
QTBUG-92366-Check-scrollbar-visibility-when-computing-QListView-Margins.patch
@@ -68,3 +68,7 @@ QTBUG-117950-Fix-XKB_KEY_dead_lowlin
6868
QTBUG-86285-Fix-kills-all-user-processes
6969
loongarch.diff
7070
Update-xkb-state-mask-as-much-as-possible.patch
71+
QTBUG-104805-QColorDialog-Buttons-are-highlighted-incorrectly.patch
72+
QTBUG-89082-The-previous-tips-is-still-displayed-when-mouse-move-to-another-Action-without-tips.patch
73+
QMenu-toggle-action-submenu-disappears-immediately.patch
74+
Fix-QTextEdit-or-QPlanTextEdit-palette-not-updated.patch

0 commit comments

Comments
 (0)