Please help with actual C++ code
-
@TomZ Thanks, however... I am just extending "windows
...tile...cascade..." menu using mdiArea (example). I have it essentially working, include "connect". The "problem is " - it can be started with QMenu -that makes submenu extension easy - but adding "checkable " to sub menu is currently failing. Or I can start with QAction then adding depended sub menu fails. Right now I feel starting with "cascading menus " is cleaner ..in case I want to add sususbsub....
The "user" -me - has several depended tasks to accomplish - setup serial connection, then setup dependent Bluetooth connection, configure remote Bluetooth device and then attach it to "serial connection" etc.,key remote device - amateur radio transmitter, listen to "meteor scatter" pings on Internet ...
The basic idea is to do all this in separate forms , I got that going, to keep monitor and me , focused on task...This post is deleted! -
This post is deleted!
@AnneRanch said in Please help with actual C++ code:
subMenu[index]->addAction(list_array[index][ 2] + " #" + QString::number( index_sub));
...returns a
QAction *
. You need to store this pointer to connect to the action'striggered
signal. Then you can skip the whole acrobatics about gettingindex
inside a slot.Do you understand that?
-
This post is deleted!
-
@AnneRanch
but I am unable to add "check box" to any of them
QAction *action = submenu[index]->addAction("Some text"); action->setCheckable(true);
adds an action with text
Some text
and sets it to have a checkbox.This post is deleted! -
This post is deleted!
This post is deleted! -
A Axel Spoerl referenced this topic on