Results 1 to 6 of 6

Thread: regarding QApplication::focusWidget ()

  1. #1
    Join Date
    Dec 2006
    Posts
    123
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default regarding QApplication::focusWidget ()

    hi...

    can anyone say me what value will the following function return:

    QApplication::focusWidget () .

    or else how is it used...?

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: regarding QApplication::focusWidget ()

    From the docs

    Returns the application widget that has the keyboard input focus, or 0 if no widget in this application has the focus.
    Lets say you have an application which has 4 Input Boxes and you need to access the input box that currently has focus. You can use the above function for it.

    I know it's a very bad example, but you get the idea, rite?

  3. #3
    Join Date
    Dec 2006
    Posts
    123
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: regarding QApplication::focusWidget ()

    suppose if we have input boxes in some other application. can we use this function....?

  4. #4
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: regarding QApplication::focusWidget ()

    No you cannot.

  5. #5
    Join Date
    Dec 2006
    Posts
    123
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: regarding QApplication::focusWidget ()

    will the following function work as it says "Returns the application widget that has the keyboard input focus, or 0 if no widget in this application has the focus":
    QApplication::focusWidget ()

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: regarding QApplication::focusWidget ()

    It means it will return a widget from YOUR application, not from ANY application. The last part of the sentence quoted suggests that as well.

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.