Take the 2-minute tour ×

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.

share|improve this question
In hindsight, it appears a faulty installation of Qt is the most probable reason for your problems. –  user1095108 Oct 10 '13 at 7:56
You were right. Problem with qt, I reinstalled and that helped! –  kajojeq Oct 10 '13 at 14:22

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
Are you sure? Can you tell me exactly in what kind of project you add this? Is it possible in GUI project? Because I tried it two version you told about and still can;t use QQuick or QDeclarative. Do I need to put some files in my project directory? some dlls or libs? –  kajojeq Oct 10 '13 at 7:58
You shouldn't needing any dlls or libs in your project directory, but you need a valid Qt install. Try copy&pasting a simple example .qml file, then run qmlscene file.qml to test if your installation works at all. –  user1095108 Oct 10 '13 at 9:16

Your Answer


