Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-4198

import "." 1.0 inside a qml library does not work

    XMLWordPrintable

Details

    • 7b25f438c67c7cf395ccd2cd846e5d413f6d9222

    Description

      Qt Components use import "." 1.0 inside e.g. Button.qml (instead of an explicit 'import com.meego 1.0' or 'import com.nokia.symbian 1.0'). This is done to support the so called native components and there for keep the components uri agnostic:

      com/nokia/symbian/Button.qml
      import Qt 4.7
      import "." 1.0 // defines ImplicitSizeItem
      
      ImplicitSizeItem {
         // ...
      }
      

      However, it seems the Qt Creator metatype system cannot resolve import "." in this case: Button is not derived from SDeclarativeImplicitSizeItem/QDeclarativeItem anymore and therefore has no e.g. width/height property.

      Also, since the Qt Quick Designer relies on the meta system of the text editor, the designer cannot work properly with Button and will complain that (e.g.) Button has no height property.

      How to reproduce

      import QtQuick 1.0
      import com.nokia.symbian 1.0
      
      Rectangle {
          height: 360
          visible: true
      
          Button {
              width: 200
              height: 200
              text: "Okay"
              checked: false
          }
      }
      
      • width, height properties are underlined in text editor
      • Open the file in Quick Designer fails because of width, height being unknown properties

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            erikv Erik Verbruggen
            thohartm Thomas Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes