Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwidget.cpp File Reference

(87806f5cad6e4ce75a899598c15c126995682562)

#include "qapplication.h"
#include "qapplication_p.h"
#include "qbrush.h"
#include "qcursor.h"
#include "private/qduplicatetracker_p.h"
#include "qevent.h"
#include "qlayout.h"
#include "qmetaobject.h"
#include "qpixmap.h"
#include "qpointer.h"
#include "qstack.h"
#include "qstyle.h"
#include "qstylefactory.h"
#include "qvariant.h"
#include "qwidget.h"
#include "qstyleoption.h"
#include "qstylehints.h"
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformwindow_p.h>
#include "private/qwidgetwindow_p.h"
#include "qpainter.h"
#include "qdebug.h"
#include "private/qstyle_p.h"
#include "qfileinfo.h"
#include "qscopeguard.h"
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/qinputmethod.h>
#include <qbackingstore.h>
#include <private/qwidgetrepaintmanager_p.h>
#include <private/qpaintengine_raster_p.h>
#include "qwidget_p.h"
#include <QtGui/private/qwindow_p.h>
#include "qlayout_p.h"
#include "QtWidgets/qabstractscrollarea.h"
#include "private/qabstractscrollarea_p.h"
#include "private/qevent_p.h"
#include "private/qgesturemanager_p.h"
#include "qwindowcontainer_p.h"
#include <sstream>
#include "moc_qwidget.cpp"
#include "moc_qwidget_p.cpp"
Include dependency graph for qwidget.cpp:

Go to the source code of this file.

Classes

struct  QWidgetExceptionCleaner
struct  MapToGlobalTransformResult

Macros

#define FOCUS_NEXT(w)
#define FOCUS_PREV(w)

Functions

 Q_LOGGING_CATEGORY (lcWidgetPainting, "qt.widgets.painting", QtWarningMsg)
 Q_LOGGING_CATEGORY (lcWidgetShowHide, "qt.widgets.showhide", QtWarningMsg)
 Q_STATIC_LOGGING_CATEGORY (lcWidgetWindow, "qt.widgets.window", QtWarningMsg)
static bool qRectIntersects (const QRect &r1, const QRect &r2)
bool qt_sendSpontaneousEvent (QObject *receiver, QEvent *event)
static void setAttribute_internal (Qt::WidgetAttribute attribute, bool on, QWidgetData *data, QWidgetPrivate *d)
static bool q_evaluateRhiConfigRecursive (const QWidget *w, QPlatformBackingStoreRhiConfig *outConfig, QSurface::SurfaceType *outType)
bool q_evaluateRhiConfig (const QWidget *w, QPlatformBackingStoreRhiConfig *outConfig, QSurface::SurfaceType *outType)
void q_createNativeChildrenAndSetParent (const QWidget *parentWidget)
static void fillRegion (QPainter *painter, const QRegion &rgn, const QBrush &brush)
static void applyCursor (QWidget *w, const QCursor &c)
static void unsetCursor (QWidget *w)
void qt_qpa_set_cursor (QWidget *w, bool force)
static void sendResizeEvents (QWidget *target)
QString qt_setWindowTitle_helperHelper (const QString &title, const QWidget *widget)
 Returns a modified window title with the [*] place holder replaced according to the rules described in QWidget::setWindowTitle.
static bool isEmbedded (const QWindow *w)
void qSendWindowChangeToTextureChildrenRecursively (QWidget *widget, QEvent::Type eventType)
Q_WIDGETS_EXPORT QWidgetDataqt_qwidget_data (QWidget *widget)
Q_WIDGETS_EXPORT QWidgetPrivateqt_widget_private (QWidget *widget)
static bool canMapPosition (QWindow *window)
static MapToGlobalTransformResult mapToGlobalTransform (const QWidget *w)
static QWindowgrabberWindow (const QWidget *w)
static void grabMouseForWidget (QWidget *widget, const QCursor *cursor=nullptr)
static void releaseMouseGrabOfWidget (QWidget *widget)
QDebug operator<< (QDebug debug, const QWidget *widget)
QWidgetList focusPath (QWidget *from, QWidget *to, QWidgetPrivate::FocusDirection direction)

Variables

QWidgetqt_button_down
QWidgetqt_mouseGrb = nullptr
static bool mouseGrabWithCursor = false
static QWidgetkeyboardGrb = nullptr

Macro Definition Documentation

◆ FOCUS_NEXT

#define FOCUS_NEXT ( w)
Value:
w->d_func()->focus_next
GLfloat GLfloat GLfloat w
[0]

Definition at line 13471 of file qwidget.cpp.

◆ FOCUS_PREV

#define FOCUS_PREV ( w)
Value:
w->d_func()->focus_prev

Definition at line 13472 of file qwidget.cpp.

Function Documentation

◆ applyCursor()

void applyCursor ( QWidget * w,
const QCursor & c )
inlinestatic

Definition at line 5061 of file qwidget.cpp.

◆ canMapPosition()

bool canMapPosition ( QWindow * window)
inlinestatic

Definition at line 12726 of file qwidget.cpp.

Referenced by mapToGlobalTransform().

Here is the caller graph for this function:

◆ fillRegion()

void fillRegion ( QPainter * painter,
const QRegion & rgn,
const QBrush & brush )
inlinestatic

Definition at line 2258 of file qwidget.cpp.

◆ focusPath()

QWidgetList focusPath ( QWidget * from,
QWidget * to,
QWidgetPrivate::FocusDirection direction )
Returns
a QWidgetList, representing the part of the focus chain, starting with
Parameters
fromand ending with
to,in

param direction.

Definition at line 13716 of file qwidget.cpp.

References QPainter::QWidget.

Here is the call graph for this function:

◆ grabberWindow()

QWindow * grabberWindow ( const QWidget * w)
inlinestatic

Definition at line 12831 of file qwidget.cpp.

References QPainter::QWidget.

Referenced by grabMouseForWidget(), and releaseMouseGrabOfWidget().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grabMouseForWidget()

void grabMouseForWidget ( QWidget * widget,
const QCursor * cursor = nullptr )
static

Definition at line 12841 of file qwidget.cpp.

References grabberWindow(), mouseGrabWithCursor, and qt_mouseGrb.

Here is the call graph for this function:

◆ isEmbedded()

bool isEmbedded ( const QWindow * w)
inlinestatic

Definition at line 6695 of file qwidget.cpp.

◆ mapToGlobalTransform()

MapToGlobalTransformResult mapToGlobalTransform ( const QWidget * w)
static

Definition at line 12747 of file qwidget.cpp.

References canMapPosition(), and MapToGlobalTransformResult::window.

Here is the call graph for this function:

◆ operator<<()

QDebug operator<< ( QDebug debug,
const QWidget * widget )

Definition at line 13427 of file qwidget.cpp.

◆ q_createNativeChildrenAndSetParent()

void q_createNativeChildrenAndSetParent ( const QWidget * parentWidget)

Definition at line 1265 of file qwidget.cpp.

References q_createNativeChildrenAndSetParent(), and QPainter::QWidget.

Referenced by q_createNativeChildrenAndSetParent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ q_evaluateRhiConfig()

bool q_evaluateRhiConfig ( const QWidget * w,
QPlatformBackingStoreRhiConfig * outConfig,
QSurface::SurfaceType * outType )

Definition at line 1134 of file qwidget.cpp.

◆ q_evaluateRhiConfigRecursive()

bool q_evaluateRhiConfigRecursive ( const QWidget * w,
QPlatformBackingStoreRhiConfig * outConfig,
QSurface::SurfaceType * outType )
static

Definition at line 1108 of file qwidget.cpp.

◆ Q_LOGGING_CATEGORY() [1/2]

Q_LOGGING_CATEGORY ( lcWidgetPainting ,
"qt.widgets.painting" ,
QtWarningMsg  )

◆ Q_LOGGING_CATEGORY() [2/2]

Q_LOGGING_CATEGORY ( lcWidgetShowHide ,
"qt.widgets.showhide" ,
QtWarningMsg  )

◆ Q_STATIC_LOGGING_CATEGORY()

Q_STATIC_LOGGING_CATEGORY ( lcWidgetWindow ,
"qt.widgets.window" ,
QtWarningMsg  )

◆ qRectIntersects()

bool qRectIntersects ( const QRect & r1,
const QRect & r2 )
inlinestatic

Definition at line 102 of file qwidget.cpp.

◆ qSendWindowChangeToTextureChildrenRecursively()

void qSendWindowChangeToTextureChildrenRecursively ( QWidget * widget,
QEvent::Type eventType )

Definition at line 10739 of file qwidget.cpp.

References QPainter::QWidget, and QPaintEngine::QWidgetPrivate.

Here is the call graph for this function:

◆ qt_qpa_set_cursor()

void qt_qpa_set_cursor ( QWidget * w,
bool force )

Definition at line 5073 of file qwidget.cpp.

◆ qt_qwidget_data()

Q_WIDGETS_EXPORT QWidgetData * qt_qwidget_data ( QWidget * widget)

Definition at line 12572 of file qwidget.cpp.

◆ qt_sendSpontaneousEvent()

bool qt_sendSpontaneousEvent ( QObject * receiver,
QEvent * event )
related

◆ qt_setWindowTitle_helperHelper()

QString qt_setWindowTitle_helperHelper ( const QString & title,
const QWidget * widget )

Returns a modified window title with the [*] place holder replaced according to the rules described in QWidget::setWindowTitle.

This function assumes that "[*]" can be quoted by another "[*]", so it will replace two place holders by one and a single last one by either "*" or nothing depending on the modified flag.

Definition at line 6051 of file qwidget.cpp.

Referenced by tabTextFor().

Here is the caller graph for this function:

◆ qt_widget_private()

Q_WIDGETS_EXPORT QWidgetPrivate * qt_widget_private ( QWidget * widget)

Definition at line 12577 of file qwidget.cpp.

◆ releaseMouseGrabOfWidget()

void releaseMouseGrabOfWidget ( QWidget * widget)
static

Definition at line 12863 of file qwidget.cpp.

References grabberWindow(), mouseGrabWithCursor, and qt_mouseGrb.

Here is the call graph for this function:

◆ sendResizeEvents()

void sendResizeEvents ( QWidget * target)
static

Definition at line 5247 of file qwidget.cpp.

References QPainter::QWidget, and sendResizeEvents().

Referenced by sendResizeEvents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAttribute_internal()

void setAttribute_internal ( Qt::WidgetAttribute attribute,
bool on,
QWidgetData * data,
QWidgetPrivate * d )
static

This just sets the corresponding attribute bit to 1 or 0

Definition at line 11385 of file qwidget.cpp.

◆ unsetCursor()

void unsetCursor ( QWidget * w)
inlinestatic

Definition at line 5067 of file qwidget.cpp.

Referenced by QPlatformCursor::qt_qpa_set_cursor.

Here is the caller graph for this function:

Variable Documentation

◆ keyboardGrb

QWidget * keyboardGrb = nullptr
static

Definition at line 12829 of file qwidget.cpp.

◆ mouseGrabWithCursor

bool mouseGrabWithCursor = false
static

Definition at line 12828 of file qwidget.cpp.

Referenced by grabMouseForWidget(), and releaseMouseGrabOfWidget().

◆ qt_button_down

QWidget* qt_button_down
extern

Definition at line 2339 of file qwidget.cpp.

◆ qt_mouseGrb

QWidget * qt_mouseGrb = nullptr

Definition at line 12827 of file qwidget.cpp.

Referenced by grabMouseForWidget(), and releaseMouseGrabOfWidget().