Ok this is quite a noob question, I know. I have made this
constructor of mainwindow.cpp:
(void) new QShortcut(Qt
::ALT + Qt
::Key_1,
this,
SLOT(show_m
(0)));
(void) new QShortcut(Qt
::ALT + Qt
::Key_2,
this,
SLOT(show_m
(1)));
(void) new QShortcut(Qt
::ALT + Qt
::Key_3,
this,
SLOT(show_m
(2)));
(void) new QShortcut(Qt
::ALT + Qt
::Key_4,
this,
SLOT(show_m
(3)));
(void) new QShortcut(Qt::ALT + Qt::Key_1, this, SLOT(show_m(0)));
(void) new QShortcut(Qt::ALT + Qt::Key_2, this, SLOT(show_m(1)));
(void) new QShortcut(Qt::ALT + Qt::Key_3, this, SLOT(show_m(2)));
(void) new QShortcut(Qt::ALT + Qt::Key_4, this, SLOT(show_m(3)));
To copy to clipboard, switch view to plain text mode
well, the slot show_m(int) looks like:
int MainWindow::show_m(int a)
{
ui->tabWidget->setCurrentIndex(a);
}
int MainWindow::show_m(int a)
{
ui->tabWidget->setCurrentIndex(a);
}
To copy to clipboard, switch view to plain text mode
As you may understand, I want by pressing Alt+1/2/3/4 to navigate through the tabs. I don't get compile error but output error:
Object::connect: No such slot MainWindow::show_m(0) in megauploadMain.cpp:102
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such slot MainWindow::show_m(1) in megauploadMain.cpp:103
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such slot MainWindow::show_m(2) in megauploadMain.cpp:104
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such slot MainWindow::show_m(3) in megauploadMain.cpp:105
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such slot MainWindow::show_m(0) in megauploadMain.cpp:102
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such slot MainWindow::show_m(1) in megauploadMain.cpp:103
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such slot MainWindow::show_m(2) in megauploadMain.cpp:104
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such slot MainWindow::show_m(3) in megauploadMain.cpp:105
Object::connect: (receiver name: 'MainWindow')
To copy to clipboard, switch view to plain text mode
Thx in advance for any replies!
Bookmarks