0

I want to use some QML elements from module Qt Components (or something like that) and I don't know how to import them in QML file. QtCreator hasn't code completion in this case, but I remember, there was a line like:

import QtQuick.Controls 1.0

Files, which I want to import, there are in directory ~/Qt5.0.1/Tools/QtCreator/lib/qtcreator/qtcomponents (i.e. ScrollArea.qml, TableColumn.qml, ButtonRow.qml, TableView.qml, TextArea.qml etc.)

I use QtQuick 1.1.

trivelt
  • 1,913
  • 3
  • 22
  • 44
  • 1
    AFAIK QtQuick Controls is only supported with QtQuick 2. – jturcotte Oct 12 '14 at 14:10
  • @jturcotte: Although these files contain `import Qt Quick 1.0`, `import Qt 4.7`? Maybe this module isn't called "Controls", I want to import files from `qtcomponents` folder. – trivelt Oct 12 '14 at 14:14
  • 1
    Yes you're right, considering that those files seem to be internal QML files for QtCreator itself, you might be able to import them using QDeclarativeEngine::addImportPath, or through the QML_IMPORT_PATH environment variable. – jturcotte Oct 12 '14 at 14:21
  • Another option is to get a copy of those components from the qt4 branch at https://qt.gitorious.org/qt/qtquickcontrols/source/d41f99efdb99b337761f0575ad28434f6aaa07ba and get this module compiled and installed beside your application. My real suggestion would be to switch to QtQuick2 if possible though :) – jturcotte Oct 12 '14 at 14:25
  • 1
    Thanks, I added `QML_IMPORT_PATH` to .pro file and it works. – trivelt Oct 12 '14 at 14:27

0 Answers0