Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Error while running qt code in imx6 version 5.9.2

Error while running qt code in imx6 version 5.9.2

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 813 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.
  • J Offline
    J Offline
    JasmineSethi
    wrote on last edited by
    #1

    I am using imx6 with version 5.9.2
    When i am ruuning qt code its giving error as:

    1. Unexpected token `reserved word'
    2. qrc:/..... Expected token `:'

    What is this error about? Also i am using enum in my code, is this the reason?
    If yes then how this error can be eliminatied?

    My enum structure look like this :
    enum TEST_TYPE
    {
    TEST_ONGOING,
    TEST_FAIL,
    TEST_CONDITIONAL_OUTCOME,
    TEST_PASS
    }

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

      Is this a runtime error or compilation error? Does the app work when launched on a desktop?

      From the error messages I guess that you have something wrong in your QRC file or call. But you have to provide more code for me to check that.

      (Z(:^

      J 1 Reply Last reply
      0
      • sierdzioS sierdzio

        Is this a runtime error or compilation error? Does the app work when launched on a desktop?

        From the error messages I guess that you have something wrong in your QRC file or call. But you have to provide more code for me to check that.

        J Offline
        J Offline
        JasmineSethi
        wrote on last edited by
        #3

        @sierdzio
        Its a run time error. Yes its working fine in Desktop.

        Complete code:

        import QtQuick 2.0
        import QtQuick.Layouts 1.3
        import QtQuick.Controls 2.5

        Item
        {
        id: mainStatusIndicator

        QtObject
        {
            id: properties
            property int btnWidth: mainStatusIndicator.width
            property int btnHeight: mainStatusIndicator.height
        
            property string statusindicatorColor
        
            property string blueColor: "blue"
            property string redColor: "red"
            property string yellowColor: "yellow"
            property string greenColor: "green"
            property string grayColor: "#7B7D7D"
            property string blackColor: "black"
        
        }
        
        enum TEST_TYPE
        {
            TEST_ONGOING,
            TEST_FAIL,
            TEST_CONDITIONAL_OUTCOME,
            TEST_PASS
        }
        
        function setTestType(type)
        {
            properties.statusindicatorColor = type
        
            if(type === StatusIndicatorWidget.TEST_TYPE.TEST_ONGOING)
            {
                properties.statusindicatorColor = properties.blueColor
            }
            else if(type === StatusIndicatorWidget.TEST_TYPE.TEST_FAIL)
            {
                properties.statusindicatorColor = properties.redColor
            }
            else if(type === StatusIndicatorWidget.TEST_TYPE.TEST_CONDITIONAL_OUTCOME)
            {
                properties.statusindicatorColor = properties.yellowColor
            }
            else if(type === StatusIndicatorWidget.TEST_TYPE.TEST_PASS)
            {
                properties.statusindicatorColor = properties.greenColor
            }
        }
        
        Rectangle
        {
            id: firstCircle
            width: height
            height: Math.min(parent.width,parent.height)
            radius: width/2
            color: properties.grayColor
            Rectangle
            {
                id: secondCircle
                width: firstCircle.width * 0.80
                height: firstCircle.height * 0.80
                radius: width/2
                color: properties.blackColor
                anchors.centerIn: parent
        
                Rectangle
                {
                    id: thirdCircle
                    width: secondCircle.width * 0.70
                    height: secondCircle.height * 0.70
                    radius: width/2
                    color: properties.statusindicatorColor
                    anchors.centerIn: parent
                }
            }
        }
        

        }

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

          The ability to declare enumerations in QML was introduced in Qt 5.10.

          You need to bump your import to import QtQuick 2.10 at least. And yes, that means this code will not work on Qt 5.9.2 which you are using on your embedded board.

          (Z(:^

          1 Reply Last reply
          2

          • Login

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