Hi,
I have an application that allows allows new widgets to be created, much like an MDI interface.
I make a new menu Action when I create a new widget so the user can raise() the selected widget from a Windows Menu.
I have trouble when the user clicks on one of the menu actions.
{
boardWindow
->menuAction
= new QAction(text,
this);
menuWindow->addAction(boardWindow->menuAction) ;
connect(boardWindow->menuAction, SIGNAL(triggered()), this, SLOT(selectWindow(boardWindow->menuAction->text())));
}
void MainWindow
::selectWindow(QString text
) {}
{
boardWindow->menuAction = new QAction(text, this);
menuWindow->addAction(boardWindow->menuAction) ;
connect(boardWindow->menuAction, SIGNAL(triggered()), this, SLOT(selectWindow(boardWindow->menuAction->text())));
}
void MainWindow::selectWindow(QString text)
{}
To copy to clipboard, switch view to plain text mode
I want to do something like above, pass the text or the QAction that initiated the signal. So that I can determine which one it is and thus raise() the appropriate widget.
I keep the menu Actions in a vector of class
class BoardWindow // For a new board vector.
{
public:
boost::shared_ptr<MainBoard> mainBoard;
int identifier; // A unique id
};
class BoardWindow // For a new board vector.
{
public:
QAction* menuAction;
boost::shared_ptr<MainBoard> mainBoard;
int identifier; // A unique id
};
To copy to clipboard, switch view to plain text mode
Any ideas, there must be a way, probably very simple.
Thanks.
Bookmarks