QSizeGrip Class
The QSizeGrip class provides a corner handle for resizing a window. More…
| Header | #include <QSizeGrip> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Widgets) |
| Module | Nt Widgets C++ Classes |
| Inherits | QWidget |
List of all members, including inherited members
Public Functions
| QSizeGrip(QWidget *parent) | |
| ~QSizeGrip() |
Reimplemented Public Functions
Reimplemented Protected Functions
| void | paintEvent(QPaintEvent *event) |
| void | mousePressEvent(QMouseEvent *event) |
| void | mouseMoveEvent(QMouseEvent *event) |
| void | mouseReleaseEvent(QMouseEvent *event) |
Detailed Description
A size grip sits in the bottom right corner of a window, often in a status bar. Dragging it resizes the window that contains it, within the minimum and maximum size of the window:
auto *grip = new QSizeGrip(window);
layout->addWidget(grip, 0, Qt::AlignBottom | Qt::AlignRight);
See also QStatusBar.
Differences from Qt
The grip resizes the window itself rather than asking the window manager to, and it is always in the bottom right corner: it does not hide when the window is maximized or move for right-to-left layouts.
Member Function Documentation
QSizeGrip::QSizeGrip(QWidget *parent)
Constructs a size grip in parent, which resizes the window of parent.
QSizeGrip::~QSizeGrip()
Destroys the size grip.
void QSizeGrip::mouseMoveEvent(QMouseEvent *event)
Reimplements QWidget::mouseMoveEvent().
While the grip is dragged the window takes the size it started with plus the distance the mouse moved.
void QSizeGrip::mousePressEvent(QMouseEvent *event)
Reimplements QWidget::mousePressEvent().
void QSizeGrip::mouseReleaseEvent(QMouseEvent *event)
Reimplements QWidget::mouseReleaseEvent().
void QSizeGrip::paintEvent(QPaintEvent *event)
Reimplements QWidget::paintEvent().
QSize QSizeGrip::sizeHint() const
Reimplements QWidget::sizeHint().