QML1-vs-QML2: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Convert ExpressionEngine links)
(Table)
Line 17: Line 17:
For porting an existing QtQuick 1 application to QtQuick 2 and make use of new features of QtQuick 2, there are some changes in the QML files necessary, which are listed below.
For porting an existing QtQuick 1 application to QtQuick 2 and make use of new features of QtQuick 2, there are some changes in the QML files necessary, which are listed below.


|''. '''QtQuick 1''' |''. '''QtQuick 2''' |
{| class="wikitable"
| import QtQuick 1.0 | import QtQuick 2.0|
! QtQuick 1  
| import Qt.labs.particles 1.0 | import QtQuick.Particles 2.0|
! QtQuick 2  
| import Qt.labs.shaders 1.0 | import QtQuick 2.0|
|-
| import QtQuick 1.0 | import QtQuick.XmlListModel 2.0|
| import QtQuick 1.0  
| import QtMobility.location 1.2 | import QtLocation 5.0|
| import QtQuick 2.0
| import QtMobility.sensors 1.3 | import QtSensors 5.0|
|-
| import QtMobility.systeminfo 1.1 | import QtSystemInfo 5.0 |
| import Qt.labs.particles 1.0  
| import QtMultimediaKit 1.1 | import QtMultimedia 5.0 |
| import QtQuick.Particles 2.0
| ./qmlviewer | ./qmlscene |
|-
| import Qt.labs.shaders 1.0  
| import QtQuick 2.0
|-
| import QtQuick 1.0  
| import QtQuick.XmlListModel 2.0
|-
| import QtMobility.location 1.2  
| import QtLocation 5.0
|-
| import QtMobility.sensors 1.3  
| import QtSensors 5.0
|-
| import QtMobility.systeminfo 1.1
| import QtSystemInfo 5.0  
|-
| import QtMultimediaKit 1.1  
| import QtMultimedia 5.0  
|-
| ./qmlviewer  
| ./qmlscene  
|}


For a more detailed list of changes in QtQuick 2, see [http://doc.qt.io/qt-5.0/qtquick2-whatsnew.html What's New in Qt Quick 2]
For a more detailed list of changes in QtQuick 2, see [http://doc.qt.io/qt-5.0/qtquick2-whatsnew.html What's New in Qt Quick 2]

Revision as of 11:56, 7 April 2015

This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

QtQuick 1 vs QtQuick

work in progress

The idea of this wiki page is to have a "some how" porting guide for customers, having a Qt 4.8/QtQuick 1 application, to get a Qt5/QtQuick 2 application. The focus is on the QML part, not the c++ part. What are new elements, which elements are deprecated, what needs to be changed.

ideas from Girish:

  1. The change in javascript engines.
  2. What's changed in the js syntax in QML2 (if any)
  3. C++ api changes - like how does we create items these days? How is it different from QML1
  4. Dependency on GLES2 unlike QML1

For porting an existing QtQuick 1 application to QtQuick 2 and make use of new features of QtQuick 2, there are some changes in the QML files necessary, which are listed below.

QtQuick 1 QtQuick 2
import QtQuick 1.0 import QtQuick 2.0
import Qt.labs.particles 1.0 import QtQuick.Particles 2.0
import Qt.labs.shaders 1.0 import QtQuick 2.0
import QtQuick 1.0 import QtQuick.XmlListModel 2.0
import QtMobility.location 1.2 import QtLocation 5.0
import QtMobility.sensors 1.3 import QtSensors 5.0
import QtMobility.systeminfo 1.1 import QtSystemInfo 5.0
import QtMultimediaKit 1.1 import QtMultimedia 5.0
./qmlviewer ./qmlscene

For a more detailed list of changes in QtQuick 2, see What's New in Qt Quick 2

See also the Qt documentation's porting guide

A description, how to port your Qt 4.x application to Qt 5 is here

New QML elements in QtQuick2:

QML element not available in QtQuick 2 anymore: