Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QT 5.10 Expected token `numeric literal' bug
Forum Updated to NodeBB v4.3 + New Features

QT 5.10 Expected token `numeric literal' bug

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 4 Posters 5.8k Views 3 Watching
  • 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.
  • MikhailGM Offline
    MikhailGM Offline
    MikhailG
    wrote on last edited by MikhailG
    #1

    Hello I`m expierencing this strange bug in qt 5.10 but if I change the qt version to 5.8.0 everything works just fine. The error appears in this line if (lastKeyBoard !== let)

    import QtQuick 2.9
    import QtQuick.Window 2.2
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        property var lastKeyBoard: letRu
        function setKeyBoard(txt) {
    
            if(txt === "text")
            {
                if (lastKeyBoard !== let) // ERROR Expected token `numeric literal'
                    lastKeyBoard = letRu
                lastKeyBoard.visible = true
            }
        }
    }
    

    What could it be?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! What's letRu? let is a reserved keyword in Javascript.

      A 1 Reply Last reply
      2
      • MikhailGM Offline
        MikhailGM Offline
        MikhailG
        wrote on last edited by
        #3

        Yes it was the problem. Thank you. So the bug was in QT 5.8.0 apparently.

        1 Reply Last reply
        0
        • ? A Former User

          Hi! What's letRu? let is a reserved keyword in Javascript.

          A Offline
          A Offline
          aurora_ns
          wrote on last edited by
          #4

          Sir, I am a newbie. Can you please help me to? I haven't even started and got that error.
          https://forum.qt.io/topic/151582/qt-qml-execution-problem-after-installation?_=1698365642694

          RokeJulianLockhartR 1 Reply Last reply
          1
          • A aurora_ns

            Sir, I am a newbie. Can you please help me to? I haven't even started and got that error.
            https://forum.qt.io/topic/151582/qt-qml-execution-problem-after-installation?_=1698365642694

            RokeJulianLockhartR Offline
            RokeJulianLockhartR Offline
            RokeJulianLockhart
            wrote last edited by
            #5

            @aurora_ns, your thread is inaccessible to me. As post/824859 explains, qmlscene does not support the shebang. At least, not #!/usr/bin/env -S qml. Removing that remediated that error for me (although merely resurfaced post/830428). If the error is prepended with :1, it should for you.

            When using a forum, remember to tag the person you are responding to, in case they are not subscribed to the thread.

            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