C++ (Qt)group->setExclusive(false);button->setChecked(false);group->setExclusive(true);
wChangeQFreq = new QWidget(this); btnGroupQuickFreq = new QButtonGroup(this); btnGroupQuickFreq->setObjectName("btnGroupQuickFreq"); QHBoxLayout *layout = new QHBoxLayout(wChangeQFreq); layout->setMargin (2); layout->setSpacing(2); for(int i = 0; i < NUMB_BTN_QUICK_FREQ; i++) { btnFreqQuickSelector.push_back(new QPushButton(this)); btnFreqQuickSelector[i]->setObjectName(QString("btnFreqQS%1").arg(i)); btnFreqQuickSelector[i]->setText(aws->workFreqsAWS.titleNameQuickFreqs[i]); btnFreqQuickSelector[i]->setFixedSize(40,40); btnFreqQuickSelector[i]->setCheckable(true); layout->addWidget(btnFreqQuickSelector[i]); btnGroupQuickFreq->addButton(btnFreqQuickSelector[i],i); } QWidgetAction *actQFreq = new QWidgetAction(this); actQFreq->setDefaultWidget(wChangeQFreq); ui->btnQuickFreq->addAction(actQFreq);
QMenu *menu = btnFreqQuickSelector[id_btn]->menu();menu->hide();
C++ (Qt)group->setExclusive(false);group->checkedButton()->setChecked(false);group->setExclusive(true);
C++ (Qt)ui->btnQuickFreq->menu()->hide().
C++ (Qt)ui->btnQuickFreq->actions().first()->menu()->hide();