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. TypeError: Type error realValue.toFixed
Forum Updated to NodeBB v4.3 + New Features

TypeError: Type error realValue.toFixed

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.1k 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.
  • T Offline
    T Offline
    themts
    wrote on last edited by
    #1

    Hey guys,

    I have a problem with real to string conversion in qml.
    I have a slider and I want to assign the sliderValue to a textFields' text.

    Slider {
       id: ampSlider
    ...
       onValueChanged: txtAmplitude.text = ampSlider.value.toFixed(1)
    }
    

    At runtime I get this error-message: qrc:/ControlTab.qml:151: TypeError: Type error

    I don't see whats wrong here.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Daniel Vaz
      wrote on last edited by
      #2

      Hi,

      Try to do it. instead of use ampSlider.value.toFixed(1) use just value.toFixed(1)

      Best regards.

      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