Results 1 to 5 of 5

Thread: QWorkspace

  1. #1
    Join Date
    Feb 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QWorkspace

    I have a QWorkspace that has MDI's within them. I have a grab the signal sent out and plug it into a slot when one of the MDI's is activated this passes me the QWidget of the MDI that is activated but I want to know the QWidget of the MDI that just lost focus (or the one that gets deactivated.)

    Looking at the code it looks like they just go and deactivate all other windows and I don't see them sending any signals out of the window loosing focus. Does anyone know of how they do this?

  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: QWorkspace

    Maybe it will be enough if you just save a pointer to the current active window somewhere?

  3. #3
    Join Date
    Feb 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWorkspace

    Yes, thanks for the comments, I did this but thought it would be nice to have a signal/slot available....

    Another questions:
    What about close; if someone closes a MDI child does it send out an event closeAcitveWindow()? Or how do you realize if something is closed?

    I know I can go through the list of windows but really would like to have a QWorkspace send out a signal telling me that something was closed!

  4. #4
    Join Date
    Feb 2006
    Posts
    27
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWorkspace

    So I finally found the way to do this and in retrospect I can't see why I didn't see this before. But what I did is in the QWidget that I add to the workspace I overwrote the closeEvent and then sent out a signal saying that I was closing. Then I connected that with my mainwindow to get the event. It wasn't the ideal solution but it will work.

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QWorkspace

    Quote Originally Posted by fellobo
    Another questions:
    What about close; if someone closes a MDI child does it send out an event closeAcitveWindow()? Or how do you realize if something is closed?
    One simple solution could be to install an event filter on all MDI childs and detect the close event that way.

    Quote Originally Posted by fellobo
    I know I can go through the list of windows but really would like to have a QWorkspace send out a signal telling me that something was closed!
    Agreed. QWorkspace could provide more signals, indeed..
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    fellobo (28th April 2006)

Similar Threads

  1. QWorkspace: child window layouts?
    By LiCodeX in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2008, 07:50
  2. Replies: 5
    Last Post: 28th September 2007, 10:23
  3. Problem combining QWorkspace & QGLWidget
    By Nb2Qt in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2006, 21:45
  4. Designer and QWorkspace
    By brcain in forum Qt Tools
    Replies: 2
    Last Post: 14th September 2006, 16:38
  5. Retrieving offsets of scroll in QWorkspace
    By hardgeus in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 02:25

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.