Results 1 to 2 of 2

Thread: How to restore removed widget from QMdiArea ?

  1. #1
    Join Date
    Oct 2008
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to restore removed widget from QMdiArea ?

    Hi,

    Simple question to witch i cannot find answer. I remove widget from QMdiArea and want that removed widget appear as separate window. But cannot understand how to do it. Part of class... It just removes widhet from mdiarea and tries to make it separate window. But it just not works... Should i pass something more? "this" in this function is just Widget.

    Qt Code:
    1. void ChatWindow::separateWindowClicked()
    2. {
    3. if (this->mdiArea)
    4. {
    5. QMdiSubWindow *currentSub = this->mdiArea->activeSubWindow();
    6. if (currentSub){
    7. this->mdiArea->removeSubWindow(currentSub);
    8.  
    9. this->activateWindow();
    10. this->setVisible(true);
    11. this->show();
    12. }
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2008
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to restore removed widget from QMdiArea ?

    Nevermind... Just find out...

    Qt Code:
    1. void ChatWindow::separateWindowClicked()
    2. {
    3. if (this->mdiArea)
    4. {
    5. QMdiSubWindow *currentSub = this->mdiArea->activeSubWindow();
    6. if (currentSub){
    7. this->mdiArea->removeSubWindow(currentSub);
    8. currentSub->show();
    9. }
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Widget Focus
    By navi1084 in forum Qt Programming
    Replies: 6
    Last Post: 29th September 2008, 10:22
  3. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 22:29
  4. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 20:39
  5. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35

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.