Resizable QWidget at the border
-
I want to try and make a QWidget that can be resized at the borders, just like a regular window. This means I don't want QSizeGrip , and QDockerWidget doesn't look ideal either - I don't want to be able to "detach" the widget.
Does QT provide the ability for this in any way? Where I hover my mouse over the border and the mouse changes appropriately.
Answering that I must do this manually is fine, I just want to confirm this before I begin my adventure to do so in the latest versions.
-
Hi,
Are you thinking of something like QSplitter ?
-
@SGaist I don't think so. Correct me if I'm wrong but this just allows the splitting of widgets inside this parent widget right?
What I want is one single widget such that whenever the mouse hovers over the border, I can then click and drag, to resize from any side of it - just like a traditional window.
-
@NightShadeI said in Resizable QWidget at the border:
whenever the mouse hovers over the border, I can then click and drag, to resize from any side of it - just like a traditional window.
Your widget should be a toplevel widget with window decoration then?! Like
QMainWindow
?
Because when your widget is part of some other layout, the layout and other widgets will limit the movement and expansion.Does your widget have
Qt::FramelessWindowHint
set?
If so, you might wanna look at this topic here -
Because when your widget is part of some other layout, the layout and other widgets will limit the movement and expansion
Actually this is exactly what I want. I don't want something like QMainWindow that isn't bounded, I want it to be bounded inside its parent (QMainWindow) in my case.
Sounding like there might be no QT magic to get such a thing working? I.e. it must be done manually by handling various events.