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. Right aligned QLineEdit with an input mask: looks weird
Forum Updated to NodeBB v4.3 + New Features

Right aligned QLineEdit with an input mask: looks weird

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

    Hi,

    I am trying to create a line edit that only accepts digits, and that should be right aligned. In theory, this is easy: set an appropriate input mask, and set the aligment to right. Problem is, that alignment does not seem to work when a mask has been set. I did not see that limitation mentioned in the documentation.

    The input mask I tried to use was "#9999999990;"

    Am I overlooking something trivial here?

    Edit: I know that QSpinBox does work, but that is not the question here.

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      I think "QwwLineEdit":http://www.wysota.eu.org/wwwidgets/ does that. But i'm not sure.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MarekR22
        wrote on last edited by
        #3

        Did you try use Qt::AlignAbsolute flag?

        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