MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / setupUi

Method setupUi

App/Client/VirtualKeyboardSettingsDialog.cpp:36–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void CVirtualKeyboardSettingsDialog::setupUi()
37{
38 QVBoxLayout *mainLayout = new QVBoxLayout(this);
39
40 // ===== 语言设置组 =====
41 QGroupBox *languageGroup = new QGroupBox(tr("输入语言"), this);
42 QVBoxLayout *languageLayout = new QVBoxLayout(languageGroup);
43
44 m_languageCombo = new QComboBox(this);
45 m_localeList = getAvailableLocales();
46
47 // 填充语言下拉框
48 for (const QString &locale : m_localeList) {
49 QLocale loc(locale);
50 QString displayName = QString("%1 (%2)")
51 .arg(loc.nativeLanguageName())
52 .arg(loc.nativeCountryName());
53 m_languageCombo->addItem(displayName, locale);
54 }
55
56 languageLayout->addWidget(new QLabel(tr("选择输入语言:"), this));
57 languageLayout->addWidget(m_languageCombo);
58 languageLayout->addStretch();
59
60 // ===== 外观设置组 =====
61 QGroupBox *appearanceGroup = new QGroupBox(tr("外观设置"), this);
62 QVBoxLayout *appearanceLayout = new QVBoxLayout(appearanceGroup);
63
64 // 主题选择
65 QHBoxLayout *themeLayout = new QHBoxLayout();
66 themeLayout->addWidget(new QLabel(tr("键盘主题:"), this));
67 m_themeCombo = new QComboBox(this);
68 QStringList themes = getAvailableStyles();
69 themes.prepend("默认"); // 添加默认主题选项
70 m_themeCombo->addItems(themes);
71 themeLayout->addWidget(m_themeCombo);
72 themeLayout->addStretch();
73 appearanceLayout->addLayout(themeLayout);
74
75 // 按键大小调节
76 QHBoxLayout *keySizeLayout = new QHBoxLayout();
77 keySizeLayout->addWidget(new QLabel(tr("按键大小:"), this));
78 m_keySizeSlider = new QSlider(Qt::Horizontal, this);
79 m_keySizeSlider->setRange(50, 150);
80 m_keySizeSlider->setValue(100);
81 m_keySizeSlider->setTickPosition(QSlider::TicksBelow);
82 m_keySizeSlider->setTickInterval(10);
83 keySizeLayout->addWidget(m_keySizeSlider, 1);
84
85 m_keySizeLabel = new QLabel("100%", this);
86 keySizeLayout->addWidget(m_keySizeLabel);
87 appearanceLayout->addLayout(keySizeLayout);
88
89 // 连接滑块信号更新百分比显示
90 connect(m_keySizeSlider, &QSlider::valueChanged, [this](int value) {
91 m_keySizeLabel->setText(QString("%1%").arg(value));
92 });
93

Callers 15

CMainWindowMethod · 0.80
CParameterDlgSettingsMethod · 0.80
CFrmFullScreenToolBarMethod · 0.80
Q_LOGGING_CATEGORYFunction · 0.80
CDlgInputPasswordMethod · 0.80
CFrmManagePluginsMethod · 0.80
CParameterTerminalUIMethod · 0.80
CFrmParameterICEMethod · 0.80
CParameterDatabaseUIMethod · 0.80
CParameterRecordUIMethod · 0.80
CParameterSSHTunnelUIMethod · 0.80
CParameterPluginUIMethod · 0.80

Calls 1

addItemMethod · 0.80

Tested by

no test coverage detected