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
src_corelib_kernel_qcoreapplication.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
5
10
11
16
17
19// Called once QCoreApplication exists
21{
22 MyDebugTool* tool = new MyDebugTool(QCoreApplication::instance());
23 QCoreApplication::instance()->installEventFilter(tool);
24}
25
28
29
30
31static int *global_ptr = nullptr;
32
33static void cleanup_ptr()
34{
35 delete [] global_ptr;
36 global_ptr = nullptr;
37}
38
40{
41 global_ptr = new int[100]; // allocate data
42 qAddPostRoutine(cleanup_ptr); // delete later
43}
45
46
49{
50public:
52 {
53 if (!p)
55 return p;
56 }
57
59 {
60 // cleanup goes here
61 }
62
63private:
66 {
67 // initialization goes here
68 }
69
71};
73
74
76static inline QString tr(const char *sourceText,
77 const char *comment = nullptr);
79
80
82class MyMfcView : public CView
83{
85
86public:
88 ...
89};
static MyPrivateInitStuff * initStuff(QObject *parent)
void clicked(bool checked=false)
This signal is emitted when the button is activated (i.e., pressed down then released while the mouse...
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static void quit()
\threadsafe
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
@ MouseButtonPress
Definition qcoreevent.h:60
\inmodule QtGui
Definition qevent.h:196
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QPushButton widget provides a command button.
Definition qpushbutton.h:20
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QPushButton
[1]
@ QueuedConnection
void qAddPostRoutine(QtCleanUpFunction p)
#define Q_COREAPP_STARTUP_FUNCTION(AFUNC)
#define Q_DECLARE_TR_FUNCTIONS(context)
struct _cl_event * event
GLfloat GLfloat p
[1]
#define tr(X)
QMouseEvent event(QEvent::MouseButtonPress, pos, 0, 0, 0)
[0]
static int * global_ptr
[3]
static void cleanup_ptr()
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QPushButton * quitButton
[0]
static void preRoutineMyDebugTool()
[1]
QApplication app(argc, argv)
[0]