[gelöst] QMessageBox lässt sich nicht mit X schließen
Verfasst: 15. Januar 2008 14:22
Tag zusammen,
ich habe eine QMessageBox in mein Programm eingebaut und nun das Problem, dass ich sie mit einem Klick auf das X nicht schließen kann. Die QMessageBox hat das WindowFlag alwaysontop, aber auch wenn ich das wegnehme ändert sich nix.
Jemand eine Idee?
Hab über die Foren-Suche nix zu dem Thema gefunden.
ich habe eine QMessageBox in mein Programm eingebaut und nun das Problem, dass ich sie mit einem Klick auf das X nicht schließen kann. Die QMessageBox hat das WindowFlag alwaysontop, aber auch wenn ich das wegnehme ändert sich nix.
Code: Alles auswählen
QMessageBox askForUpdate;
askForUpdate.setWindowTitle(tr("Update available"));
askForUpdate.setText(tr("A new update is available.\n"
"Do you want it to be downloaded and installed automatically,\n"
"visit the website to download manually or do nothing now?"));
askForUpdate.addButton("&Automatically", QMessageBox::AcceptRole);
askForUpdate.addButton("&Nothing", QMessageBox::DestructiveRole);
askForUpdate.addButton("&Manually", QMessageBox::RejectRole);
askForUpdate.setWindowFlags(Qt::WindowStaysOnTopHint);
askForUpdate.activateWindow();
askForUpdate.setFocus();
askForUpdate.exec();
Hab über die Foren-Suche nix zu dem Thema gefunden.