Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

[SOLVED] Compile Error: QtQuick1/QDeclarativeView: No such file or directory



  • 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



  • me too .



  • does your .pro have QT += declarative?



  • 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



  • 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: quick1

    I 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 = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui@



  • 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.


Log in to reply