How do I connect an action responding to a menu bar item?
Solved
General and Desktop
-
@jdent said in How do I connect an action responding to a menu bar item?:
I created a menu in Qt Designer, but how do I implement the connection to the function I want called ??
connect(ui->yourMenuAction, &QAction::triggered, this, &MainWindow::yourFunction);
For the first parameter, use the
ui
pointer to access objects in your generated form class... then pick the object name of the item you want to use.
All access to objects created in Designer works likeui->objectname
(you find the name in QtDesigner's object inspector list)Read more about
Signals & Slots
here: -