1 Star 0 Fork 19

songkai/qt5-qtbase

forked from src-anolis-os/qt5-qtbase 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
QTBUG008-89578-QLineEdit-cursor-show-white-area-when-set-inputMask.patch 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
xingwei-liu 提交于 2022-10-13 02:47 . !8 feature: add patchs for DDE
From bd7da753fe76bbe8ce55d2bdc9b9c765b957f6f9 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Tue, 5 Jul 2022 09:48:04 +0800
Subject: [PATCH]
QTBUG008-89578-QLineEdit-cursor-show-white-area-when-set-inputMask
---
src/widgets/widgets/qlineedit.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index d568a1e0..70d27b58 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -2128,9 +2128,12 @@ void QLineEdit::paintEvent(QPaintEvent *)
// Asian users see an IM selection text as cursor on candidate
// selection phase of input method, so the ordinary cursor should be
- // invisible if we have a preedit string.
- if (d->cursorVisible && !d->control->isReadOnly())
+ // invisible if we have a preedit string. another condition is when inputmask
+ // isn't empty,we don't need draw cursor,because cursor and character overlaping
+ // area is white.
+ if (d->cursorVisible && !d->control->isReadOnly() && d->control->inputMask().isEmpty())
flags |= QWidgetLineControl::DrawCursor;
+
d->control->setCursorWidth(style()->pixelMetric(QStyle::PM_TextCursorWidth, &panel));
d->control->draw(&p, topLeft, r, flags);
--
2.31.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/songkai01/qt5-qtbase.git
git@gitee.com:songkai01/qt5-qtbase.git
songkai01
qt5-qtbase
qt5-qtbase
a8

搜索帮助