- QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_1 + i), this);
- connect(shortcut, &QShortcut::activated, bind(&MainWindow::channel_clicked, this, i));
+ QShortcut *shortcut = nullptr;
+ if (i < 9) {
+ shortcut = new QShortcut(QKeySequence(Qt::Key_1 + i), this);
+ } else if (i == 9) {
+ shortcut = new QShortcut(QKeySequence(Qt::Key_0), this);
+ }
+ if (shortcut != nullptr) {
+ connect(shortcut, &QShortcut::activated, bind(&MainWindow::channel_clicked, this, i));
+ }