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. Regarding TextField in qml
Qt 6.11 is out! See what's new in the release blog

Regarding TextField in qml

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 652 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.
  • Naveen_DN Offline
    Naveen_DN Offline
    Naveen_D
    wrote on last edited by Naveen_D
    #1

    Hi all,

    i am using a textfield in qml, i want the data whatever i enter should start from the center of the textfield, Also i want to remove the cursor from the textfield, how can i do this ? Thanks

    Naveen_D

    1 Reply Last reply
    0
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by
      #2

      For some reason cursorVisible: false is not respected, but you can override cursorDelegate as a workaround:

      TextField {
          cursorDelegate: Item { }
          horizontalAlignment: Qt.AlignHCenter
      }
      
      Naveen_DN 1 Reply Last reply
      2
      • jpnurmiJ jpnurmi

        For some reason cursorVisible: false is not respected, but you can override cursorDelegate as a workaround:

        TextField {
            cursorDelegate: Item { }
            horizontalAlignment: Qt.AlignHCenter
        }
        
        Naveen_DN Offline
        Naveen_DN Offline
        Naveen_D
        wrote on last edited by
        #3

        @jpnurmi thanks for the reply,
        but cursorDelegate i am not able to use in that. is there any other way ?

        Naveen_D

        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