When QMessagBOx met with QGLWidget？
Just now, i have come cross an small issue, i have tried hours, but without any effetcs. the problem descibes as follows:
when i using QGLWidget to implement opengl funtions, in the overrided initializeGL() of my subclass , once i call QMessagebox::warning(this, "Title", "Content"); the messsage box cause the initializeGL function execute twice, and the box apears double too.
So, any can help? many thanks!
Hi, welcome to devnet.
That is strange indeed.
You can report a bug here: https://bugreports.qt-project.org
It seems a strange place to deal with UI. It's intended for OpenGL initialization, not for interacting with the user.
The only "workaround" I can think of is just not calling the warning message in there. Maybe instead of a message box you could emit a custom warning signal and connect a queued slot that would show the message later on?
[quote author="Chris Kawa" date="1415635477"]Maybe instead of a message box you could emit a custom warning signal and connect a queued slot that would show the message later on?[/quote]
Or good old QTimer::singleShot();
thanks for your suggestion, i will try later, since now, i have removed the QmessageBox out of the initializeGL().
Hi and welcome to devnet,
While I agree with Chris Kawa about the strangeness, I'd say that it's also not the right place to put a dialog, initializeGL's role is to setup OpenGL for your widget