cocus

QT QMessageBox for QT Necessitas

Apr 28th, 2012
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1.     QFont           f;
  2.     QMessageBox     *msgBox = new QMessageBox(this);
  3.     QDesktopWidget  *win = new QDesktopWidget();
  4.  
  5.     f.setPointSize(6);
  6.  
  7.     msgBox->setWindowModality(Qt::WindowModal);
  8.     msgBox->setFont(f);
  9.     msgBox->setButtonText(1, "Hola");
  10.     msgBox->setText("Presionaste el boton!\n FORRO");
  11.     msgBox->setWindowTitle("Msgbox en Qt");
  12.  
  13.     msgBox->show();
  14.     msgBox->move(win->width() / 2 - msgBox->width() / 2, win->height() / 2 - msgBox->height() / 2);
  15.     msgBox->exec();
Advertisement
Add Comment
Please, Sign In to add comment