Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is IDE capable of warning about mistakes in qml file?

Is IDE capable of warning about mistakes in qml file?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt creator 3.5
3 Posts 2 Posters 928 Views
  • 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.
  • W Offline
    W Offline
    Wodzu
    wrote on last edited by
    #1

    Hello guys,

    This is my first day with Qt, I've tried to write first application based on the example: http://doc.qt.io/qtcreator/qtcreator-transitions-example.html

    Everything seemed working until the last steps of tutorial. After clicking on one of the rectangles, the icon should change its position but it hasn't worked for me. Here is the example code for one of the rectangles:

        Rectangle {
            id: bottomLeftRect
            width: 44
            height: 44
            color: "#00000000"
            radius: 6
            border.width: 1
            anchors.left: parent.left
            anchors.leftMargin: 10
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 20
    
            MouseArea {
                id: mouseArea3
                anchors.fill: parent
                onClicked: StateGroup.state = 'State2'
            }
        }
    
        StateGroup {
               id: stateGroup
               states: [
                   State {
                       name: "State1"
    
                       PropertyChanges {
                           target: icon
                           x: middleRightRect.x
                           y: middleRightRect.y
                       }
                   },
                   State {
                       name: "State2"
    
                       PropertyChanges {
                           target: icon
                           x: bottomLeftRect.x
                           y: bottomLeftRect.y
                       }
                   }
               ]
        }
    

    After spending a quite a lot of time I figured out where the problem is:

                onClicked: StateGroup.state = 'State2'
    

    I've entered a bad identifier name, it should be "stateGroup".

    Why IDE hasn't warned me about this error during build process? I've discovered that I can write a lot of nonesense in this file and IDE is silent about this. Can I do something about this because in its current state it is quite hard to develop an application by somone new to Qt.

    I am using an opoen source Qt Creator 3.5.1

    Thank you for your time.

    As above so below...

    1 Reply Last reply
    0
    • W Offline
      W Offline
      Wodzu
      wrote on last edited by
      #2

      Really no answer? I would thought that this is a pretty basic question...

      As above so below...

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You can use CTRL+SHIFT+C to run checks on your QML.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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