[Solved]how to add combo box in trayicon menu?
-
Finally! You got what I am asking.
Let me tell you the requirement. I wanted to add a list in tray menu which will be having some options, once user click on it a drop down list will be visible and it will contain those options. I thought combo box will help. Let me know if any other option is available to achieve the same. -
I am working on a updater module which will be having a tray menu. Below is the code piece I am working on.
@
........
Once1DayAction = new QAction(tr("Once in every day."), this);
connect(Once1DayAction, SIGNAL(triggered()), this, SLOT(UpdateGroupActs()));Once7DayAction = new QAction(tr("Once in 7 days."), this); connect(Once7DayAction, SIGNAL(triggered()), this, SLOT(UpdateGroupActs())); Once7DayAction->setChecked(true); alignmentGroup = new QActionGroup(this); alignmentGroup->addAction(Once1DayAction); alignmentGroup->addAction(Once7DayAction); // create tray icon menu trayIconMenu = new QMenu(this); trayIconMenu->addSeparator()->setText(tr("Updates")); // Separater is visible but Text is not visible in the menu. trayIconMenu->addActions(alignmentGroup->actions()); trayIconMenu->addSeparator(); trayIconMenu->addAction(quitAction); trayIcon = new QSystemTrayIcon(this); trayIcon->setContextMenu(trayIconMenu);
........
@Note: I tried to use "checkedAction" to see whether any thing is checked but it is returning NULL, seems nothing is set.