Advertisement
artemmarchenko

Splash screen on Android snippet

Sep 12th, 2011
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1.  
  2.     QDesktopWidget* desktop = QApplication::desktop();
  3.     const QRect desktopRect = desktop->availableGeometry();
  4.  
  5.     QPixmap splashPixmap(desktopRect.width(), desktopRect.height());
  6.     qWarning() << "desktopRect.width(): " << desktopRect.width();
  7.     qWarning() << "desktopRect.height(): " << desktopRect.height();
  8.     splashPixmap.fill(Qt::red);
  9.  
  10.     QSplashScreen splash(splashPixmap);
  11.  
  12.     splash.showFullScreen();
  13.     qWarning() << "called splash.showFullScreen()";
  14.  
  15.  
  16.     QDeclarativeView view;
  17.     view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
  18.     view.setAttribute(Qt::WA_AutoOrientation);
  19.    
  20.     view.setSource(QUrl("qrc:/DiscountCalcUi.qml"));
  21.     qWarning() << "about to call view.show()";
  22.     view.show();
  23.     splash.finish(&view);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement