diff options
Diffstat (limited to 'doc/src/declarative/qdeclarativeperformance.qdoc')
-rw-r--r-- | doc/src/declarative/qdeclarativeperformance.qdoc | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/doc/src/declarative/qdeclarativeperformance.qdoc b/doc/src/declarative/qdeclarativeperformance.qdoc index adbd9db753..737f19f67a 100644 --- a/doc/src/declarative/qdeclarativeperformance.qdoc +++ b/doc/src/declarative/qdeclarativeperformance.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! -\page qdeclarativeperformance.html +\page qtquick2-performance.html \title QML Performance \section1 Opaque Items @@ -115,36 +115,30 @@ provide an image that includes the frame and the shadow. Avoid running JavaScript during animation. For example, running a complex JavaScript expression for each frame of an x property animation. -\section1 Rendering +\section1 Loading later -Often using a different graphics system will give superior performance to the native -graphics system (this is especially the case on X11). This can be configured using -QApplication::setGraphicsSystem() or via the command line using the \c -graphicssystem -switch. +Startup time is influenced by the amount of QML that must be loaded. Breaking your +application into components which can be loaded when needed will allow faster startup time. +This allows better runtime memory management by unloading the components when no +longer needed. -You can enable OpenGL acceleration using the \c opengl graphics system, or by setting a -QGLWidget as the viewport of your QDeclarativeView. +This may be achieved by using either \l Loader or creating components +\l {Dynamic Object Management in QML}{dynamically}. -You may need to try various options to find what works the best for your application. -For embedded X11-based devices one recommended combination is to use the raster graphics -system with a QGLWidget for the viewport. While this doesn't guarantee the \bold fastest -performance for all use-cases, it typically has \bold{consistently good} performance for -all use-cases. In contrast, only using the raster paint engine may result in very good -performance for parts of your application and very poor performance elsewhere. +\section1 Property Types -The QML Viewer uses the raster graphics system by default for X11 and OS X. It also -includes a \c -opengl command line option which sets a QGLWidget as the viewport of the -view. On OS X, a QGLWidget is always used. - -You can also prevent QDeclarativeView from painting its window background if -you will provide the background of your application using QML, e.g. +When possible use a specific type, rather than variant, when declaring properties. \code -QDeclarativeView window; -window.setAttribute(Qt::WA_OpaquePaintEvent); -window.setAttribute(Qt::WA_NoSystemBackground); -window.viewport()->setAttribute(Qt::WA_OpaquePaintEvent); -window.viewport()->setAttribute(Qt::WA_NoSystemBackground); +Item { + property variant foo: 10 + property real bar: 10 + + x: foo * 2 + y: bar *3 +} \endcode +bar is faster than foo. + */ |