Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt Quick Components Not a type
Forum Updated to NodeBB v4.3 + New Features

Qt Quick Components Not a type

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bluestreak
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bluestreak
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbrasser
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bluestreak
            wrote on last edited by
            #5

            Thanks! I thought I'd tried that but I guessed I messed up the syntax

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved