// pMainMenu = new QMenuBar() QAction* pAction = pMainMenu->myAction(); // new QAction connect(pAction, &QAction::triggered, this, &MainWindow::openMyWindow);
// pMainMenu = new QMenuBar() QAction* pAction = pMainMenu->myAction(); // new QAction connect(pAction, SIGNAL(pAction->triggered(bool)), this, SLOT(openMyWindow()));
connect(pAction, SIGNAL(pAction->triggered(bool)), this, SLOT(openMyWindow(bool)));
connect(pAction, SIGNAL(triggered(bool)), this, SLOT(openMyWindow()));
connect(pAction, SIGNAL(triggered(bool)), this, SLOT(openMyWindow(bool)));
QMetaObject::Connection QObject::connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type){ ... if (method_index_relative < 0) { err_method_notfound(receiver, method_arg, "connect"); err_info_about_objects("connect", sender, receiver); return QMetaObject::Connection(nullptr); } ...}
C++ (Qt)void openMyWindow(bool b)
MainMenu::MainMenu(QWidget* pMainWindow): QMenuBar(pMainWindow){ pAction = new QAction("text");}MainWindow::MainWindow(QWidget* pParent) : QMainWindow(pParent){ pMainMenu = new MainMenu() setMenuBar(pMainMenu); connect(pAction, SIGNAL(triggered(bool)), this, SLOT(openMyWindow(bool)));}
C++ (Qt)connect(pMainMenu->pAction, SIGNAL(triggered(bool)), this, SLOT(openMyWindow(bool)));