void ChoiceWidget::hideEvent(QHideEvent *event){ QWidget::hideEvent(event); //disable recurse unset button if (mAction != nullptr) { QAction *action = mAction; //for capture lambda action->blockSignals(true); QTimer::singleShot(200,[action]() { action->setChecked(false); action->blockSignals(false); }); }}
C++ (Qt)void ChoiceWidget::buttonClick(bool state){ if (state){ // показываем всплывашку }} // соединять соответственно так:connect(button, SIGNAL(clicked(bool)), this, SLOT(buttonClick(bool)));
C++ (Qt)void MyButton::SlotPressed( void ){ if (!m_flagOpened) { ShowPopupWindow(); m_flagOpened = true; }}