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

qml file cannot be opened in the design

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 8.0.1
    • Qt Creator 8.0.0
    • Quick Designer
    • None
    • Windows

    Description

      When I use the custom component in the qml page, the design page does not display and reports an error, as shown in the figure.

      The error reported is "test", so I don't know what to do.

       

      This is my code: txetEditor.qml

      import QtQuick
      import QtQuick.Controls
      import "../controls"
      
      Item {
          // Properties
          property string getText: textArea.text
          property string setText: ""
      
          Rectangle {
              id: rectangle
              color: "#2c313c"
              anchors.fill: parent
      
              Flickable {
                  id: flickable
                  anchors.fill: parent
                  clip: true
      
                  TextArea.flickable: TextArea{
                      id: textArea
                      background: Rectangle {
                          anchors.fill: parent
                          color: "#2c313c"
                      }
                      padding: 10
                      wrapMode: Text.WordWrap
                      textFormat: Text.AutoText
                      placeholderTextColor: "#f6fbff"
                      selectByMouse: true
                      selectedTextColor: "#ffffff"
                      selectionColor: "#ff007f"
                      color: "#ffffff"
                      font.pointSize: 12
                      text: setText
                  }
      
                  ScrollBar.vertical: CustomScrollBar {} // No error is reported if using the scrollbar  
      
              }
          }
      
      }
      

       

      And CustomScrollBar.qml:

      import QtQuick
      import QtQuick.Controls
      
      // ScrollBar consists of two visual items: background and content item.
      ScrollBar {
                      id: scrollBar
                      active: true
                      minimumSize: 0.3
                      position: 0.2
      
                      background: Rectangle {
                          anchors.fill: parent
                          color: "#2c314c"
                      }
      
                      contentItem: Rectangle {
                              implicitWidth: 10
                              implicitHeight: 100
                              radius: 6
                              color: scrollBar.pressed ? "#81e889" : "#c2f4c6"
                              // Hide the ScrollBar when it's not needed.
                              opacity: scrollBar.policy === ScrollBar.AlwaysOn || (scrollBar.active && scrollBar.size < 1.0) ? 0.75 : 0
      
                              // Animate the changes in opacity (default duration is 250 ms).
                              Behavior on opacity {
                                  NumberAnimation {}
                              }
                          }
      }
      
      

       

      Attachments

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

        Activity

          People

            thohartm Thomas Hartmann
            xxel Shiheng Xu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes