Connect the activated(QString)
signal from the QComboBox
to a custom slot of your choosing. You can either use a single slot to handle all the activated commands, or multiple slots. My example below uses multiple slots.
connect(parent0->child0, SIGNAL(activated(QString)), this, SLOT(child00(QString)));
connect(parent0->child1, SIGNAL(activated(QString)), this, SLOT(child01(QString)));
connect(parent1->child0, SIGNAL(activated(QString)), this, SLOT(child10(QString)));
connect(parent1->child1, SIGNAL(activated(QString)), this, SLOT(child11(QString)));
You'll need to repeat the process for each child widget that you make in the QTreeView
, or use a QSignalMapper
class to bundle all the signals.