Results 1 to 9 of 9

Thread: Problems with showMaximize()

  1. #1
    Join Date
    Jan 2010
    Location
    Kursk, Russia
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problems with showMaximize()

    I hide window title:
    cMainWindow::cMainWindow( QWidget* parent /*= 0*/ )
    : QMainWindow(parent, Qt::CustomizeWindowHint),
    {
    }

    and I have slot to maximize/showNormal the window
    void cMainWindow::toggleMaximize()
    {
    isMaximized() ? showNormal() : showMaximized();
    }

    While I maximize window it overlapped taskbar as if I use showFullScreen()
    How to solve this problem?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problems with showMaximize()

    How to solve this problem?
    What problem?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2010
    Location
    Kursk, Russia
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems with showMaximize()

    I need only maximize window without title. but it become fullScreen insted of maximize

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problems with showMaximize()

    Try using Qt::FramelessWindowHint.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jan 2010
    Location
    Kursk, Russia
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems with showMaximize()

    I have tried. But with the same result

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problems with showMaximize()

    Did you ADD FramelessWindowHint to your previous code, or did you use FramelessWindowHint INSTEAD the Qt::CustomizeWindowHint?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Jan 2010
    Location
    Kursk, Russia
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems with showMaximize()

    I tried both alternatives. But with the same result. Besides with FramelessWindowHint I can not change window size with mouse and I have to realise changing window size in my code
    ps. Sorry for my bad english

  8. #8
    Join Date
    Sep 2009
    Posts
    72
    Thanked 10 Times in 10 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: Problems with showMaximize()

    Hi

    Try this.
    1. QDesktopWidget * QApplication::desktop ()
    2. QDesktopWidget::availableGeometry which will give you available size of your desktop
    3. QWidget::setMaximumSize to set maximum size of your titile less widget
    4. call showMaximized()

    This will ensure that your maximized widget will not cover full screen .

  9. The following user says thank you to vishwajeet.dusane for this useful post:

    drow.it (26th January 2010)

  10. #9
    Join Date
    Jan 2010
    Location
    Kursk, Russia
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems with showMaximize()

    Thanks. Now all work correctly.

Similar Threads

  1. Some problems
    By Dante in forum Qt Programming
    Replies: 13
    Last Post: 20th July 2009, 14:38
  2. Ssl problems
    By Unplugged in forum Newbie
    Replies: 3
    Last Post: 4th October 2007, 07:02
  3. Problems using DLL
    By larsli in forum Qt Programming
    Replies: 11
    Last Post: 15th July 2006, 10:18
  4. Problems
    By euthymos in forum Installation and Deployment
    Replies: 2
    Last Post: 13th June 2006, 19:11
  5. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39

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
  •  
Qt is a trademark of The Qt Company.