Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. QAction *action = new QAction(tr("show popup"), this);
  2. connect(action, &QAction::triggered, this, &MyWidget::showPopup);
  3. addAction(action);
  4.  
  5. void MyWidget::showPopup()
  6. {
  7. QMessageBox* popup = new QMessageBox(this);
  8. popup->setModal(true);
  9. popup->setFocus();
  10. popup->show();
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement