Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Resize frameless window
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Resize frameless window

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 4.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    beowulf
    wrote on last edited by
    #1

    Hi guys, i'm trying to resize my frameless window.

    @setWindowFlags(Qt::FramelessWindowHint)@

    I can do this using QSizeGrip, but it's different from the original. Example:

    QSizeGrip:

    !http://www.tbi.univie.ac.at/~pmg/tutorials/QT/html/qsizegrip-m.png(http://www.tbi.univie.ac.at/~pmg/tutorials/QT/html/qsizegrip-m.png)!

    Original:

    !http://i5.minus.com/jb2em5OyNcQXbj.jpg(http://i5.minus.com/jb2em5OyNcQXbj.jpg)!

    How to make a frameless window resize like the "original"?

    -- 0x00

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Well, frames serve exactly that purpose so it's a little weird to remove them and try to mimic their functionality, unless you're trying to style the window on you're own of course.

      What you can do is sorta drag and drop. On mouse press determine if and on which border or corner user has pressed and store it in some variable. On mouse move check if you're in a "drag mode" via the said variable and if you are, resize and move the window in the appropriate direction. On mouse release clear the variable.

      Since you're on Windows 7 (judging by the screenshot) don't forget to also handle things like double-click on the upper edge to maximize/demaximize, snap a window to an edge/maximize when dragged to a screen border, demaximize by dragging a window down. Some of those may require you to use some native Window APIs.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved