[SOLVED] Compile Error: QtQuick1/QDeclarativeView: No such file or directory
-
wrote on 28 Dec 2012, 07:21 last edited by
Hello,
I installed Qt 5.0.0 on my Kubuntu 12.04.1 and all works fine. Projects can be compiled and all include and libs are found. I use QtCreator.
Because I use widgets and QML together, I use QDeclarativeView to show the QML UIs. When I make a clean project, just with 1 main window and I place a QDeclarativeView on the main window (nothing more) I get the compiler error as described in the headline.
The error is in the ui_mainwindow.h file which is a Qt - generated file.
To solve it, I have to delete the "QtQuick1/" from the include statement, then it can be compiled. Problem is, every time i make a "rebuild all" the incorrect statement is back again.Any help or workaround for this?
Regrads
Michael -
wrote on 28 Dec 2012, 10:42 last edited by
me too .
-
wrote on 28 Dec 2012, 13:03 last edited by
does your .pro have QT += declarative?
-
wrote on 28 Dec 2012, 15:08 last edited by
To use QtQuick1 ( according to "this":http://qt-project.org/doc/qt-5.0/qtquick/qtquick-porting-qt5.htmlhttp:// ) you should add to .pro line:
QT += quick1 -
wrote on 28 Dec 2012, 17:25 last edited by
The .pro file of cause contains QT += declarative.
I tried the link of HIskind but it is broken. But I found what he wants to show. Here the correct link: "http://qt-project.org/doc/qt-5.0/qtquick/qtquick-porting-qt5.html":http://qt-project.org/doc/qt-5.0/qtquick/qtquick-porting-qt5.html
The page gives some good explanations when porting to Qt5, I think I will use it as a starting point.
I tried to add the line QT += quick1 but this gave me the qmake error message:
Unknown module(s) in QT: quick1I think there is a bug in the QtQuick1 support in the final Qt5 release.
Here my .Pro file for completeness:
@#-------------------------------------------------
Project created by QtCreator 2012-12-27T17:21:22
#-------------------------------------------------
QT += core gui declarative
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test1
TEMPLATE = appSOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui@
-
wrote on 19 Jan 2013, 16:18 last edited by
Update:
My environment is Windows7(64Bit) for Linux or Mac you have to change the following steps accordingly.If you intend to use QDeclarativeView with Qt5 you can use the following workaround:
make a new folder qtbase\include\qtquick1
copy the complete content of the folder qtbase\include\QtDeclarative into qtbase\include\qtquick1.
Then you can compile all your old projects which are using QDeclarativeView.