Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. void Source::start(QUrl qmlUrl)
  2. {
  3.     component = new QDeclarativeComponent(&engine, qmlUrl);
  4.     if (component->isLoading())
  5.     {
  6.         emit statusChanged(QString("Loading ") + qmlUrl.toString());
  7.         QObject::connect(component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), this, SLOT(continueStarting()));
  8.     }
  9.     else
  10.         continueStarting();
  11. }
  12.  
  13. void Source::continueStarting()
  14. {
  15.     if (component->isError())
  16.     {
  17.         QString errorString("Errors:");
  18.         for (QDeclarativeError error : component->errors())
  19.         {
  20.             errorString += "\n";
  21.             errorString += error.toString();
  22.         }
  23.         emit statusChanged(errorString);
  24.         emit done();
  25.         return;
  26.     }
  27.     source = component->create();
  28.     QDeclarativeItem *item = qobject_cast<QDeclarativeItem*>(myObject);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement