Hi to all!
I am developing an application that will have a lot of menus. Now, I've prepared following code snippet:
m_pDataSourceAction
=new QAction(tr
("&Data source ..."),
this);
Q_CHECK_PTR(m_pDataSourceAction);
m_pDataSourceAction->setShortcut(tr("Ctrl+D"));
m_pDataSourceAction->setStatusTip(tr("Selects data source"));
connect(m_pDataSourceAction, SIGNAL(triggered()), this, SLOT(dataSourceSelection()));
m_pDataSourceAction=new QAction(tr("&Data source ..."), this);
Q_CHECK_PTR(m_pDataSourceAction);
m_pDataSourceAction->setShortcut(tr("Ctrl+D"));
m_pDataSourceAction->setStatusTip(tr("Selects data source"));
connect(m_pDataSourceAction, SIGNAL(triggered()), this, SLOT(dataSourceSelection()));
To copy to clipboard, switch view to plain text mode
How do I transform this code snipper into an flexible method - method with paramateres ActionText, ShortcutCombo, StatusTipText, SourceSignal, TargetSlot. Now, method should return pointer to QAction, I am aware of that. But how do I declare signal and slot as a parameter of method?
Bookmarks