mapper->setMapping(buttonOne, 0);
mapper->setMappinc(buttonTwo, 1);
connect(buttonOne, SIGNAL(clicked()), mapper, SLOT(map()));
connect(buttonTwo, SIGNAL(clicked()), mapper, SLOT(map()));
connect(mapper, SIGNAL(mapped(int)), stackedWidget, SLOT(setCurrentIndex(int)));
QSignalMapper *mapper = ...
QPushButton *buttonOne = ...
QPushButton *buttonTwo = ...
mapper->setMapping(buttonOne, 0);
mapper->setMappinc(buttonTwo, 1);
connect(buttonOne, SIGNAL(clicked()), mapper, SLOT(map()));
connect(buttonTwo, SIGNAL(clicked()), mapper, SLOT(map()));
connect(mapper, SIGNAL(mapped(int)), stackedWidget, SLOT(setCurrentIndex(int)));
To copy to clipboard, switch view to plain text mode
Bookmarks