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. Set position in TextField
Forum Updated to NodeBB v4.3 + New Features

Set position in TextField

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

    Hey, I have a TextField, which's content is longer than its own width, thus I can only see the end portion of its content (Its "scrolled" to the end). Is there a way to always show the content form the beginning? I've tried setting cursorPosition, but it did not do the trick.

    Thanks for any help in advance

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Creaperdown
      wrote on last edited by
      #3

      Thanks, but I just solved it by using:

      if(!inputField.activeFocus)
                                  inputField.cursorPosition = 0;
      

      at the onTextChanged event

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #2

        Try with ensureVisible(0). It should work.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        1
        • C Offline
          C Offline
          Creaperdown
          wrote on last edited by
          #3

          Thanks, but I just solved it by using:

          if(!inputField.activeFocus)
                                      inputField.cursorPosition = 0;
          

          at the onTextChanged event

          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