Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Property substituted with 0 in QML

Property substituted with 0 in QML

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 280 Views 2 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.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by Mark81
    #1

    I'm facing an annoying problem. I'm editing a QML file, here an extract:

    Rectangle {
        id: root
        visible: true
        color: "black"
    
        readonly property int xText: 100
        readonly property int yText: 210
        readonly property int fontSize: 96
    
        FontLoader {
            id: myfont_bold
            source: "qrc:/font/MyFont Bold.ttf"
        }
    
        Text {
            x: xText
            y: yText
            color: "white"
            horizontalAlignment: Text.AlignRight
            font.family: myfont_bold.name
            font.pixelSize: fontSize
            text: "30"
        }
    }
    

    When I move away from line font.pixelSize: fontSize or even just compile, the editor changes this line to:

    font.pixelSize: 0
    

    This doesn't happens every time, but quite often. What's wrong here?
    I'm using Qt5.11.1 and QtCreator 4.8.1.

    UPDATE: I've just discovered it replace also literal values, like font.pixelSize: 96. In this case the "edited" line is quite weird:

    font.pixelSize: 966
    

    or

    font.pixelSize:96
    

    or something else...

    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