Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qapplication.cpp File Reference

(5cdac10b4680e0984f490f1606f212f1d38ab5f7)

#include "qplatformdefs.h"
#include "qabstracteventdispatcher.h"
#include "qapplication.h"
#include "qclipboard.h"
#include "qcursor.h"
#include "qdir.h"
#include "qevent.h"
#include "qfile.h"
#include "qfileinfo.h"
#include "qhash.h"
#include "qset.h"
#include "qlayout.h"
#include "qpixmapcache.h"
#include "qstyle.h"
#include "qstyleoption.h"
#include "qstylefactory.h"
#include "qtranslator.h"
#include "qvariant.h"
#include "qwidget.h"
#include "private/qguiapplication_p.h"
#include "qcolormap.h"
#include "qdebug.h"
#include "private/qstylesheetstyle_p.h"
#include "private/qstyle_p.h"
#include "qwidgetwindow_p.h"
#include <QtGui/qstylehints.h>
#include <QtGui/qinputmethod.h>
#include <QtGui/private/qwindow_p.h>
#include <QtGui/qpointingdevice.h>
#include <QtGui/private/qpointingdevice_p.h>
#include <qpa/qplatformtheme.h>
#include "private/qkeymapper_p.h"
#include <qthread.h>
#include <private/qthread_p.h>
#include <QtGui/private/qevent_p.h>
#include <QtGui/private/qeventpoint_p.h>
#include <private/qfont_p.h>
#include <stdlib.h>
#include "qapplication_p.h"
#include "qwidget_p.h"
#include "qgesture.h"
#include "private/qgesturemanager_p.h"
#include <qpa/qplatformfontdatabase.h>
#include "qdatetime.h"
#include <qpa/qplatformwindow.h>
#include <qtwidgets_tracepoints_p.h>
#include <algorithm>
#include <iterator>
#include "moc_qapplication.cpp"
+ Include dependency graph for qapplication.cpp:

Go to the source code of this file.

Macros

#define CHECK_QAPP_INSTANCE(...)
 

Functions

static void initResources ()
 
 Q_TRACE_PREFIX (qtwidgets, "#include <qcoreevent.h>")
 
 Q_TRACE_METADATA (qtwidgets, "ENUM { AUTO, RANGE User ... MaxUser } QEvent::Type;")
 
 Q_TRACE_POINT (qtwidgets, QApplication_notify_entry, QObject *receiver, QEvent *event, QEvent::Type type)
 
 Q_TRACE_POINT (qtwidgets, QApplication_notify_exit, bool consumed, bool filtered)
 
Q_CORE_EXPORT void qt_call_post_routines ()
 
Q_GUI_EXPORT bool qt_sendShortcutOverrideEvent (QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods, const QString &text=QString(), bool autorep=false, ushort count=1)
 
void qt_init_tooltip_palette ()
 
bool Q_WIDGETS_EXPORT qt_tab_all_widgets ()
 
FontHashqt_app_fonts_hash ()
 
void qRegisterWidgetsVariant ()
 
QWidgetqt_tlw_for_window (QWindow *wnd)
 
Q_WIDGETS_EXPORT bool qt_tryModalHelper (QWidget *widget, QWidget **rettop)
 
bool qt_try_modal (QWidget *widget, QEvent::Type type)
 
static void ungrabKeyboardForPopup (QWidget *popup)
 
static void ungrabMouseForPopup (QWidget *popup)
 
static void grabForPopup (QWidget *popup)
 
static int uiEffectToFlag (Qt::UIEffect effect)
 

Variables

bool qt_in_tab_key_event = false
 
int qt_antialiasing_threshold = -1
 
QWidgetqt_desktopWidget = nullptr
 
QPointer< QWidgetqt_last_mouse_receiver
 
Q_WIDGETS_EXPORT QWidgetqt_button_down
 
static bool popupGrabOk
 
QWidgetqt_popup_down
 
bool qt_replay_popup_mouse_event
 
bool qt_popup_down_closed
 
int openPopupCount = 0
 

Macro Definition Documentation

◆ CHECK_QAPP_INSTANCE

#define CHECK_QAPP_INSTANCE ( ...)
Value:
} else { \
qWarning("Must construct a QApplication first."); \
return __VA_ARGS__; \
}
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
#define Q_LIKELY(x)

Definition at line 111 of file qapplication.cpp.

Function Documentation

◆ grabForPopup()

static void grabForPopup ( QWidget * popup)
static

Definition at line 3323 of file qapplication.cpp.

References popupGrabOk, Q_ASSERT, qt_widget_private(), QWidget::testAttribute(), ungrabKeyboardForPopup(), and Qt::WA_WState_Created.

Referenced by QApplicationPrivate::closePopup(), and QApplicationPrivate::openPopup().

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

◆ initResources()

static void initResources ( )
static

Definition at line 90 of file qapplication.cpp.

References Q_INIT_RESOURCE.

◆ Q_TRACE_METADATA()

Q_TRACE_METADATA ( qtwidgets ,
"ENUM { AUTO, RANGE User ... MaxUser } QEvent::Type;"  )

◆ Q_TRACE_POINT() [1/2]

Q_TRACE_POINT ( qtwidgets ,
QApplication_notify_entry ,
QObject * receiver,
QEvent * event,
QEvent::Type type )

◆ Q_TRACE_POINT() [2/2]

Q_TRACE_POINT ( qtwidgets ,
QApplication_notify_exit ,
bool consumed,
bool filtered )

◆ Q_TRACE_PREFIX()

Q_TRACE_PREFIX ( qtwidgets ,
"#include <qcoreevent.h>"  )

◆ qRegisterWidgetsVariant()

void qRegisterWidgetsVariant ( )
extern

Definition at line 31 of file qwidgetsvariant.cpp.

References qMetaTypeWidgetsHelper.

Referenced by QApplicationPrivate::initialize().

+ Here is the caller graph for this function:

◆ qt_app_fonts_hash()

FontHash * qt_app_fonts_hash ( )

Definition at line 353 of file qapplication.cpp.

Referenced by QMacStyle::drawControl(), QMacStyle::polish(), qt_aqua_get_known_size(), QMessageBox::setInformativeText(), and QMacStyle::subControlRect().

+ Here is the caller graph for this function:

◆ qt_call_post_routines()

Q_CORE_EXPORT void qt_call_post_routines ( )

Definition at line 320 of file qcoreapplication.cpp.

References forever, globalRoutinesMutex, QList< T >::isEmpty(), list, and qSwap().

Referenced by QApplication::~QApplication(), QCoreApplication::~QCoreApplication(), QGuiApplication::~QGuiApplication(), QCommandLineParser::process(), and QCommandLineParser::showVersion().

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

◆ qt_init_tooltip_palette()

void qt_init_tooltip_palette ( )

Definition at line 495 of file qapplication.cpp.

References palette, QGuiApplicationPrivate::platformTheme(), QToolTip::setPalette(), QPlatformTheme::ToolTipPalette, and toolTipPalette().

Referenced by QApplicationPrivate::handleThemeChanged(), and QApplicationPrivate::init().

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

◆ qt_sendShortcutOverrideEvent()

Q_GUI_EXPORT bool qt_sendShortcutOverrideEvent ( QObject * o,
ulong timestamp,
int k,
Qt::KeyboardModifiers mods,
const QString & text = QString(),
bool autorep = false,
ushort count = 1 )

Definition at line 1176 of file qwindowsysteminterface.cpp.

◆ qt_tab_all_widgets()

bool Q_WIDGETS_EXPORT qt_tab_all_widgets ( )

Definition at line 344 of file qapplication.cpp.

References QGuiApplication::styleHints(), and Qt::TabFocusAllControls.

Referenced by QGraphicsProxyWidgetPrivate::findFocusChild(), QApplicationPrivate::focusNextPrevChild_helper(), and QAbstractButtonPrivate::moveFocus().

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

◆ qt_tlw_for_window()

QWidget * qt_tlw_for_window ( QWindow * wnd)

Definition at line 1904 of file qapplication.cpp.

References QPlatformWindow::isForeignWindow(), and QApplication::topLevelWidgets().

Referenced by QApplicationPrivate::notifyActiveWindowChange().

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

◆ qt_try_modal()

bool qt_try_modal ( QWidget * widget,
QEvent::Type type )

Definition at line 2221 of file qapplication.cpp.

References QEvent::KeyPress, QEvent::KeyRelease, QEvent::MouseButtonPress, QEvent::MouseButtonRelease, QEvent::MouseMove, QWidget::raise(), QApplicationPrivate::tryModalHelper(), and widget.

Referenced by QWidgetWindow::handleKeyEvent().

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

◆ qt_tryModalHelper()

Q_WIDGETS_EXPORT bool qt_tryModalHelper ( QWidget * widget,
QWidget ** rettop )

Definition at line 2176 of file qapplication.cpp.

References QApplicationPrivate::tryModalHelper(), and widget.

+ Here is the call graph for this function:

◆ uiEffectToFlag()

◆ ungrabKeyboardForPopup()

static void ungrabKeyboardForPopup ( QWidget * popup)
static

Definition at line 3305 of file qapplication.cpp.

References QWidget::keyboardGrabber(), and qt_widget_private().

Referenced by QApplicationPrivate::closePopup(), and grabForPopup().

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

◆ ungrabMouseForPopup()

static void ungrabMouseForPopup ( QWidget * popup)
static

Definition at line 3313 of file qapplication.cpp.

References QWidget::mouseGrabber(), and qt_widget_private().

Referenced by QApplicationPrivate::closePopup().

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

Variable Documentation

◆ openPopupCount

int openPopupCount = 0

◆ popupGrabOk

bool popupGrabOk
static

Definition at line 3321 of file qapplication.cpp.

Referenced by QApplicationPrivate::closePopup(), and grabForPopup().

◆ qt_antialiasing_threshold

int qt_antialiasing_threshold = -1

Definition at line 331 of file qapplication.cpp.

◆ qt_button_down

◆ qt_desktopWidget

QWidget* qt_desktopWidget = nullptr

Definition at line 357 of file qapplication.cpp.

Referenced by QApplication::~QApplication(), and QApplicationPrivate::desktop().

◆ qt_in_tab_key_event

◆ qt_last_mouse_receiver

QPointer<QWidget> qt_last_mouse_receiver
extern

Definition at line 401 of file qwidgetwindow.cpp.

◆ qt_popup_down

QWidget* qt_popup_down
extern

◆ qt_popup_down_closed

bool qt_popup_down_closed
extern

◆ qt_replay_popup_mouse_event

bool qt_replay_popup_mouse_event
extern