Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: Skinned Windows (own TitleBar and Borders)

  1. #21
    Join Date
    Jul 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Skinned Windows (own TitleBar and Borders)

    From what I've read I guess you'll have to implement it yourself using the QScreen framework to workout how big it should become once maximized to not overlap the taskbar. But im curious if it's possible to have Windows 7s snap into grid functionality working with a custom window-frame? Does anyone know if this can be implemented?

  2. #22
    Join Date
    Jul 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Skinned Windows (own TitleBar and Borders)

    Master Load,

    I implemented a window today with maximizing capabilities with the borderless-flag set (so from scratch). What you have to do is retriving the availableGeometry rect from the QDesktopWidget class.

    Qt Code:
    1. QRect availableGeometry = qApp->desktop()->availableGeometry(mainWindow);
    To copy to clipboard, switch view to plain text mode 

    This will give you the geometry of the available screen area (minus the taskbar).

    Then you could do something like this to maximize and move the window to the correct location:
    Qt Code:
    1. mainWindow->setMaximumSize(availableGeometry.width(), availableGeometry.height());
    2. mainWindow->showMaximized();
    3. mainWindow->move(availableGeometry.x(), availableGeometry.y());
    4. mainWindow->showMaximized();
    To copy to clipboard, switch view to plain text mode 

    On top of that I used QSettings to remember the nonmaximized state so that I could recover it later when the window is minimized.

    Hope this helps

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.