Qt Quick Components Not a type
-
I am trying to use the basic Qt quick components, but even using the given components like Window, Page, and TabBarLayout, I cannot render anything, because the debugger says that they are not a type. I am trying to make a simple tab layout, as done here: http://doc.qt.nokia.com/qtquick-components-symbian-1.1/qml-tabgroup.html#details
However, even when I copy the implementation here exactly, still nothing works. I am importing Qt quick and including types in my C++, what could be causing this? -
Hi,
Could you post the exact import statement(s) you are using in QML, as well as the exact error message that is produced? That should help in identifying what the issue is.
Regards,
Michael -
Hi Michael,
In the QML file I import
@
import QtQuick 1.1
@
I tried adding the regular Qt library and mobility, but neither did anything. In addition, in main.cpp I import:
@
#include <QtGui/QApplication>
#include <QtDeclarative>
#include "qmlapplicationviewer.h"
#include <QWidget>
#include <QTabWidget>
@and in the .pro file I have added:
@
CONFIG += mobility
TEMPLATE += app
QT += quick
QT += gui declarative
CONFIG += qt-components
SOURCES += main.cpp
@When I try to run the program, I get the following error message:
@
Starting /home/adam/Qt/Tabs-build-desktop-Qt_4_8_1_in_PATH__System__Release/Tabs...
file:///home/adam/Qt/Tabs-build-desktop-Qt_4_8_1_in_PATH__System__Release/qml/Tabs/main.qml:3:1: Window is not a type
Window {
^
/home/adam/Qt/Tabs-build-desktop-Qt_4_8_1_in_PATH__System__Release/Tabs exited with code 0
@Thanks in advance for your help
-
Hi,
Window, Page, etc live in a separate components import, rather than in QtQuick. To include them in your application, you'll need to add an additional import statement. In this case, most likely:
@import com.nokia.symbian 1.0 //or 1.1@
Regards,
Michael -
Thanks! I thought I'd tried that but I guessed I messed up the syntax