QSizeGrip Class

QSizeGrip 提供一个调整顶层窗口大小的句柄. 更多...

头文件: #include <QSizeGrip>
qmake: QT += widgets
基类: QWidget

公有函数

QSizeGrip(QWidget *parent)
~QSizeGrip()

重新实现的公有函数

virtual void setVisible(bool visible)
virtual QSize sizeHint() const

重新实现的受保护函数

virtual bool event(QEvent *event)
virtual bool eventFilter(QObject *o, QEvent *e)
virtual void hideEvent(QHideEvent *hideEvent)
virtual void mouseMoveEvent(QMouseEvent *event)
virtual void mousePressEvent(QMouseEvent *event)
virtual void mouseReleaseEvent(QMouseEvent *mouseEvent)
virtual void moveEvent(QMoveEvent *moveEvent)
virtual void paintEvent(QPaintEvent *event)
virtual void showEvent(QShowEvent *showEvent)
  • 35 个受保护的函数继承自 QWidget
  • 9 个受保护的函数继承自 QObject
  • 1 个受保护的函数继承自 QPaintDevice

其他继承的成员

详细描述

QSizeGrip 提供一个调整顶层窗口大小的句柄.

这个widget工作方式类似于标准的Windows窗口大小调整句柄. 在 X11 版本中, 如果X11窗口管理器不支持必要的post-ICCCM规范, QSizeGrip的工作方式与系统提供的不同.

你可以将QSizeGrip放在widget的任意位置, 以便用户可以用它调整顶级窗口或带有Qt::SubWindow窗口的大小. 一般而言, QSizeGrip放在右下角.

注意: QStatusBar 已经内置这个widget, 因此, 如果你有一个状态栏 (如., QMainWindow), 那么你不需要再次创建这个widget. QDialog也是如此, 你只需要调用 QDialog::setSizeGripEnabled().

在某些平台上, 窗口全屏或最大化时, QSizeGrip自动隐藏.

Screenshot of a Fusion style size gripA size grip widget at the bottom-right corner of a main window, shown in the Fusion widget style.

QSizeGrip 继承自 QWidget , 重新实现 mousePressEvent()mouseMoveEvent() 函数, 实现窗口大小调整功能, 并重新实现 paintEvent() 函数渲染自身.

参见 QStatusBarQWidget::windowState().

成员函数

QSizeGrip::QSizeGrip(QWidget *parent)

Constructs a resize corner as a child widget of the given parent.

QSizeGrip::~QSizeGrip()

Destroys this size grip.

[virtual protected] bool QSizeGrip::event(QEvent *event)

重新实现 QObject::event().

[virtual protected] bool QSizeGrip::eventFilter(QObject *o, QEvent *e)

重新实现 QObject::eventFilter().

[virtual protected] void QSizeGrip::hideEvent(QHideEvent *hideEvent)

重新实现 QWidget::hideEvent().

[virtual protected] void QSizeGrip::mouseMoveEvent(QMouseEvent *event)

重新实现 QWidget::mouseMoveEvent().

Resizes the top-level widget containing this widget. The mouse move event is passed in the event parameter.

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

重新实现 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.

[virtual protected] void QSizeGrip::mouseReleaseEvent(QMouseEvent *mouseEvent)

重新实现 QWidget::mouseReleaseEvent().

[virtual protected] void QSizeGrip::moveEvent(QMoveEvent *moveEvent)

重新实现 QWidget::moveEvent().

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

重新实现 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.

[virtual] void QSizeGrip::setVisible(bool visible)

重新实现 QWidget::setVisible().

[virtual protected] void QSizeGrip::showEvent(QShowEvent *showEvent)

重新实现 QWidget::showEvent().

[virtual] QSize QSizeGrip::sizeHint() const

重新实现 QWidget::sizeHint().