loader.cpp 759 B

12345678910111213141516171819202122
  1. #include "loader.h"
  2. #include <QTimer>
  3. Loader::Loader(QObject *parent) :
  4. QObject(parent)
  5. {
  6. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
  7. mainapp.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
  8. viewer.setMainQmlFile(QLatin1String("qml/groupmypictures/Splashscreen.qml"));
  9. viewer.showExpanded();
  10. connect(&mainapp,SIGNAL(statusChanged(QDeclarativeView::Status)),this,SLOT(onStatusChanged(QDeclarativeView::Status)));
  11. mainapp.setMainQmlFile(QLatin1String("qml/groupmypictures/main.qml"));
  12. }
  13. void Loader::onStatusChanged(QDeclarativeView::Status status)
  14. {
  15. if(status == QDeclarativeView::Ready){
  16. viewer.close();
  17. mainapp.showExpanded();
  18. }
  19. }