GammaRay
GammaRay copied to clipboard
Feature: Add a way to do massive semantic checks on qml files.
Add a way to execute a mass QQmlComponent::create() on all qml files, for a given qml context, to find errors in qml files.
QDirIterator dirIt(QLatin1String("."), QDirIterator::Subdirectories);
while (dirIt.hasNext()) {
dirIt.next();
if (QFileInfo(dirIt.filePath()).isFile()) {
if (QFileInfo(dirIt.filePath()).suffix() == QLatin1String("qml"))
{
qDebug()<< dirIt.filePath();
QQmlComponent component(qmlengine(),
QUrl::fromLocalFile(dirIt.filePath()));
QObject *myObject = component.create();
if (!myObject) {
qWarning() << dirIt.filePath();
foreach (const QQmlError &error, component.errors()) {
qWarning() << error;
}
}
}
}
}