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. SpinBox QML Type
Forum Updated to NodeBB v4.3 + New Features

SpinBox QML Type

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 422 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.
  • P Offline
    P Offline
    PSI_lbc
    wrote on last edited by
    #1

    So in releases prior to 5.13 the spin box control had a "decimal" place property.

    Now it appears to have a place for a Validator property.

    If you use the Designer to make your forms, there doesn't appear a way to create a spinbox with a validator so you can have decimals. You can't add the {} functionality when using the Designer.

    The Help shows 2 SpinBox QML Type definitions on that uses a import QtQuick.Controls 2.5 (validator) and another import QtQuick.Controls 1.4 (decimal)

    The Help show the decimal flavor available since Qt 5.1, yet in the 5.13 install there isn't an option to select the QtQuick.Controls 1.4 on the Designer Import tab.

    I need a control with decimals. What am I missing?

    J.HilkJ 1 Reply Last reply
    0
    • P PSI_lbc

      So in releases prior to 5.13 the spin box control had a "decimal" place property.

      Now it appears to have a place for a Validator property.

      If you use the Designer to make your forms, there doesn't appear a way to create a spinbox with a validator so you can have decimals. You can't add the {} functionality when using the Designer.

      The Help shows 2 SpinBox QML Type definitions on that uses a import QtQuick.Controls 2.5 (validator) and another import QtQuick.Controls 1.4 (decimal)

      The Help show the decimal flavor available since Qt 5.1, yet in the 5.13 install there isn't an option to select the QtQuick.Controls 1.4 on the Designer Import tab.

      I need a control with decimals. What am I missing?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @psi_lbc
      hi, i don‘t use the editor for qml, so I can‘t help here, but the docs have an example, how to modify the normal spinbox to work with decimals:

      https://doc.qt.io/qt-5/qml-qtquick-controls2-spinbox.html#custom-values

      hope it helps!


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      P 1 Reply Last reply
      0
      • J.HilkJ J.Hilk

        @psi_lbc
        hi, i don‘t use the editor for qml, so I can‘t help here, but the docs have an example, how to modify the normal spinbox to work with decimals:

        https://doc.qt.io/qt-5/qml-qtquick-controls2-spinbox.html#custom-values

        hope it helps!

        P Offline
        P Offline
        PSI_lbc
        wrote on last edited by
        #3

        @j-hilk

        Thanks. LOL. Yeah, I had that example open. The last app I wrote, I hand did all the QML forms for the UI. That was because the Designer tool was "not quite there" at the time. It seems to work much better now, BUT... There always seems to be the "but". The designer won't allow you to inter-mingle the form design with {} Java-code scripting...which really makes it for design only.

        I guess the frustrating thing I'm running up against is that the Help definitely shows the two SpinBox options QtQuick.Controls 1.4 and 2.5, but with the install I have..a clean install of Qt5.13 I don't even have the QtQuick.Controls 2.5 but rather 2.2. Go figure.

        IDK. Maybe the Designer is just meant to develop a basic UI..then the developer is supposed to add their Java-code features. But once you manually add any Java-code, the Designer won't load the QML form any longer.

        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