Results 1 to 4 of 4

Thread: Issue with isActiveWindow()

  1. #1
    Join Date
    Jun 2008
    Posts
    25
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default Issue with isActiveWindow()

    In the examples\mainwindows\mdi

    i tried the following code

    Qt Code:
    1. QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
    2. foreach (QMdiSubWindow *pSubWindow, windows)
    3. {
    4. bActive = pSubWindow->isActiveWindow();
    5. bHasFocus = pSubWindow->hasFocus();
    6. }
    To copy to clipboard, switch view to plain text mode 

    I tried with 3 subwindows. Even though only one is active [ie selected], all the subwindows are giving the status as active....Also none of the subwindows are having the focus...Why..?

  2. #2
    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: Issue with isActiveWindow()

    I'd say this is because those methods are not related to QMdiSubWindow but to the top-level window of your application (which is active). Use QMdiArea::activeSubWindow() to query for the active subwindow.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2008
    Posts
    25
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default Re: Issue with isActiveWindow()

    I have to use the code within plugins and there is NO acces to the main application MdiArea....
    Last edited by George Neil; 30th September 2009 at 12:06. Reason: updated contents

  4. #4
    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: Issue with isActiveWindow()

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Linux -> Windows port issue (signals)
    By robertogoberto in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2009, 07:44
  2. Replies: 8
    Last Post: 27th April 2009, 19:19
  3. Replies: 1
    Last Post: 28th October 2008, 16:29
  4. qt4.4 pc specs requirements or qt3 support issue?
    By triperzonak in forum Installation and Deployment
    Replies: 0
    Last Post: 9th August 2008, 02:40
  5. qt3 to qt4 - uic issue
    By hvengel in forum Qt Programming
    Replies: 10
    Last Post: 4th March 2007, 02:59

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.