Results 1 to 4 of 4

Thread: how to show the taskbar after maximim the window?

  1. #1
    Join Date
    Dec 2009
    Posts
    18
    Thanks
    1

    Default how to show the taskbar after maximim the window?

    hi there,
    I create a window with flag
    FramelessWindowHint Code:
    1. FramelessWindowHint
    To copy to clipboard, switch view to plain text mode 
    , and customized the
    the titlebar, but when i pressed the maximim button, the window corvered the whole screen and the task bar.

    I have tried the below code to. but you know, after setGeometry, the window state will not be
    WindowMaximized any more.

    Is the any other way for my question ? thanks .
    Qt Code:
    1. if ( winCurState != Qt::WindowState::WindowMaximized )
    2. {
    3. m_parent->showMaximized();
    4. m_parent->setGeometry(qApp->desktop()->availableGeometry());
    5. m_parent->updateGeometry();
    6. m_maxButton->setIcon( m_pixRestore );
    7. }
    8. else
    9. {
    10. m_parent->showNormal();
    11. m_maxButton->setIcon( m_pixMax );
    12. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2008
    Posts
    52
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to show the taskbar after maximim the window?

    Hi cooper,

    The way of maximizing the window the two ways.. One is set the Geometry. and Second one is the setting maximize and minimize parametrers you can set as a acustom widget. so i think better go for pass the minimize and maximize the parameters.


    Qt Code:
    1. minimize->setMaximumSize(12,3);
    2. minimize->setMinimumSize(12,3);
    3. minimize->setGeometry(300,17,12,3);
    To copy to clipboard, switch view to plain text mode 


    Thanks and regards,
    Tavit.

  3. #3
    Join Date
    Dec 2009
    Posts
    18
    Thanks
    1

    Default Re: how to show the taskbar after maximim the window?

    Quote Originally Posted by Tavit View Post
    Hi cooper,

    The way of maximizing the window the two ways.. One is set the Geometry. and Second one is the setting maximize and minimize parametrers you can set as a acustom widget. so i think better go for pass the minimize and maximize the parameters.


    Qt Code:
    1. minimize->setMaximumSize(12,3);
    2. minimize->setMinimumSize(12,3);
    3. minimize->setGeometry(300,17,12,3);
    To copy to clipboard, switch view to plain text mode 


    Thanks and regards,
    Tavit.
    Hi, Tavit, thanks for your reply, I tried this way you mentioned before, But it seems not work well.
    The same action occured when i pressed the maximim button to invoke the showMaximized.

  4. #4
    Join Date
    Jun 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to show the taskbar after maximim the window?

    Hi, cooper.

    All you need to do is save your geometry before you maximize or minimize the widget, and call restoreGeometry replace of showNormal.

    I think these codes below gonna help you.


    Qt Code:
    1. void showSmall()
    2. {
    3. this->normalGeometry = this->saveGeometry();
    4. this->showMinimized();
    5. }
    6.  
    7.  
    8. void showMaxRestore()
    9. {
    10. if (maxNormal)
    11. {
    12. this->restoreGeometry(this->normalGeometry);
    13. maxNormal = !maxNormal;
    14. maximize->setIcon(maxPix);
    15. }
    16. else
    17. {
    18. this->normalGeometry = this->saveGeometry();
    19. this->showMaximized();
    20. this->setGeometry(qApp->desktop()->availableGeometry());
    21. maxNormal = !maxNormal;
    22. maximize->setIcon(restorePix);
    23. }
    24. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Show advertising window
    By jano_alex_es in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2010, 13:03
  2. Hiding a window from the taskbar
    By andyp in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2009, 19:34
  3. Replies: 2
    Last Post: 14th October 2008, 10:05
  4. hide from taskbar but show to ALT-TAB
    By musikit in forum Qt Programming
    Replies: 0
    Last Post: 15th August 2008, 17:14
  5. Parentless window with no taskbar entry
    By durbrak in forum Qt Programming
    Replies: 6
    Last Post: 14th December 2006, 14:46

Tags for this Thread

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.