diff options
-rw-r--r-- | src/qml/compiler/qv4ssa.cpp | 10 | ||||
-rw-r--r-- | src/qml/doc/src/qmllanguageref/documents/topic.qdoc | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4errorobject_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmllocale_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 18 | ||||
-rw-r--r-- | tools/qmlscene/main.cpp | 75 |
7 files changed, 60 insertions, 55 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index d67b88b718..31e3ed867e 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -2991,15 +2991,7 @@ void splitCriticalEdges(IR::Function *f, DominatorTree &df, StatementWorklist &w toBB->in[inIdx] = newBB; newBB->out.append(toBB); - BasicBlock *container = 0; - for (container = fromBB->containingGroup(); container; container = container->containingGroup()) { - if (container == toBB || container == toBB->containingGroup()) - break; - } - if (container == 0) - container = fromBB->containingGroup(); - - newBB->setContainingGroup(container); + newBB->setContainingGroup(toBB->containingGroup()); // patch the terminator Stmt *terminator = fromBB->terminator(); diff --git a/src/qml/doc/src/qmllanguageref/documents/topic.qdoc b/src/qml/doc/src/qmllanguageref/documents/topic.qdoc index aed89f6423..aa13229165 100644 --- a/src/qml/doc/src/qmllanguageref/documents/topic.qdoc +++ b/src/qml/doc/src/qmllanguageref/documents/topic.qdoc @@ -42,6 +42,12 @@ The ability to define re-usable QML object types in documents is an important enabler to allow clients to write modular, highly readable and maintainable code. +Since Qt 5.4, a document can also have the file extension \c ".ui.qml". The QML +engine handles these files like standard .qml files and ignores the \c .ui part +of the extension. Qt Creator handles those files as +\l{Qt Creator: Qt Quick UI Forms}{UI forms} for the Qt Quick Designer. The files +can contain only a subset of the QML language that is defined by Qt Creator. + \section1 Structure of a QML Document A QML document consists of two sections: the imports section, and the object diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h index bb31b505e8..ffbdafcc43 100644 --- a/src/qml/jsruntime/qv4errorobject_p.h +++ b/src/qml/jsruntime/qv4errorobject_p.h @@ -71,7 +71,7 @@ struct ErrorObject: Object { static ReturnedValue method_get_stack(CallContext *ctx); static void markObjects(HeapObject *that, ExecutionEngine *e); - static void destroy(Managed *that) { static_cast<ErrorObject *>(that)->~ErrorObject(); } + static void destroy(Managed *that) { static_cast<ErrorObject *>(that)->d()->~Data(); } }; template<> diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index 00b78b9954..c63e634025 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -508,7 +508,7 @@ private: static void destroy(Managed *that) { - static_cast<QQmlSequence<Container> *>(that)->~QQmlSequence<Container>(); + static_cast<QQmlSequence<Container> *>(that)->d()->~Data(); } }; diff --git a/src/qml/qml/qqmllocale_p.h b/src/qml/qml/qqmllocale_p.h index a3fc8e4ed4..233624453f 100644 --- a/src/qml/qml/qqmllocale_p.h +++ b/src/qml/qml/qqmllocale_p.h @@ -174,7 +174,7 @@ struct QQmlLocaleData : public QV4::Object private: static void destroy(Managed *that) { - static_cast<QQmlLocaleData *>(that)->~QQmlLocaleData(); + static_cast<QQmlLocaleData *>(that)->d()->~Data(); } }; diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index ca5b038efa..9675d6e48a 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -460,12 +460,18 @@ void Updater::visitGeometryNode(Node *n) if (e->root) { BatchRootInfo *info = renderer->batchRootInfo(e->root); - info->availableOrders--; - if (info->availableOrders < 0) { - renderer->m_rebuild |= Renderer::BuildRenderLists; - } else { - renderer->m_rebuild |= Renderer::BuildRenderListsForTaggedRoots; - renderer->m_taggedRoots << e->root; + while (info != 0) { + info->availableOrders--; + if (info->availableOrders < 0) { + renderer->m_rebuild |= Renderer::BuildRenderLists; + } else { + renderer->m_rebuild |= Renderer::BuildRenderListsForTaggedRoots; + renderer->m_taggedRoots << e->root; + } + if (info->parentRoot != 0) + info = renderer->batchRootInfo(info->parentRoot); + else + info = 0; } } else { renderer->m_rebuild |= Renderer::FullRebuild; diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index 208226c8aa..bc339ae3e5 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -31,13 +31,13 @@ ** ****************************************************************************/ -#include <QtCore/qdebug.h> #include <QtCore/qabstractanimation.h> #include <QtCore/qdir.h> #include <QtCore/qmath.h> #include <QtCore/qdatetime.h> #include <QtCore/qpointer.h> #include <QtCore/qscopedpointer.h> +#include <QtCore/qtextstream.h> #include <QtGui/QGuiApplication> @@ -96,7 +96,7 @@ void RenderStatistics::updateStats() } var /= timesPerFrames.size(); - qDebug("Average time per frame: %f ms (%i fps), std.dev: %f ms", avgtime, qRound(1000. / avgtime), qSqrt(var)); + printf("Average time per frame: %f ms (%i fps), std.dev: %f ms\n", avgtime, qRound(1000. / avgtime), qSqrt(var)); timePerFrame.append(avgtime); timesPerFrames.clear(); @@ -124,13 +124,13 @@ void RenderStatistics::printTotalStats() } avg /= count; - qDebug(" "); - qDebug("----- Statistics -----"); - qDebug("Average time per frame: %f ms (%i fps)", avg, qRound(1000. / avg)); - qDebug("Best time per frame: %f ms (%i fps)", minTime, int(1000 / minTime)); - qDebug("Worst time per frame: %f ms (%i fps)", maxTime, int(1000 / maxTime)); - qDebug("----------------------"); - qDebug(" "); + puts(" "); + puts("----- Statistics -----"); + printf("Average time per frame: %f ms (%i fps)\n", avg, qRound(1000. / avg)); + printf("Best time per frame: %f ms (%i fps)\n", minTime, int(1000 / minTime)); + printf("Worst time per frame: %f ms (%i fps)\n", maxTime, int(1000 / maxTime)); + puts("----------------------"); + puts(" "); } #endif @@ -246,17 +246,17 @@ static int displayOptionsDialog(Options *options) static bool checkVersion(const QUrl &url) { if (!qgetenv("QMLSCENE_IMPORT_NAME").isEmpty()) - qWarning("QMLSCENE_IMPORT_NAME is no longer supported."); + fprintf(stderr, "QMLSCENE_IMPORT_NAME is no longer supported.\n"); QString fileName = url.toLocalFile(); if (fileName.isEmpty()) { - qWarning("qmlscene: filename required."); + fprintf(stderr, "qmlscene: filename required.\n"); return false; } QFile f(fileName); if (!f.open(QFile::ReadOnly | QFile::Text)) { - qWarning("qmlscene: failed to check version of file '%s', could not open...", + fprintf(stderr, "qmlscene: failed to check version of file '%s', could not open...\n", qPrintable(fileName)); return false; } @@ -278,8 +278,8 @@ static bool checkVersion(const QUrl &url) import = qt47.cap(0).trimmed(); if (!import.isNull()) { - qWarning("qmlscene: '%s' is no longer supported.\n" - "Use qmlviewer to load file '%s'.", + fprintf(stderr, "qmlscene: '%s' is no longer supported.\n" + "Use qmlviewer to load file '%s'.\n", qPrintable(import), qPrintable(fileName)); return false; @@ -300,7 +300,7 @@ static void displayFileDialog(Options *options) } #else Q_UNUSED(options); - qWarning("No filename specified..."); + puts("No filename specified..."); #endif } @@ -324,11 +324,11 @@ static void loadDummyDataFiles(QQmlEngine &engine, const QString& directory) if(comp.isError()) { QList<QQmlError> errors = comp.errors(); foreach (const QQmlError &error, errors) - qWarning() << error; + fprintf(stderr, "%s\n", qPrintable(error.toString())); } if (dummyData) { - qWarning() << "Loaded dummy data:" << dir.filePath(qml); + fprintf(stderr, "Loaded dummy data: %s\n", qPrintable(dir.filePath(qml))); qml.truncate(qml.length()-4); engine.rootContext()->setContextProperty(qml, dummyData); dummyData->setParent(&engine); @@ -338,23 +338,23 @@ static void loadDummyDataFiles(QQmlEngine &engine, const QString& directory) static void usage() { - qWarning("Usage: qmlscene [options] <filename>"); - qWarning(" "); - qWarning(" Options:"); - qWarning(" --maximized ............................... Run maximized"); - qWarning(" --fullscreen .............................. Run fullscreen"); - qWarning(" --transparent ............................. Make the window transparent"); - qWarning(" --multisample ............................. Enable multisampling (OpenGL anti-aliasing)"); - qWarning(" --no-version-detection .................... Do not try to detect the version of the .qml file"); - qWarning(" --slow-animations ......................... Run all animations in slow motion"); - qWarning(" --resize-to-root .......................... Resize the window to the size of the root item"); - qWarning(" --quit .................................... Quit immediately after starting"); - qWarning(" --disable-context-sharing ................. Disable the use of a shared GL context for QtQuick Windows"); - qWarning(" -I <path> ................................. Add <path> to the list of import paths"); - qWarning(" -B <name> <file> .......................... Add a named bundle"); - qWarning(" -translation <translationfile> ............ Set the language to run in"); - - qWarning(" "); + puts("Usage: qmlscene [options] <filename>"); + puts(" "); + puts(" Options:"); + puts(" --maximized ............................... Run maximized"); + puts(" --fullscreen .............................. Run fullscreen"); + puts(" --transparent ............................. Make the window transparent"); + puts(" --multisample ............................. Enable multisampling (OpenGL anti-aliasing)"); + puts(" --no-version-detection .................... Do not try to detect the version of the .qml file"); + puts(" --slow-animations ......................... Run all animations in slow motion"); + puts(" --resize-to-root .......................... Resize the window to the size of the root item"); + puts(" --quit .................................... Quit immediately after starting"); + puts(" --disable-context-sharing ................. Disable the use of a shared GL context for QtQuick Windows"); + puts(" -I <path> ................................. Add <path> to the list of import paths"); + puts(" -B <name> <file> .......................... Add a named bundle"); + puts(" -translation <translationfile> ............ Set the language to run in"); + + puts(" "); exit(1); } @@ -428,7 +428,8 @@ int main(int argc, char ** argv) if (qmlTranslator.load(options.translationFile)) { app.installTranslator(&qmlTranslator); } else { - qWarning() << "Could not load the translation file" << options.translationFile; + fprintf(stderr, "Could not load the translation file \"%s\"\n", + qPrintable(options.translationFile)); } } #endif @@ -477,13 +478,13 @@ int main(int argc, char ** argv) QObject::connect(&engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit())); component->loadUrl(options.file); if ( !component->isReady() ) { - qWarning("%s", qPrintable(component->errorString())); + fprintf(stderr, "%s\n", qPrintable(component->errorString())); return -1; } QObject *topLevel = component->create(); if (!topLevel && component->isError()) { - qWarning("%s", qPrintable(component->errorString())); + fprintf(stderr, "%s\n", qPrintable(component->errorString())); return -1; } QScopedPointer<QQuickWindow> window(qobject_cast<QQuickWindow *>(topLevel)); |