Qt 6.x
The Qt SDK
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
8
9
14
15
17foreach (const QString &path, app.libraryPaths())
20
21
23// Called once QCoreApplication exists
25{
26 MyDebugTool* tool = new MyDebugTool(QCoreApplication::instance());
28}
29
32
33
34
35static int *global_ptr = nullptr;
36
37static void cleanup_ptr()
38{
39 delete [] global_ptr;
40 global_ptr = nullptr;
41}
42
44{
45 global_ptr = new int[100]; // allocate data
46 qAddPostRoutine(cleanup_ptr); // delete later
47}
49
50
53{
54public:
56 {
57 if (!p)
59 return p;
60 }
61
63 {
64 // cleanup goes here
65 }
66
67private:
70 {
71 // initialization goes here
72 }
73
75};
77
78
80static inline QString tr(const char *sourceText,
81 const char *comment = nullptr);
83
84
86class MyMfcView : public CView
87{
89
90public:
92 ...
93};
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:195
\inmodule QtCore
Definition qobject.h:90
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
Definition qobject.cpp:2269
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
The QPushButton widget provides a command button.
Definition qpushbutton.h:20
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
@ QueuedConnection
void qAddPostRoutine(QtCleanUpFunction p)
#define Q_COREAPP_STARTUP_FUNCTION(AFUNC)
#define Q_DECLARE_TR_FUNCTIONS(context)
struct _cl_event * event
GLsizei const GLchar *const * path
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()
[2]
do_something()
QApplication app(argc, argv)
[0]