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. Undefined ClickableImage type
Forum Updated to NodeBB v4.3 + New Features

Undefined ClickableImage type

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 792 Views 2 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.
  • Stan HuangS Offline
    Stan HuangS Offline
    Stan Huang
    wrote on last edited by
    #1

    This is kind of usually happening problem when I read Qt material and tried to run or parse its samples: xxx is not a type.
    This time I got sample from "Qt5 Cadaques" and it contains ClickableImage element. I parsed it using qmlscene but got "ClickableImage is not a type"

    My Qt installation is 5.11 and the imported command is to import QtQuick 2.5. Even I changed it to QtQuick 2.11, the same thing. I believe the book is much older than Qt 5.11. So, what's wrong with it? How do deal with such kinds of troubles?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Well, the QML engine is right - there is no ClickableImage component in Qt, and never has been.

      I suspect the example instructs you somewhere to create a new QML file, called ClickableImage.qml, right? Then QML engine will be able to find it, as long as it's in the same directory as your main.qml.

      (Z(:^

      1 Reply Last reply
      2
      • Stan HuangS Offline
        Stan HuangS Offline
        Stan Huang
        wrote on last edited by
        #3

        Yes, I found a snippet marked as ClickableImage.qml. That must the the file which I must put at the same folder as my target qml file.
        But I still wonder why there are some elements in Qt tutorial, such as Button, which must be very basic, was seen as 'not a type'. Do you think I need to find some modules, like Button.qml at some places of the tutorial?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          There is button in QtQuick.Controls 1 and QtQuick.Controls 2, you can add them by using import statement. The tutorial might, however, add a custom Button.qml. I can't say for sure without seeing the actual tutorial...

          (Z(:^

          1 Reply Last reply
          1

          • Login

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