Skip to content

Commit e30bcde

Browse files
committed
refactor(password-line-edit: 重构密码输入框组件,统一代码风格并完善功能
1. 重构PasswordLineEdit内部实现,替换QScopedPointer为std::unique_ptr,重命名内部成员变量与方法提升可读性 2. 新增密码可见性属性与信号,统一显示隐藏按钮的状态同步 3. 重写CapsLock警告逻辑,优化提示框的显示与隐藏流程 4. 简化多个示例项目的冗余代码:移除多余的setAlignment、addStretch调用,统一代码结构 5. 重构Quick版本密码输入示例,优化UI布局与代码组织,统一使用现代C++语法与Qt字符串字面量
1 parent 24a5e01 commit e30bcde

11 files changed

Lines changed: 481 additions & 507 deletions

File tree

src/AutoStartManager/mainwindow.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
8080
QHBoxLayout *buttonLayout = new QHBoxLayout();
8181
QPushButton *refreshButton = new QPushButton(u"Refresh Status"_s, this);
8282
buttonLayout->addWidget(refreshButton);
83-
buttonLayout->addStretch();
8483

8584
QPushButton *aboutButton = new QPushButton(u"About"_s, this);
8685
buttonLayout->addWidget(aboutButton);
@@ -97,8 +96,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
9796
infoLabel->setWordWrap(true);
9897
mainLayout->addWidget(infoLabel);
9998

100-
mainLayout->addStretch();
101-
10299
setWindowTitle(u"Auto-start Example"_s);
103100
resize(550, 250);
104101

src/CircularProgress/mainwindow.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
8484
// 右侧:控制面板
8585
auto *controlPanel = new QWidget(this);
8686
auto *controlLayout = new QVBoxLayout(controlPanel);
87-
controlLayout->setAlignment(Qt::AlignTop);
8887

8988
// 数值控制布局
9089
auto *valueGroup = new QGroupBox(tr("Value settings"), this);

src/Clock/mainwindow.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
5151
// 右侧:控制面板
5252
auto *controlPanel = new QWidget(this);
5353
auto *controlLayout = new QVBoxLayout(controlPanel);
54-
controlLayout->setAlignment(Qt::AlignTop);
5554

5655
// 颜色控制布局
5756
auto *colorGroup = new QGroupBox(tr("Color settings"), this);

src/DashBoard/mainwindow.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
100100
// 右侧:控制面板
101101
auto *controlPanel = new QWidget(this);
102102
auto *controlLayout = new QVBoxLayout(controlPanel);
103-
controlLayout->setAlignment(Qt::AlignTop);
104103

105104
// 数值控制布局
106105
auto *valueGroup = new QGroupBox(tr("Value settings"), this);

src/LoadingIndicator/mainwindow.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
100100
// 右侧: 控制面板
101101
auto *controlPanel = new QWidget(this);
102102
auto *controlLayout = new QVBoxLayout(controlPanel);
103-
controlLayout->setAlignment(Qt::AlignTop);
104103

105104
// 动画设置组
106105
auto *animationGroup = new QGroupBox(tr("Animation settings"), this);
@@ -128,7 +127,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
128127
auto *autoHideRow = new QHBoxLayout();
129128
autoHideRow->addWidget(autoHideCheckbox);
130129
autoHideRow->addWidget(durationSpinBox);
131-
autoHideRow->addStretch();
132130
textGroupLayout->addLayout(autoHideRow);
133131

134132
controlLayout->addWidget(textGroup);

0 commit comments

Comments
 (0)