plus petit clavier

This commit is contained in:
florian 2025-09-02 15:25:37 +02:00
parent f388e5e488
commit cd6c661b28

View File

@ -135,7 +135,7 @@ void VirtualKeyboard::setupNumericKeys()
for (const QString& key : m_numericLayout) { for (const QString& key : m_numericLayout) {
QPushButton* button = new QPushButton(key); QPushButton* button = new QPushButton(key);
button->setObjectName("numericKey"); button->setObjectName("numericKey");
button->setFixedSize(100, 100); button->setFixedSize(60, 60);
connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed); connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed);
m_numericKeys.append(button); m_numericKeys.append(button);
numericLayout->addWidget(button); numericLayout->addWidget(button);
@ -146,7 +146,7 @@ void VirtualKeyboard::setupNumericKeys()
for (const QString& key : specialChars) { for (const QString& key : specialChars) {
QPushButton* button = new QPushButton(key); QPushButton* button = new QPushButton(key);
button->setObjectName("specialKey"); button->setObjectName("specialKey");
button->setFixedSize(100, 100); button->setFixedSize(60, 60);
connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed); connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed);
numericLayout->addWidget(button); numericLayout->addWidget(button);
} }
@ -165,7 +165,7 @@ void VirtualKeyboard::setupAlphabeticKeys()
for (int i = 0; i < 10; ++i) { for (int i = 0; i < 10; ++i) {
QPushButton* button = new QPushButton(m_qwertyLayout[i]); QPushButton* button = new QPushButton(m_qwertyLayout[i]);
button->setObjectName("alphabeticKey"); button->setObjectName("alphabeticKey");
button->setFixedSize(100, 100); button->setFixedSize(60, 60);
connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed); connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed);
m_alphabeticKeys.append(button); m_alphabeticKeys.append(button);
firstRow->addWidget(button); firstRow->addWidget(button);
@ -182,7 +182,7 @@ void VirtualKeyboard::setupAlphabeticKeys()
for (int i = 10; i < 19; ++i) { for (int i = 10; i < 19; ++i) {
QPushButton* button = new QPushButton(m_qwertyLayout[i]); QPushButton* button = new QPushButton(m_qwertyLayout[i]);
button->setObjectName("alphabeticKey"); button->setObjectName("alphabeticKey");
button->setFixedSize(100, 100); button->setFixedSize(60, 60);
connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed); connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed);
m_alphabeticKeys.append(button); m_alphabeticKeys.append(button);
secondRow->addWidget(button); secondRow->addWidget(button);
@ -199,7 +199,7 @@ void VirtualKeyboard::setupAlphabeticKeys()
// Shift button // Shift button
m_shiftButton = new QPushButton(""); m_shiftButton = new QPushButton("");
m_shiftButton->setObjectName("functionKey"); m_shiftButton->setObjectName("functionKey");
m_shiftButton->setFixedSize(120, 100); m_shiftButton->setFixedSize(80, 60);
m_shiftButton->setCheckable(true); m_shiftButton->setCheckable(true);
connect(m_shiftButton, &QPushButton::clicked, this, &VirtualKeyboard::onShiftPressed); connect(m_shiftButton, &QPushButton::clicked, this, &VirtualKeyboard::onShiftPressed);
thirdRow->addWidget(m_shiftButton); thirdRow->addWidget(m_shiftButton);
@ -207,7 +207,7 @@ void VirtualKeyboard::setupAlphabeticKeys()
for (int i = 19; i < 26; ++i) { for (int i = 19; i < 26; ++i) {
QPushButton* button = new QPushButton(m_qwertyLayout[i]); QPushButton* button = new QPushButton(m_qwertyLayout[i]);
button->setObjectName("alphabeticKey"); button->setObjectName("alphabeticKey");
button->setFixedSize(100, 100); button->setFixedSize(60, 60);
connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed); connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed);
m_alphabeticKeys.append(button); m_alphabeticKeys.append(button);
thirdRow->addWidget(button); thirdRow->addWidget(button);
@ -216,7 +216,7 @@ void VirtualKeyboard::setupAlphabeticKeys()
// Backspace button // Backspace button
m_backspaceButton = new QPushButton(""); m_backspaceButton = new QPushButton("");
m_backspaceButton->setObjectName("functionKey"); m_backspaceButton->setObjectName("functionKey");
m_backspaceButton->setFixedSize(120, 100); m_backspaceButton->setFixedSize(80, 60);
connect(m_backspaceButton, &QPushButton::clicked, this, &VirtualKeyboard::onBackspacePressed); connect(m_backspaceButton, &QPushButton::clicked, this, &VirtualKeyboard::onBackspacePressed);
thirdRow->addWidget(m_backspaceButton); thirdRow->addWidget(m_backspaceButton);
@ -233,7 +233,7 @@ void VirtualKeyboard::setupFunctionKeys()
// Caps Lock // Caps Lock
m_capsLockButton = new QPushButton("Caps"); m_capsLockButton = new QPushButton("Caps");
m_capsLockButton->setObjectName("functionKey"); m_capsLockButton->setObjectName("functionKey");
m_capsLockButton->setFixedSize(150, 100); m_capsLockButton->setFixedSize(80, 60);
m_capsLockButton->setCheckable(true); m_capsLockButton->setCheckable(true);
connect(m_capsLockButton, &QPushButton::clicked, this, &VirtualKeyboard::onCapsLockPressed); connect(m_capsLockButton, &QPushButton::clicked, this, &VirtualKeyboard::onCapsLockPressed);
m_functionLayout->addWidget(m_capsLockButton); m_functionLayout->addWidget(m_capsLockButton);
@ -241,14 +241,14 @@ void VirtualKeyboard::setupFunctionKeys()
// Space bar // Space bar
m_spaceButton = new QPushButton("Espace"); m_spaceButton = new QPushButton("Espace");
m_spaceButton->setObjectName("spaceKey"); m_spaceButton->setObjectName("spaceKey");
m_spaceButton->setFixedSize(500, 100); m_spaceButton->setFixedSize(240, 60);
connect(m_spaceButton, &QPushButton::clicked, this, &VirtualKeyboard::onSpacePressed); connect(m_spaceButton, &QPushButton::clicked, this, &VirtualKeyboard::onSpacePressed);
m_functionLayout->addWidget(m_spaceButton); m_functionLayout->addWidget(m_spaceButton);
// Enter // Enter
m_enterButton = new QPushButton(""); m_enterButton = new QPushButton("");
m_enterButton->setObjectName("functionKey"); m_enterButton->setObjectName("functionKey");
m_enterButton->setFixedSize(150, 100); m_enterButton->setFixedSize(80, 60);
connect(m_enterButton, &QPushButton::clicked, this, &VirtualKeyboard::onEnterPressed); connect(m_enterButton, &QPushButton::clicked, this, &VirtualKeyboard::onEnterPressed);
m_functionLayout->addWidget(m_enterButton); m_functionLayout->addWidget(m_enterButton);
@ -257,7 +257,7 @@ void VirtualKeyboard::setupFunctionKeys()
for (const QString& key : punctuation) { for (const QString& key : punctuation) {
QPushButton* button = new QPushButton(key); QPushButton* button = new QPushButton(key);
button->setObjectName("punctuationKey"); button->setObjectName("punctuationKey");
button->setFixedSize(100, 100); button->setFixedSize(60, 60);
connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed); connect(button, &QPushButton::clicked, this, &VirtualKeyboard::onKeyPressed);
m_functionLayout->addWidget(button); m_functionLayout->addWidget(button);
} }