9

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.

Saeed Masoomi
  • 1,703
  • 1
  • 19
  • 33
kajojeq
  • 886
  • 9
  • 27

1 Answers1

7

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.

user1095108
  • 14,119
  • 9
  • 58
  • 116
  • 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 07: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 09:16