Results 1 to 4 of 4

Thread: Auto commit in QLineEdit in QTableWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Auto commit in QLineEdit in QTableWidget

    If you want to restrict QLineEdit's input, use an inputMask (set to "9" in your case -- this allows a single digit [0-9]).

  2. #2
    Join Date
    Jan 2006
    Location
    England
    Posts
    20
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Auto commit in QLineEdit in QTableWidget

    In the end I revised my whole approach. Now I install an eventFilter on the table which only when it recieves keys 1-9 it sets the numbers and ignores all other key presses. It's got exactly the functionallity I need and it does away with the mess of a custom delegate I was using which never seems to work the way it should.

Similar Threads

  1. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 16:13

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
  •  
Qt is a trademark of The Qt Company.