[Interest] QML import from database

Bruno Tezine bruno at tezine.com
Thu Aug 8 18:18:54 CEST 2013


Hi,
I have a Qt Quick project that should import all of its internal QML 
components from a database instead of Qt resource system or the filesystem.
Here is an example:
import "view:///MyComponents" as MyComponents
import QtQuick 2.1
import QtQuick.Controls 1.0
MyComponents.VTopWindow{
     id: mainWindow
     MyComponents.VPageTitle{
         id: pageTitle;
         title: 'VMini'
     }
     ...
}

It works when I execute the following code in c++ before running 
QQuickView.show():
if(quickView->status()!=QQuickView::Ready){
         QEventLoop loop;
         QObject::connect(quickView, 
SIGNAL(statusChanged(QQuickView::Status)), &loop, SLOT(quit()));
         loop.exec();
}
quickView->show();

The problem appears when I try to push one of these qmls into a 
StackView. I always get the error: "Component is not ready".
I have already created a NetworkAccessManager to load all qmls that come 
with "view" prefix from the database, but it seems that the StackView 
doesn't wait until all qmls are loaded.
Any ideas how to make it work?
Thank you,
     Bruno.



More information about the Interest mailing list