From 03b053bcc0d1f568b98639551592f07c9bfcb5bb Mon Sep 17 00:00:00 2001 From: momen Date: Mon, 7 Jul 2025 05:29:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=90=9C=E7=B4=A2=E6=A1=86=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=8F=90=E7=A4=BA=E5=AD=97=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mainwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index afd7d9b..54f064c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -66,6 +66,9 @@ MainWindow::MainWindow(QWidget *parent) filterAppsByKeyword(keyword); }); initStyle(); + + // 确保搜索框内容为空,placeholder 能显示 + ui->searchPlainTextEdit->clear(); }); // 启动异步任务 @@ -91,6 +94,9 @@ void MainWindow::initStyle() line-height: 1.4; color: #9CA3AF; } + QPlainTextEdit[placeholderText]:empty { + color: #9CA3AF; + } )"); ui->searchPlainTextEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);