Results 1 to 4 of 4

Thread: QLineEdit Focus

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default QLineEdit Focus

    Hi there,

    I have a simple question. I checked out the forum but I couldn't find the proper solution. I want to know if there is a signal to be emitted when the widget(particularly QLineEdit for my situation) when the widget grabs focus.

    Thanks in advance.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QLineEdit Focus

    there is no such signal. but you can install event filter and catch QEvent::FocusOut/FocusIn event.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: QLineEdit Focus

    Hımm,

    So I would reimplement focusInEvent(). But where?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QLineEdit Focus

    actually you dont need to reimplement that method just install event filter for needed object and catch needed event. read this eventFilter.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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. How can i ask if a qlineedit get focus..
    By otortos in forum Newbie
    Replies: 1
    Last Post: 7th April 2006, 19:23

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.