Hello friends,

when I declare a rectangle in a file:

TestRect.qml
Qt Code:
  1. import QtQuick 2.2
  2.  
  3. Rectangle {
  4. color : "green"
  5. anchors.fill: parent
  6. width: 30
  7.  
  8. }
To copy to clipboard, switch view to plain text mode 

and try to use it in main.qml



Qt Code:
  1. ApplicationWindow {
  2. id: root
  3. TestRect{
  4. id:myrect
  5. }
  6. }
To copy to clipboard, switch view to plain text mode 

Compiler says :

TestRect is not a type
So what is the point here?