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. Qt.createQmlObject bug?
Forum Updated to NodeBB v4.3 + New Features

Qt.createQmlObject bug?

Scheduled Pinned Locked Moved Solved General and Desktop
qt.createqmlobjbug
3 Posts 2 Posters 1.0k Views 1 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.
  • A Offline
    A Offline
    Archie888
    wrote on last edited by Archie888
    #1

    Hi,

    I think I found a bug in Qt.createQmlObject in Qt 5.4...

    If in the given QML if I use the word 'function' in a string element, when defining an array, I get a parsing error. Or so it seems to be with this one file I'm working on.

    For example:

    var arr = [
    "function",
    "something"
    ]
    
    

    Could anyone with a reasonably fresh Qt version verify if this issue has been solved?

    Cheers,
    -A888

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

      Hi! Cannot confirm this behaviour. The following works for me (Qt 5.6.0, x86_64 Linux):

      Qt.createQmlObject('import QtQuick 2.6; Rectangle {color: "red"; width: 100; height: 100; function nix(){ var arr=["function","two"]; console.log(arr)} Component.onCompleted:nix() }', mainWindow, "dynamicSnippet1");
      
      1 Reply Last reply
      1
      • A Offline
        A Offline
        Archie888
        wrote on last edited by
        #3

        @Wieland said:

        Qt.createQmlObject('import QtQuick 2.6; Rectangle {color: "red"; width: 100; height: 100; function nix(){ var arr=["function","two"]; console.log(arr)} Component.onCompleted:nix() }', mainWindow, "dynamicSnippet1");

        Good to hear, must be solved then. Thanks!

        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