PDA

View Full Version : Use QtQuick 1 in Qt5



minamz
23rd January 2017, 11:32
Hi
I have a qml file which imports QtQuick 1.0. It was ok in Qt 4.8 but after porting to qt5.7 it does not work.
Remember that I don't want to use QtQuick 2. Is there any solution for my problem?
my code is:
QQuickView *view = new QQuickView;
view->setSource(QUrl::fromLocalFile("D:/test/myQml.qml"));
view->show();

anda_skoa
24th January 2017, 09:28
If you don't want to use QtQuick 2 then you can't use QQuickView.

QtQuick 1 needs the widget based QDeclarativeView

Cheers,
_

minamz
24th January 2017, 14:46
But how can I use QDeclarative in Qt5?

anda_skoa
25th January 2017, 10:09
Qt 5.5 did still contain Qt Declarative and it is still manually buildable for subsequent Qt versions.

Cheers,
_

minamz
26th January 2017, 12:14
Qt 5.5 did still contain Qt Declarative and it is still manually buildable for subsequent Qt versions.

Cheers,
_
Hi,
I use Qt with visual studio 2015 so I must use Qt5.7. I got qtquick1 code from code.qt.io but it has some compile errors. Do you have any idea to solve this problem?
Some of these errors are:

1>.moc\Release\moc_qdeclarativeanchors_p.cpp(360): error C2027: use of undefined type 'QDeclarativeAnchorLine'
1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
1>.moc\Release\moc_qdeclarativeanchors_p.cpp(360): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
1>.moc\Release\moc_qdeclarativeanchors_p.cpp(361): error C2027: use of undefined type 'QDeclarativeAnchorLine'
1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
1>.moc\Release\moc_qdeclarativeanchors_p.cpp(361): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
1>.moc\Release\moc_qdeclarativeanchors_p.cpp(362): error C2027: use of undefined type 'QDeclarativeAnchorLine'
1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
1>.moc\Release\moc_qdeclarativeanchors_p.cpp(362): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
1>.moc\Release\moc_qdeclarativeanchors_p.cpp(363): error C2027: use of undefined type 'QDeclarativeAnchorLine'
1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
1>.moc\Release\moc_qdeclarativeanchors_p.cpp(363): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'

anda_skoa
26th January 2017, 12:31
Maybe try building Qt as a whole, including the qtquick1 module.

Cheers,
_