Unsolved Problem in adding Qactions to frame.
-
Hi,
I am trying to create a toolbar like structure using a qframe by adding some q actions with icons to it. But Qt doesnt seem to display the created actions on the GUI. Please correct me if i'm doing it wrong. Code is attached.QIcon LEDicon;
LEDicon.addPixmap(QPixmap(":/Images/DILow.png"), QIcon::Normal, QIcon::Off);
LEDicon.addPixmap(QPixmap(":/Images/DIHigh.png"), QIcon::Normal, QIcon::On);//Create actions. QAction *DIOLine0 = new QAction(LEDicon, "DIOLine0", this); DIOLine0->setCheckable(true); QAction *DIOLine1 = new QAction(LEDicon, "DIOLine1", this); DIOLine1->setCheckable(true); QActionGroup *DIOStatus = new QActionGroup(this); //Adding Actions to the group DIOStatus->addAction(DIOLine0); DIOStatus->addAction(DIOLine1); //Adding Actions to the frame. ui->frame->addActions(DIOStatus->actions());
-
Hi,
QAction has no visual representation. Typically QToolBar will create QToolButtons out of the information provided by QAction.
Adding QAction objects to a widget simply allows to trigger their associated shortcut when said widget has focus.