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);