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. Laying out multiple text fields in a single line for date edit
Forum Updated to NodeBB v4.3 + New Features

Laying out multiple text fields in a single line for date edit

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

    Hi there!

    I am trying to make a better date edit than QDateEdit, which is quite clunky. I want to lay out a day, month, and year edits on the same line with slashes in between, like Apple's Calendar app (see screenshot). But how to get the spacing right? I used QFontMetrics to calculate the character width but this is slightly inaccurate across versions of macOS.

    Thoughts? Anyone seen a better date edit?

    0_1523157031400_2018-04-07_20-07-08.jpg

    https://alaskafamilysystems.com/

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

      Hi
      Cant you use a mask ?
      http://doc.qt.io/qt-5/qlineedit.html#inputMask-prop

      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