Results 1 to 2 of 2

Thread: Help me about showNormal in QWorkspace

  1. #1
    Join Date
    Jun 2006
    Location
    Vietnam
    Posts
    59
    Thanks
    17
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Help me about showNormal in QWorkspace

    I create 2 windows (class MyWidget inherited from QWidget) and add to QWorkspace. I have a question:

    Qt Code:
    1. MyWidget *widget1 = new QWidget(this);
    2. workspace->addWidget(widget1);
    3. widget1->showMaximize();
    4.  
    5. MyWidget *widget2 = new QWidget(this);
    6. workspace->addWidget(widget2);
    7. widget2->showNormal();
    To copy to clipboard, switch view to plain text mode 

    If i show in order: widget1, widget2; widget2 allways show in maximize although i use widget2->showNormal(). I know this problem: the after window is affected by the before window. If workspace doesn't have any windows, i show widget2 first, widget2 will show normal. I need a help: if i open widget1 in maximize, then i show widget2 in normal and it allway show normal and it is affected by the before window.

    Thanks
    Last edited by wysota; 24th October 2006 at 21:50. Reason: missing [code] tags

  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: Help me about showNormal in QWorkspace

    Try something like this:
    Qt Code:
    1. QWidget *active = workspace->activeWindow();
    2. if(active && active->isMaximized()) active->showNormal();
    3. workspace->addWidget(widget2);
    4. widget2->showNormal();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Designer and QWorkspace
    By brcain in forum Qt Tools
    Replies: 2
    Last Post: 14th September 2006, 16:38
  2. Qworkspace
    By weepdoo in forum Qt Tools
    Replies: 4
    Last Post: 24th July 2006, 10:37
  3. MDI windows without QWorkspace
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 16th June 2006, 17:15
  4. Retrieving offsets of scroll in QWorkspace
    By hardgeus in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 02:25
  5. QWorkspace
    By fellobo in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2006, 19:31

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.