QMessageBox error
-
Hi,
I put a QMessageBox in a QMainwindow sub-class:@
QMessageBox::StandardButton action = QMessageBox::warning(this, "Save", " ",
QMessageBox::Save | QMessageBox::Discard , QMessageBox::Save);
@When I run the application, and exactly every-time the message widget is shown, I get the following error message:
@
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 20 (X_GetProperty)
Resource id: 0x780967c
@The application, despite, still run.
Has someone a solution for this problem ? -
Maybe a suggestion, but try this:
@
int selection = msgBox.exec();
if(selection == QMessageBox::Yes)
@
the enum StandardButtons might cause the problem. Normally the compiler should allocate enough memory space to hold the returned enum, but you never know ;-)
Also the text (third part) can be set with "".
Don't know what might go wrong otherwise.
Does the program stops when the dialog is opened, or closed? At opening it would seem that the dialog has improper arguments, on close it might have to do with the return value.
Greetz -
The method is a static member so I don't have to create a QMessageBox object ! And so I can't use
QMessageBox::exec(). If you mean that I have to create a custom QDialog this is a point of view, but - as uranusjr said- it seems to be an X Window problem.
I didn't understand what you mean by "You might need to specify your environment". -
He wants to know which operating system you use, which version of Qt and so on. Everything which might help to track down the problem on your specific or a more general environment.