Results 1 to 2 of 2

Thread: How can i ask if a qlineedit get focus..

  1. #1
    Join Date
    Feb 2006
    Posts
    16
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default How can i ask if a qlineedit get focus..

    Hi,

    I need to execute a function when a qlineedit "le1" get the focus.
    Could somebody tell me how ask about it?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can i ask if a qlineedit get focus..

    As the docs say:
    focus : const bool
    This property holds whether this widget (or its focus proxy) has the keyboard input focus.
    Effectively equivalent to QApplication::focusWidget() == this.
    Access functions:
    bool hasFocus () const

    See also setFocus(), clearFocus(), setFocusPolicy(), and QApplication::focusWidget().
    If you want to know when the line edit gets the focus, you might try using an event filter.

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

    otortos (7th April 2006)

Similar Threads

  1. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 16:13
  2. QLineEdit and focus
    By serega in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2008, 01:49
  3. QLineEdit Focus
    By sulagnp in forum Qt Programming
    Replies: 1
    Last Post: 15th January 2008, 12:25
  4. QLineEdit lost focus
    By codebehind in forum Newbie
    Replies: 5
    Last Post: 4th May 2007, 17:02
  5. Tab/Enter focus problem
    By b1 in forum Qt Programming
    Replies: 4
    Last Post: 24th October 2006, 00:34

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.