Results 1 to 4 of 4

Thread: active child

  1. #1
    Join Date
    Mar 2006
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 3 Posts

    Default active child

    i have QSplitter and 2 QTextEdit's in it
    i need to know which TextEdit is current now (textEdit, where cursor is visible)

    how i can do it?

  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: active child

    use QWidget::hasFocus() to find which one is active.

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

    Default Re: active child

    QApplication::activeWindow() is fine too, and you don't have to try each widget for focus this way

  4. #4
    Join Date
    Mar 2006
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 3 Posts

    Default Re: active child

    thanx all - now it work

Similar Threads

  1. Qt application with live Active X camera feed.
    By bitChanger in forum Qt Programming
    Replies: 8
    Last Post: 4th September 2012, 19:26
  2. Rendering 3D Objects on Ubuntu
    By Sandip in forum Qt Programming
    Replies: 3
    Last Post: 19th January 2009, 14:29
  3. How to close parent window from child window?
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 14th October 2008, 11:40
  4. Problem with Painter in Qt4.4.1
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 1st September 2008, 13:47
  5. child label alignment problem
    By ht1 in forum Qt Programming
    Replies: 9
    Last Post: 21st November 2007, 20:50

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.