Fast dialogs on QGraphicsView



  • In our project we use QGraphicsView and custom QGraphicsItem classes to paint our GUI. On some occasions we need to inform the user about faulty actions that user performs on GUI. We choose QMessageBox to inform the user. But when our custom graphics item count increased on scene QMessageBox is very slow to display. How can we make faster dialogs on QGraphicsScene.



  • It depends on how you use the QMessageBox. If you use one of the static functions or exec(), I suggest you try using show() or open() instead and see if it helps. The reason to try this is that the static functions and exec() either start a new event loop or call processEvents(), both of which can severely muck with event handling efficiency.



  • Obviously if the entire GUI is painted in one paint event it might also be the case that your paint event just takes a hell of a lot of time, which will more or less be amplified by the exec() issue.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.