1 Star 0 Fork 19

Funda Wang/qt5-qtbase

forked from src-anolis-os/qt5-qtbase 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001_fix_action_distance_lineedit.patch 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
xingwei-liu 提交于 2022-10-13 02:47 . !8 feature: add patchs for DDE
From 53a442d3bf09cfa89ad51873bf49765991a55e6e Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Mon, 4 Jul 2022 17:52:50 +0800
Subject: [PATCH] 0001_fix_action_distance_lineedit
---
src/widgets/widgets/qlineedit_p.cpp | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index b854d9d2..413f1a44 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -489,9 +489,24 @@ QLineEditPrivate::SideWidgetParameters QLineEditPrivate::sideWidgetParameters()
Q_Q(const QLineEdit);
SideWidgetParameters result;
result.iconSize = q->style()->pixelMetric(QStyle::PM_SmallIconSize, nullptr, q);
- result.margin = result.iconSize / 4;
- result.widgetWidth = result.iconSize + 6;
- result.widgetHeight = result.iconSize + 2;
+ bool ok = true;
+ int margin = q->property("_d_dtk_lineeditActionMargin").toInt(&ok);
+
+ if (!ok)
+ margin = result.iconSize / 4;
+ int widgetWidth = q->property("_d_dtk_lineeditActionWidth").toInt(&ok);
+
+ if (!ok)
+ widgetWidth = 6;
+ int widgetHeight = q->property("_d_dtk_lineeditActionHeight").toInt(&ok);
+
+ if (!ok)
+ widgetHeight = 2;
+
+ result.margin = margin;
+ result.widgetWidth = result.iconSize + widgetWidth;
+ result.widgetHeight = result.iconSize + widgetHeight;
+
return result;
}
--
2.31.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fundawang/qt5-qtbase.git
git@gitee.com:fundawang/qt5-qtbase.git
fundawang
qt5-qtbase
qt5-qtbase
a8

搜索帮助