QSizeGrip Class
The QSizeGrip class provides a resize handle for resizing top-level windows. More...
Header: | #include <QSizeGrip> |
qmake: | QT += widgets |
Inherits: | QWidget |
Public Functions
QSizeGrip(QWidget *parent) | |
virtual | ~QSizeGrip() |
Reimplemented Public Functions
virtual void | setVisible(bool visible) override |
virtual QSize | sizeHint() const override |
- 214 public functions inherited from QWidget
- 31 public functions inherited from QObject
- 14 public functions inherited from QPaintDevice
Static Public Members
const QMetaObject | staticMetaObject |
Reimplemented Protected Functions
virtual bool | event(QEvent *event) override |
virtual bool | eventFilter(QObject *o, QEvent *e) override |
virtual void | hideEvent(QHideEvent *hideEvent) override |
virtual void | mouseMoveEvent(QMouseEvent *event) override |
virtual void | mousePressEvent(QMouseEvent *event) override |
virtual void | mouseReleaseEvent(QMouseEvent *mouseEvent) override |
virtual void | moveEvent(QMoveEvent *moveEvent) override |
virtual void | paintEvent(QPaintEvent *event) override |
virtual void | showEvent(QShowEvent *showEvent) override |
- 35 protected functions inherited from QWidget
- 9 protected functions inherited from QObject
- 1 protected function inherited from QPaintDevice
Additional Inherited Members
- 59 properties inherited from QWidget
- 1 property inherited from QObject
- 19 public slots inherited from QWidget
- 1 public slot inherited from QObject
- 3 signals inherited from QWidget
- 2 signals inherited from QObject
- 35 protected functions inherited from QWidget
- 9 protected functions inherited from QObject
- 1 protected function inherited from QPaintDevice
- 1 protected slot inherited from QWidget
Detailed Description
The QSizeGrip class provides a resize handle for resizing top-level windows.
This widget works like the standard Windows resize handle. In the X11 version this resize handle generally works differently from the one provided by the system if the X11 window manager does not support necessary modern post-ICCCM specifications.
Put this widget anywhere in a widget tree and the user can use it to resize the top-level window or any widget with the Qt::SubWindow flag set. Generally, this should be in the lower right-hand corner.
Note that QStatusBar already uses this widget, so if you have a status bar (e.g., you are using QMainWindow), then you don't need to use this widget explicitly. The same goes for QDialog, for which you can just call QDialog::setSizeGripEnabled().
On some platforms the size grip automatically hides itself when the window is shown full screen or maximised.
A size grip widget at the bottom-right corner of a main window, shown in the Fusion widget style. |
The QSizeGrip class inherits QWidget and reimplements the mousePressEvent() and mouseMoveEvent() functions to feature the resize functionality, and the paintEvent() function to render the size grip widget.
See also QStatusBar and QWidget::windowState().
Member Function Documentation
QSizeGrip::QSizeGrip(QWidget *parent)
Constructs a resize corner as a child widget of the given parent.
[virtual]
QSizeGrip::~QSizeGrip()
Destroys this size grip.
[override virtual protected]
bool QSizeGrip::event(QEvent *event)
Reimplemented from QWidget::event().
[override virtual protected]
bool QSizeGrip::eventFilter(QObject *o, QEvent *e)
Reimplemented from QObject::eventFilter().
[override virtual protected]
void QSizeGrip::hideEvent(QHideEvent *hideEvent)
Reimplemented from QWidget::hideEvent().
[override virtual protected]
void QSizeGrip::mouseMoveEvent(QMouseEvent *event)
Reimplemented from QWidget::mouseMoveEvent().
Resizes the top-level widget containing this widget. The mouse move event is passed in the event parameter.
[override virtual protected]
void QSizeGrip::mousePressEvent(QMouseEvent *event)
Reimplemented from QWidget::mousePressEvent().
Receives the mouse press events for the widget, and primes the resize operation. The mouse press event is passed in the event parameter.
[override virtual protected]
void QSizeGrip::mouseReleaseEvent(QMouseEvent *mouseEvent)
Reimplemented from QWidget::mouseReleaseEvent().
[override virtual protected]
void QSizeGrip::moveEvent(QMoveEvent *moveEvent)
Reimplemented from QWidget::moveEvent().
[override virtual protected]
void QSizeGrip::paintEvent(QPaintEvent *event)
Reimplemented from QWidget::paintEvent().
Paints the resize grip.
Resize grips are usually rendered as small diagonal textured lines in the lower-right corner. The paint event is passed in the event parameter.
[override virtual]
void QSizeGrip::setVisible(bool visible)
Reimplemented from QWidget::setVisible().
[override virtual protected]
void QSizeGrip::showEvent(QShowEvent *showEvent)
Reimplemented from QWidget::showEvent().
[override virtual]
QSize QSizeGrip::sizeHint() const
Reimplemented from QWidget::sizeHint().
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.