Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QDeclarativeView no such file ot directory. Running QML and c++ application in qtCreator

What I am trying to do is test QML in qtcreator. I have newest version Qt Creator 2.8.1 based on Qt 5.1.1.

I would like to add qml to my c++ application. I tried many ways. The most reasonable look using QDeclarativeView but I can't include it.

in pro files I add

QT += core gui declarative

I tried add quick, qml aswell but then I still don't see qtquick or declarative libraries.

I can see Qt Quick 2 UI project in qmlViewer by go

Tools->external->qtquick->qmlviewer

When I try to build Qt Quick 2 Application(Built-in Types) I get 3x

"Cannot open include file "QtQuick/QQuickView" no such file or directory.

I want to do simple c++ application using qml thanks for any help. I read many tutorials but most of them start after build. I have problem with run application no qml code.

like image 981
kajojeq Avatar asked Oct 10 '13 07:10

kajojeq


1 Answers

You can't include it, because it's qt quick 1 and you'd like to use qt quick 2. To be able to include QDeclarativeView you need:

QT += declarative

in your .pro file.

Look at QQuickView for the qt quick 2 alternative, for which you need:

QT += qml quick

in your .pro file.

like image 151
user1095108 Avatar answered Oct 17 '22 22:10

user1095108