10#include <qpa/qplatformwindow.h>
16#include <private/qwidget_p.h>
17#include "private/qapplication_p.h"
18#include <qpa/qplatformtheme.h>
19#include <QtWidgets/qabstractscrollarea.h>
78 if (
tlw && showSizeGrip) {
94 , gotMousePress(
false)
96 , m_platformSizeGrip(
false)
105 bool isAtBottom = sizeGripPos.
y() >=
tlw->
height() / 2;
106 bool isAtLeft = sizeGripPos.
x() <=
tlw->
width() / 2;
178#if !defined(QT_NO_CURSOR)
218 opt.corner =
d->m_corner;
247 && platformName == u
"windows") {
262 d->p =
e->globalPosition().toPoint();
263 d->gotMousePress =
true;
267 d->m_platformSizeGrip =
false;
279 if (
d->m_platformSizeGrip)
283 QRect availableGeometry;
284 bool hasVerticalSizeConstraint =
true;
285 bool hasHorizontalSizeConstraint =
true;
297#if QT_CONFIG(scrollarea)
316 if (hasVerticalSizeConstraint)
317 d->dyMax = availableGeometry.
bottom() -
d->r.bottom() - bottomDecoration;
321 if (hasVerticalSizeConstraint)
322 d->dyMax = availableGeometry.
y() -
d->r.y() + titleBarHeight;
330 if (hasHorizontalSizeConstraint)
331 d->dxMax = availableGeometry.
x() -
d->r.x() + leftRightDecoration;
335 if (hasHorizontalSizeConstraint)
336 d->dxMax = availableGeometry.
right() -
d->r.right() - leftRightDecoration;
360 QPoint np(
e->globalPosition().toPoint());
365 ns.rheight() =
d->r.height() +
qMin(np.
y() -
d->p.y(),
d->dyMax);
367 ns.rheight() =
d->r.height() -
qMax(np.
y() -
d->p.y(),
d->dyMax);
370 ns.rwidth() =
d->r.width() -
qMax(np.
x() -
d->p.x(),
d->dxMax);
372 ns.rwidth() =
d->r.width() +
qMin(np.
x() -
d->p.x(),
d->dxMax);
400 d->gotMousePress =
false;
417 d->m_corner =
d->corner();
418#if !defined(QT_NO_CURSOR)
460 setVisible(!(
d->tlw->windowState() & sizeGripNotVisibleState));
475#include "moc_qsizegrip.cpp"
static QPlatformTheme * platformTheme()
QString platformName
The name of the underlying platform plugin.
The QHideEvent class provides an event which is sent after a widget is hidden.
static QSize closestAcceptableSize(const QWidget *w, const QSize &s)
Returns a size that satisfies all size constraints on widget, including heightForWidth() and that is ...
The QMoveEvent class contains event parameters for move events.
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched object.
void removeEventFilter(QObject *obj)
Removes an event filter object obj from this object.
The QPaintEvent class contains event parameters for paint events.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
constexpr void moveBottomRight(const QPoint &p) noexcept
Moves the rectangle, leaving the bottom-right corner at the given position.
constexpr void moveTopLeft(const QPoint &p) noexcept
Moves the rectangle, leaving the top-left corner at the given position.
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void moveBottomLeft(const QPoint &p) noexcept
Moves the rectangle, leaving the bottom-left corner at the given position.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void moveTopRight(const QPoint &p) noexcept
Moves the rectangle, leaving the top-right corner at the given position.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
QRect availableVirtualGeometry
the available geometry of the virtual desktop to which this screen belongs
The QShowEvent class provides an event that is sent when a widget is shown.
Qt::MouseButton button() const
Returns the button that caused the event.
void _q_showIfNotHidden()
void updateTopLevelWidget()
Qt::Corner corner() const
The QSizeGrip class provides a resize handle for resizing top-level windows.
QSize sizeHint() const override
\reimp
void mousePressEvent(QMouseEvent *) override
Receives the mouse press events for the widget, and primes the resize operation.
bool eventFilter(QObject *, QEvent *) override
\reimp
void showEvent(QShowEvent *showEvent) override
\reimp
void hideEvent(QHideEvent *hideEvent) override
\reimp
void paintEvent(QPaintEvent *) override
Paints the resize grip.
void mouseReleaseEvent(QMouseEvent *mouseEvent) override
\reimp
void moveEvent(QMoveEvent *moveEvent) override
\reimp
QSizeGrip(QWidget *parent)
Constructs a resize corner as a child widget of the given parent.
bool event(QEvent *) override
\reimp
void mouseMoveEvent(QMouseEvent *) override
Resizes the top-level widget containing this widget.
~QSizeGrip()
Destroys this size grip.
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QStyleOption class stores the parameters used by QStyle functions.
void initFrom(const QWidget *w)
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
Combined button and popup list for selecting options.
@ WA_WState_ExplicitShowHide
@ WA_TranslucentBackground
@ WA_WState_ConfigPending
@ X11BypassWindowManagerHint
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLdouble GLdouble GLdouble GLdouble q
static Qt::Edges edgesFromCorner(Qt::Corner corner)
static bool usePlatformSizeGrip(const QWidget *tlw)
static QT_BEGIN_NAMESPACE QWidget * qt_sizegrip_topLevelWidget(QWidget *w)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
QT_BEGIN_NAMESPACE bool toBool(const QString &str)