Results 1 to 7 of 7

Thread: QLineEdit

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Posts
    78
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Re: QLineEdit

    The QLineEdit could be any one of a number of lineEdits. I would have to track which one had focus and was currently being edited so the "save" function could be sure it had the most recent data.

    There are a few different ways to track which QLineEdit had focus at the time of the "save" call but all implement more overhead. I guess I am not really seeing an easy solution.

    Thank you for the suggestions Wysota.

    Bob

  2. #2
    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: QLineEdit

    Quote Originally Posted by coderbob View Post
    The QLineEdit could be any one of a number of lineEdits. I would have to track which one had focus and was currently being edited so the "save" function could be sure it had the most recent data.
    You don't have to track anything, you can ask the application for the widget that currently has focus and check if its one of your line edits. Or you can just iterate over all your lineedits and save any that is marked as modified.

  3. #3
    Join Date
    Oct 2007
    Posts
    78
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Re: QLineEdit

    Lol you respond faster than I can edit my posts. I was looking at QApplication::focusWidget() and figured I could just force the update in the "save" function with that information.

    Bob

Similar Threads

  1. QLineEdit and focus
    By serega in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2008, 01:49
  2. how to get last character of QLineEdit
    By yagabey in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2008, 17:38
  3. closeEditor() not always closing QLineEdit
    By mclark in forum Qt Programming
    Replies: 8
    Last Post: 27th November 2007, 02:44
  4. Problem Euro Sign with QLineEdit
    By Kubil in forum Qt Programming
    Replies: 1
    Last Post: 24th August 2007, 05:56
  5. QValidator, regular expressions and QLineEdit
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 02:25

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.