Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Shift text in TextField

Shift text in TextField

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 257 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.
  • M Offline
    M Offline
    Mihaill
    wrote on last edited by
    #1

    Hi!
    How I can shift text on vertical in TextField? Paddin can't help me.

    import QtQuick 2.15
    import QtQml 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.15
    
    TextField {
        signal timeChanged(var time)
    
        width: height * 4
        height: 70
    //    verticalAlignment: TextInput.AlignBottom
        horizontalAlignment: TextInput.AlignHCenter
        font.pixelSize: height * 0.8
         text: "00:00:00"
         inputMask: "99:99:99"
         validator: RegExpValidator { regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s]):([0-5\s][0-9\s])$ / }
         inputMethodHints: Qt.ImhDigitsOnly
    
         onDisplayTextChanged: {
             if (getTime() != "Invalid Date") {
                 timeChanged(getTime())
             }
         }
    
         function getTime() {
             return Date.fromLocaleTimeString( Qt.locale(), displayText, "hh:mm:ss")
         }
    }
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mihaill
      wrote on last edited by
      #2

      padding: 0 help me

      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