Results 1 to 3 of 3

Thread: Cursor changes and stops blinking when mask is set on QLineEdit

  1. #1
    Join Date
    Sep 2010
    Location
    Bangalore
    Posts
    169
    Thanks
    59
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Cursor changes and stops blinking when mask is set on QLineEdit

    Hi Everyone,

    I am applying a mask on my QLineEdit as follows:-

    Qt Code:
    1. setInputMask("000.000.000.000;");
    To copy to clipboard, switch view to plain text mode 

    The problem that I am facing is as soon as I set the mask the cursor on the lineedit changes (it's width increases) and it stops blinking. How do I change it?


    -Thanks,
    Sattu

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Cursor changes and stops blinking when mask is set on QLineEdit

    The 'cursor' changes to a block (actually rendered as a selected character AFAICT) because you are overtyping the existing content of the mask rather then the more usual inserting (cursor is a vertical bar) into a blank edit. I am unaware of any way to change this behaviour without reimplementing QLineEdit::paintEvent().

  3. The following user says thank you to ChrisW67 for this useful post:

    sattu (10th May 2013)

  4. #3
    Join Date
    Sep 2010
    Location
    Bangalore
    Posts
    169
    Thanks
    59
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Cursor changes and stops blinking when mask is set on QLineEdit

    Thanks Chris,
    Are any examples or links present regarding such cases where mask and cursor could be customized using the paintEvent() of QLineEdit?

Similar Threads

  1. Replies: 8
    Last Post: 15th September 2021, 06:35
  2. QLineEdit and input mask
    By tpf80 in forum Qt Programming
    Replies: 7
    Last Post: 9th May 2014, 19:47
  3. Strange behaviour QLineedit with edit mask
    By vcp in forum Qt Programming
    Replies: 4
    Last Post: 6th May 2010, 12:01
  4. QLineedit mask
    By sudhansu in forum Qt Programming
    Replies: 11
    Last Post: 12th March 2010, 12:10
  5. Mixing QRegExpValidator and input mask and QLineEdit
    By abernat in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2009, 00:04

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.