Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to prohibit user from changing the cursor position in QLineEdit in touch based user interface
QtWS25 Last Chance

How to prohibit user from changing the cursor position in QLineEdit in touch based user interface

Scheduled Pinned Locked Moved Solved Mobile and Embedded
qlineedit
3 Posts 2 Posters 1.2k 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.
  • S Offline
    S Offline
    Sidii
    wrote on last edited by
    #1

    Dear All,

    I have made the blinking cursor invisible in QLineEdit by using QProxyStyle [by setting the width=0]
    Now i don't want the user to change the cursor location by touching the QLineEdit widget.

    Since the cursor is already invisible to user but some how if user touch the QLineEdit widget at some empty space then the cursor location gets changed and characters get inserted at wrong place. Is there any easy way to prohibit the user from changing the cursor location?

    Kindly provide me some hints to achieve the same.

    Thanks

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

      Hi,

      What do you want to do with that line edit ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        What do you want to do with that line edit ?

        S Offline
        S Offline
        Sidii
        wrote on last edited by
        #3

        Dear @SGaist, Thanks for the reply. Actually i do not want user to change the cursor position. I got one work around. I have connected the cursor position changed signal to one slot which automatically sets the cursor position to the end. The slot first calculate the text length and then moves the cursor to the last position. So in this case even if user tries to change the cursor location, cursor automatically comes at the end and whatever the user types is appended to the end.

        Regards
        Sid

        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