I am working on a project about a simple main menu interface for a mobile phone. Currently I am working on C++. I want to manipulate signals from the inputs I've typed from command line input. For example when I type "1" and press enter, I want the program to take it as a signal and do the slot operation. Here is the corresponding piece of my code:
class MainMenu : public QDialog, private Ui::MainMenu
{
Q_OBJECT
public:
...
void setContactsSelected(int);
public slots:
...
void goToContacts(int);
signals:
...
void contactsSelected(int);
};
void MainMenu::setContactsSelected(int a)
{
emit contactsSelected(a);
}
MainMenu::MainMenu(QDialog *parent)
{
...
QObject::connect( this, SIGNAL( contactsSelected(int) ), this, SLOT( goToContacts(int) ) );
}