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. QLineedit inputmask and settext
Qt 6.11 is out! See what's new in the release blog

QLineedit inputmask and settext

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.6k 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.
  • KutyusK Offline
    KutyusK Offline
    Kutyus
    wrote on last edited by Kutyus
    #1

    Hi!

    I have a form for editing the exact number floating with the qlinedit field. The input mask value is "0009.00; _".
    When I enter 3.10, the contents of the editor box will be 3 ___.10, but it should be ___ 3.10.
    What could be the problem?

    Thanks in advance

    Pl45m4P 1 Reply Last reply
    0
    • KutyusK Kutyus

      Hi!

      I have a form for editing the exact number floating with the qlinedit field. The input mask value is "0009.00; _".
      When I enter 3.10, the contents of the editor box will be 3 ___.10, but it should be ___ 3.10.
      What could be the problem?

      Thanks in advance

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Kutyus said in QLineedit inputmask and settext:

      What could be the problem?

      I think it has to do with the dot.
      You type 3 (first 0 set to 3), when you insert the dot, the cursor jumps to ____.0 (mask condition is fulfilled, as there is one required digit).
      So I think the dot messes this up.

      If you start with a dot, without typing any leading number, this ___.00 is possible too, even if there is a required digit on the left of the dot.

      IDK if this is intended but it seems, that the order of the mask characters gets ignored, when you type a given char and the cursor jumps to its position


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • KutyusK Offline
        KutyusK Offline
        Kutyus
        wrote on last edited by
        #3

        Sorry, I typed badly, I wanted to enter the value with the setText () method, then this will be the result.

        jsulmJ 1 Reply Last reply
        0
        • KutyusK Kutyus

          Sorry, I typed badly, I wanted to enter the value with the setText () method, then this will be the result.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Kutyus What happens if you set "0003.10"?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          KutyusK 1 Reply Last reply
          0
          • KutyusK Offline
            KutyusK Offline
            Kutyus
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • jsulmJ jsulm

              @Kutyus What happens if you set "0003.10"?

              KutyusK Offline
              KutyusK Offline
              Kutyus
              wrote on last edited by
              #6

              @jsulm
              It works, it's just complicated to produce a string, and I have several different ones.

              jsulmJ 1 Reply Last reply
              0
              • KutyusK Kutyus

                @jsulm
                It works, it's just complicated to produce a string, and I have several different ones.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Kutyus Did you try to disable the input mask, then set the string and then enable the input mask again?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                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