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. How to force QTableView cell to decimal input only?!

How to force QTableView cell to decimal input only?!

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.2k 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.
  • MucipM Offline
    MucipM Offline
    Mucip
    wrote on last edited by
    #1

    Hi,
    I have QStandartItemModel in my form and I want to force specific cell to input decimal numbers only.

    How can I do that? I searched forum and saw delegate use but 6 yeras before. Maybe it can be better and esier way to do this?

    I have invoice detail input QTableView and want to input unit quantity...

    Regards,
    Mucip:)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean an editor that uses a QSpinBox like shown in the Spin Box Delegate Example ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • MucipM Offline
        MucipM Offline
        Mucip
        wrote on last edited by
        #3

        Hi,
        I checked. Yes. I got finally. But I couldn't increas the decimal points. I got only 2 decimal digit. But I want to use 6 decimal after the point? How can I do that?...

        Regards,
        Mucip:)

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Use the doc Luke: QSpinBox maximum property

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • MucipM Offline
            MucipM Offline
            Mucip
            wrote on last edited by
            #5

            Hi,
            As a standart spinbox use like 0.00.
            But I need to use 0.000000 like numbers..

            Regards,
            Mucip:)

            1 Reply Last reply
            0
            • MucipM Offline
              MucipM Offline
              Mucip
              wrote on last edited by
              #6

              Hi,
              I see. Ok...
              I guess I need to use doublespinbox delegate...

              Regards,
              Mucip:)

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved