How can I use signal and slot in QT5 to disable an item in a system tray menu for 2 minutes ?
main.cpp:
QAction* saveUptime = new QAction("Save uptime", trayIconMenu);
saveUptime->setIcon(app->style()->standardIcon(QStyle::SP_FileDialogDetailedView) );
trayIconMenu->addAction(saveUptime);
QObject::connect(saveUptime, &QAction::triggered,mainWindow, &MainWindow::saveUptime);
I can execute this function but I cannot from MainWindow change tray icon menu item
Tray menu is declared in main.cpp
int main(int argc, char *argv[]) {
...
}
Bookmarks