6.0.0-rc4Source

QSizeGrip Class

The QSizeGrip class provides a corner handle for resizing a window. More…

Header#include <QSizeGrip>
CMaketarget_link_libraries(app PRIVATE Nt::Widgets)
ModuleNt Widgets C++ Classes
InheritsQWidget

List of all members, including inherited members

Public Functions

Reimplemented Public Functions

QSizesizeHint() const

Reimplemented Protected Functions

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

[explicit] QSizeGrip::QSizeGrip(QWidget *parent)

Constructs a size grip in parent, which resizes the window of parent.

[override] QSizeGrip::~QSizeGrip()

Destroys the size grip.

[override, protected] 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.

[override, protected] void QSizeGrip::mousePressEvent(QMouseEvent *event)

Reimplements QWidget::mousePressEvent().

[override, protected] void QSizeGrip::mouseReleaseEvent(QMouseEvent *event)

Reimplements QWidget::mouseReleaseEvent().

[override, protected] void QSizeGrip::paintEvent(QPaintEvent *event)

Reimplements QWidget::paintEvent().

[override] QSize QSizeGrip::sizeHint() const

Reimplements QWidget::sizeHint().