8#include "private/qwidget_p.h"
10#if QT_CONFIG(sizegrip)
15#include "private/qlayoutengine_p.h"
28 fw(0), extrahei(0), buttonDown(
false), active(
false)
46 setMouseCursor(Nowhere);
80 if (!widgetRect.
contains(cursorPoint))
106 if (
w->isMaximized())
134 if (!active && !buttonDown) {
159 setMouseCursor(
mode);
174 if (globalPos.
x() < 0)
176 if (globalPos.
y() < 0)
184 QPoint p = globalPos + invertedMoveOffset;
185 QPoint pp = globalPos - moveOffset;
199 if (childWidget != widget) {
201 mh += 2 * fw + extrahei;
205 if (childWidget != widget)
206 maxsize +=
QSize(2 * fw, 2 * fw + extrahei);
248 .boundedTo(maxsize));
256void QWidgetResizeHandler::setMouseCursor(MousePosition
m)
299 int delta = is_control?1:8;
305 if (
mode == TopLeft ||
mode == BottomLeft) {
306 moveOffset.
rx() += delta;
307 invertedMoveOffset.
rx() += delta;
309 moveOffset.
rx() -= delta;
310 invertedMoveOffset.
rx() -= delta;
315 if (
mode == BottomRight)
317 else if (
mode == TopRight)
320 setMouseCursor(
mode);
330 if (
mode == TopRight ||
mode == BottomRight) {
331 moveOffset.
rx() += delta;
332 invertedMoveOffset.
rx() += delta;
334 moveOffset.
rx() -= delta;
335 invertedMoveOffset.
rx() -= delta;
340 if (
mode == BottomLeft)
342 else if (
mode == TopLeft)
345 setMouseCursor(
mode);
355 if (
mode == TopLeft ||
mode == TopRight) {
356 moveOffset.
ry() += delta;
357 invertedMoveOffset.
ry() += delta;
359 moveOffset.
ry() -= delta;
360 invertedMoveOffset.
ry() -= delta;
365 if (
mode == BottomLeft)
367 else if (
mode == BottomRight)
370 setMouseCursor(
mode);
380 if (
mode == BottomLeft ||
mode == BottomRight) {
381 moveOffset.
ry() += delta;
382 invertedMoveOffset.
ry() += delta;
384 moveOffset.
ry() -= delta;
385 invertedMoveOffset.
ry() -= delta;
392 else if (
mode == TopRight)
395 setMouseCursor(
mode);
425 if (moveOffset.
x() < widget->
width()/2) {
426 if (moveOffset.
y() < widget->
height()/2)
431 if (moveOffset.
y() < widget->
height()/2)
438 setMouseCursor(
mode);
450#include "moc_qwidgetresizehandler_p.cpp"
static QWidget * activePopupWidget()
Returns the active popup widget.
static void setPos(int x, int y)
Moves the cursor (hot spot) of the primary screen to the global screen position (x,...
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
Type type() const
Returns the event type.
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QFrame class is the base class of widgets that can have a frame.
int frameWidth
the width of the frame that is drawn.
QScreen * primaryScreen
the primary (or default) screen of the application.
QString platformName
The name of the underlying platform plugin.
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
The QKeyEvent class describes a key event.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
const QObjectList & children() const
Returns a list of child objects.
\inmodule QtCore\reentrant
constexpr int & ry() noexcept
Returns a reference to the y coordinate of this point.
constexpr int & rx() noexcept
Returns a reference to the x coordinate of this point.
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
bool intersects(const QRect &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e., there is at least one pixel...
constexpr QRect marginsAdded(const QMargins &margins) const noexcept
Returns a rectangle grown by the margins.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr QPoint bottomRight() const noexcept
Returns the position of the rectangle's bottom-right corner.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
QRect virtualGeometry
the pixel geometry of the virtual desktop to which this screen belongs
constexpr QSize boundedTo(const QSize &) const noexcept
Returns a size holding the minimum width and height of this size and the given otherSize.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
Combined button and popup list for selecting options.
@ WA_WState_ConfigPending
Q_WIDGETS_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLfloat GLfloat GLfloat w
[0]
GLenum GLenum GLsizei const GLuint GLboolean enabled
static const struct TessellationWindingOrderTab cw[]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent