C++ (Qt) QPixmap pixmap(":/splash.png"); QSplashScreen *splash = new QSplashScreen(pixmap); splash->show(); ... // Loading some items splash->showMessage("Loaded modules"); qApp->processEvents(); ... // Establishing connections splash->showMessage("Established connections"); qApp->processEvents();
C++ (Qt)#include <QtGUI> int thePaintNo = 0; class MyDialog : public QDialog {public: virtual void paintEvent( QPaintEvent * ) { printf("paintEvent %d\n", thePaintNo); QPainter painter(this); QRect R(0, 0, 100, 100); switch (thePaintNo % 3) { case 0: painter.fillRect(R, QBrush(Qt::red)); break; case 1: painter.fillRect(R, QBrush(Qt::green)); break; case 2: painter.fillRect(R, QBrush(Qt::blue)); break; } ++thePaintNo; }}; int main( int argc, char** argv ){ QApplication app(argc, argv); MyDialog dlg; dlg.show(); printf("before repaint\n"); dlg.repaint(); printf("after repaint\n"); getchar(); return app.exec();}