20#include <QtWidgets/private/qtwidgetsglobal_p.h>
21#include "QtWidgets/qwidget.h"
22#include "private/qobject_p.h"
23#include "QtCore/qrect.h"
24#include "QtCore/qlocale.h"
25#include "QtCore/qset.h"
26#include "QtGui/qregion.h"
27#include "QtGui/qinputmethod.h"
28#include "QtGui/qsurfaceformat.h"
29#include "QtGui/qscreen.h"
30#include "QtWidgets/qsizepolicy.h"
31#include "QtWidgets/qstyle.h"
32#include "QtWidgets/qapplication.h"
33#if QT_CONFIG(graphicseffect)
34#include <private/qgraphicseffect_p.h>
36#if QT_CONFIG(graphicsview)
37#include "QtWidgets/qgraphicsproxywidget.h"
38#include "QtWidgets/qgraphicsscene.h"
39#include "QtWidgets/qgraphicsview.h"
41#include <private/qgesture_p.h>
42#include <qpa/qplatformbackingstore.h>
43#include <QtGui/private/qbackingstorerhisupport_p.h>
44#include <private/qapplication_p.h>
46#include <QtCore/qpointer.h>
68class QUnifiedToolbarSurface;
93 std::unique_ptr<QIcon>
icon;
129#if QT_CONFIG(graphicsview)
174 p =
p->parentWidget();
188 DrawPaintOnScreen = 0x02,
189 DrawRecursive = 0x04,
190 DrawInvisible = 0x08,
191 DontSubtractOpaqueChildren = 0x10,
192 DontDrawOpaqueChildren = 0x20,
193 DontDrawNativeChildren = 0x40,
194 DontSetCompositionMode = 0x80,
195 UseEffectRegionBounds = 0x100
201 DirectionNorth = 0x01,
202 DirectionEast = 0x10,
203 DirectionSouth = 0x02,
215 static void checkRestoredGeometry(
const QRect &availableGeometry,
QRect *restoredGeometry,
232 QWindow *windowHandle(WindowHandleMode
mode = WindowHandleMode::Direct)
const;
233 QWindow *_q_closestWindowHandle()
const;
235 QScreen *associatedScreen()
const;
237 template <
typename T>
240 template <
typename T>
245 void createRecursively();
248 bool setScreenForPoint(
const QPoint &
pos);
251 void createTLExtra();
254 void createSysExtra();
255 void deleteSysExtra();
256 void createTLSysExtra();
257 void deleteTLSysExtra();
258 void updateSystemBackground();
259 void propagatePaletteChange();
261 void setPalette_helper(
const QPalette &);
262 void resolvePalette();
265 void setMask_sys(
const QRegion &);
269 void stackUnder_sys(
QWidget *);
271 QWidget *deepestFocusProxy()
const;
273 void updateFocusChild();
275 void updateFont(
const QFont &);
281 QFont localFont()
const;
283 QFont naturalWidgetFont(
uint inheritedMask)
const;
286 void resolveLayoutDirection();
289 void resolveLocale();
291 void setStyle_helper(
QStyle *newStyle,
bool propagate);
294 void setUpdatesEnabled_helper(
bool );
298 bool isAboutToShow()
const;
299 QRegion prepareToRender(
const QRegion ®ion, QWidget::RenderFlags renderFlags);
301 QWidget::RenderFlags renderFlags);
303 QWidget::RenderFlags renderFlags);
306 void sendPaintEvent(
const QRegion &toBePainted);
313#if QT_CONFIG(graphicsview)
316 bool shouldPaintOnScreen()
const;
317 void paintOnScreen(
const QRegion &rgn);
319 QRect clipRect()
const;
322 void subtractOpaqueChildren(
QRegion &rgn,
const QRect &clipRect)
const;
323 void subtractOpaqueSiblings(
QRegion &
source,
bool *hasDirtySiblingsAbove =
nullptr,
324 bool alsoNonOpaque =
false)
const;
325 void clipToEffectiveMask(
QRegion ®ion)
const;
326 void updateIsOpaque();
327 void setOpaque(
bool opaque);
328 void updateIsTranslucent();
329#if QT_CONFIG(graphicseffect)
330 void invalidateGraphicsEffectsRecursively();
333 const QRegion &getOpaqueChildren()
const;
334 void setDirtyOpaqueRegion();
340 CloseWithSpontaneousEvent
343 bool handleClose(CloseMode
mode);
345 void setWindowIcon_helper();
346 void setWindowIcon_sys();
347 void setWindowOpacity_sys(
qreal opacity);
348 void adjustQuitOnCloseAttribute();
350 void scrollChildren(
int dx,
int dy);
351 void moveRect(
const QRect &,
int dx,
int dy);
352 void scrollRect(
const QRect &,
int dx,
int dy);
353 void invalidateBackingStore_resizeHelper(
const QPoint &oldPos,
const QSize &oldSize);
356 void invalidateBackingStore(
const T &);
358 QRegion overlappedRegion(
const QRect &
rect,
bool breakAfterFirst =
false)
const;
360 void syncBackingStore();
361 void syncBackingStore(
const QRegion ®ion);
363 bool shouldDiscardSyncRequest()
const;
368 void reparentFocusWidgets(
QWidget *oldtlw);
371 void showChildren(
bool spontaneous);
372 void hideChildren(
bool spontaneous);
373 void setParent_sys(
QWidget *parent, Qt::WindowFlags);
374 void reparentWidgetWindows(
QWidget *parentWithWindow, Qt::WindowFlags windowFlags = {});
375 void reparentWidgetWindowChildren(
QWidget *parentWithWindow);
376 void scroll_sys(
int dx,
int dy);
377 void scroll_sys(
int dx,
int dy,
const QRect &
r);
378 void deactivateWidgetCleanup();
379 void setGeometry_sys(
int,
int,
int,
int,
bool);
380 void fixPosIncludesFrame();
381 void sendPendingMoveAndResizeEvents(
bool recursive =
false,
bool disableUpdates =
false);
382 void activateChildLayoutsRecursively();
383 void show_recursive();
388 bool isExplicitlyHidden()
const;
389 void _q_showIfNotHidden();
390 void setVisible(
bool);
392 void setEnabled_helper(
bool);
393 static void adjustFlags(Qt::WindowFlags &
flags,
QWidget *
w =
nullptr);
395 void updateFrameStrut();
396 QRect frameStrut()
const;
398#ifdef QT_KEYPAD_NAVIGATION
399 static bool navigateToDirection(Direction
direction);
405 void setWindowIconText_sys(
const QString &
cap);
406 void setWindowIconText_helper(
const QString &
cap);
408 void setWindowFilePath_sys(
const QString &filePath);
412 void unsetCursor_sys();
415 void setWindowTitle_helper(
const QString &
cap);
416 void setWindowFilePath_helper(
const QString &filePath);
417 void setWindowModified_helper();
418 virtual void setWindowFlags(Qt::WindowFlags windowFlags);
420 bool setMinimumSize_helper(
int &minw,
int &minh);
421 bool setMaximumSize_helper(
int &maxw,
int &maxh);
422 void setConstraints_sys();
423 bool pointInsideRectAndMask(
const QPoint &)
const;
432 void updateContentsRect();
442 while (
w->focusProxy())
453#if QT_CONFIG(graphicsview)
458 if (!ancestorProxy->scene()->views().empty()) {
459 return ancestorProxy->scene()->views().at(0);
476 return availableScreenGeometry(
widget,
QPoint(),
false);
506 redirectDev = replacement;
518 { redirectDev =
nullptr; }
525 if (extra->nativeChildrenForced)
527 extra->nativeChildrenForced = 1;
529 for (
int i = 0;
i < children.size(); ++
i) {
530 if (
QWidget *
child = qobject_cast<QWidget *>(children.at(
i)))
537 return extra ? extra->nativeChildrenForced :
false;
547#if QT_CONFIG(graphicseffect)
548 if (graphicsEffect && graphicsEffect->isEnabled())
549 return graphicsEffect->boundingRectFor(
rect).toAlignedRect();
554 QSize adjustedSize()
const;
559 handleSoftwareInputPanel(clickCausedFocus);
565 if (
qApp->autoSipEnabled()) {
574 void setWSGeometry();
577 {
return p -
data.wrect.topLeft(); }
580 {
return p +
data.wrect.topLeft(); }
588 virtual QObject *focusObject();
603 : QPlatformTextureList::Flags();
614 if (textureChildSeen)
616 textureChildSeen = 1;
618 if (!
q->isWindow()) {
621 get(parent)->setTextureChildSeen();
624 static void sendComposeStatus(
QWidget *
w,
bool end);
639 static void setWidgetParentHelper(
QObject *widgetAsObject,
QObject *newParent);
641 std::string flagsForDumping()
const override;
643 QWidget *closestParentWidgetWithWindowHandle()
const;
663#if !defined(QT_NO_IM)
666#ifdef QT_KEYPAD_NAVIGATION
667 static QPointer<QWidget> editingWidget;
673#if QT_CONFIG(tooltip)
677#if QT_CONFIG(statustip)
680#if QT_CONFIG(whatsthis)
683#if QT_CONFIG(accessibility)
691 decltype(std::declval<QPalette>().resolveMask()) directPaletteResolveMask;
711#ifndef QT_NO_GESTURES
744 EnsureFocusOut = 0x01,
745 AssertConsistency = 0x02,
753 bool removeFromFocusChain(FocusChainRemovalRules rules = FocusChainRemovalRules(),
754 FocusDirection
direction = FocusDirection::Next);
758 {
return insertIntoFocusChain(FocusDirection::Previous,
position); }
760 {
return insertIntoFocusChain(FocusDirection::Next,
position); }
762 FocusDirection
direction = FocusDirection::Next);
763 void reparentFocusChildren(FocusDirection
direction);
767 void initFocusChain();
768 bool isInFocusChain()
const;
769 bool isFocusChainConsistent()
const;
773 uint noPaintOnScreen : 1;
774#elif defined(Q_OS_MAC)
775 void macUpdateSizeAttribute();
777 void setNetWmWindowTypes(
bool skipIfMissing =
false);
779 bool stealKeyboardGrab(
bool grab);
780 bool stealMouseGrab(
bool grab);
795 QWidgetPrivate::DrawWidgetFlags
flags;
801#if QT_CONFIG(graphicseffect)
810 { m_widget->d_func()->graphicsEffect =
nullptr; }
820 updateDueToGraphicsEffect =
true;
822 updateDueToGraphicsEffect =
false;
842 {
return m_widget->window()->rect(); }
852 bool updateDueToGraphicsEffect;
869 return extra ?
extra->topextra.get() :
nullptr;
876 return x ?
x->sharedPainter :
nullptr;
890 ||
extra->mask.contains(
p));
897 return x ?
x->repaintManager.get() :
nullptr;
The QApplication class manages the GUI application's control flow and main settings.
The QBackingStore class provides a drawing area for QWindow.
The QCursor class provides a mouse cursor with an arbitrary shape.
Type
This enum type defines the valid event types in Qt.
virtual const QGraphicsItem * graphicsItem() const =0
virtual bool isPixmap() const =0
QGraphicsEffectSourcePrivate()
virtual QRectF boundingRect(Qt::CoordinateSystem system) const =0
virtual const QStyleOption * styleOption() const =0
virtual void draw(QPainter *p)=0
virtual QRect deviceRect() const =0
virtual void effectBoundingRectChanged()=0
virtual const QWidget * widget() const =0
The QGraphicsEffect class is the base class for all graphics effects.
PixmapPadMode
This enum describes how the pixmap returned from sourcePixmap should be padded.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
static QInputMethod * inputMethod()
returns the input method.
The QLayout class is the base class of geometry managers.
The QPainter class performs low-level painting on widgets and other paint devices.
The QPalette class contains color groups for each widget state.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr QRect translated(int dx, int dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
The QRegion class specifies a clip region for a painter.
QRect boundingRect() const noexcept
Returns the bounding rectangle of this region.
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect availableGeometry
the screen's available geometry in pixels
QRect geometry
the screen's geometry in pixels
QScreen * virtualSiblingAt(QPoint point)
Returns the screen at point within the set of \l QScreen::virtualSiblings(), or nullptr if outside of...
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QStyleOption class stores the parameters used by QStyle functions.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
@ SH_RequestSoftwareInputPanel
RequestSoftwareInputPanel
This enum describes under what circumstances a software input panel will be requested by input capabl...
SubElement
This enum represents a sub-area of a widget.
const QRegion & region() const
QUpdateLaterEvent(const QRegion &paintRegion)
Combined button and popup list for selecting options.
@ BypassGraphicsProxyWidget
static QDBusError::ErrorType get(const char *name)
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
#define Q_DECLARE_LOGGING_CATEGORY(name)
static void setLayoutItemMargins(int left, int top, int right, int bottom, QRect *rect, Qt::LayoutDirection dir)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLdouble GLdouble GLdouble GLdouble top
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLsizei GLsizei GLchar * source
GLdouble GLdouble GLdouble GLdouble q
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
void forceUpdate(QQuickItem *item)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QT_BEGIN_NAMESPACE typedef QHash< WId, QWidget * > QWidgetMapper
QWidgetRepaintManager * repaintManager
QWidgetPaintContext(QPaintDevice *d, const QRegion &r, const QPoint &o, QWidgetPrivate::DrawWidgetFlags f, QPainter *p, QWidgetRepaintManager *rpm)
QWidgetPrivate::DrawWidgetFlags flags