mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-21 22:13:45 +08:00
keyboard.cc: get value by reference in ranged based loop (#19950)
This commit is contained in:
@@ -17,14 +17,14 @@ KeyboardLayout::KeyboardLayout(QWidget *parent, std::vector<QVector<QString>> la
|
||||
QObject::connect(btn_group, SIGNAL(buttonClicked(QAbstractButton*)), parent, SLOT(handleButton(QAbstractButton*)));
|
||||
|
||||
int i = 0;
|
||||
for (auto s : layout) {
|
||||
for (const auto &s : layout) {
|
||||
QHBoxLayout *hlayout = new QHBoxLayout;
|
||||
|
||||
if (i == 1) {
|
||||
hlayout->addSpacing(90);
|
||||
}
|
||||
|
||||
for (QString p : s) {
|
||||
for (const QString &p : s) {
|
||||
QPushButton* btn = new QPushButton(p);
|
||||
btn->setFixedHeight(120);
|
||||
btn_group->addButton(btn);
|
||||
|
||||
Reference in New Issue
Block a user