From 24226bb5f595581a239356c18a338783a85349ca Mon Sep 17 00:00:00 2001 From: Tang Haixiang Date: Mon, 8 Mar 2021 19:49:44 +0800 Subject: Add setting the ICON size attribute in lineedit to the style plugin When the font is large enough, using PM_SmallIconSize will get a large lineedit,but the icon is very small. This is very unsightly, and the style plug-in hopes to be able to define the size of the icon by itself. Change-Id: I0e35b331301472541d3378e748dbcd074d5419a2 Reviewed-by: Volker Hilsheimer --- src/widgets/widgets/qlineedit_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/widgets/qlineedit_p.cpp') diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 4143b848b5..7526379f3c 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -495,7 +495,7 @@ QLineEditPrivate::SideWidgetParameters QLineEditPrivate::sideWidgetParameters() { Q_Q(const QLineEdit); SideWidgetParameters result; - result.iconSize = q->style()->pixelMetric(QStyle::PM_SmallIconSize, nullptr, q); + result.iconSize = q->style()->pixelMetric(QStyle::PM_LineEditIconSize, nullptr, q); result.margin = result.iconSize / 4; result.widgetWidth = result.iconSize + 6; result.widgetHeight = result.iconSize + 2; -- cgit v1.2.3