- All Implemented Interfaces:
QtObjectInterface
,QtSignalBlockerInterface
,QtSignalEmitterInterface
,QtThreadAffineInterface
- Direct Known Subclasses:
QGuiApplication
public class QCoreApplication extends QObject
Event loop for Qt applications without UI
Java wrapper for Qt class QCoreApplication
-
Nested Class Summary
Nested classes/interfaces inherited from class io.qt.core.QObject
QObject.MultiSignal, QObject.PrivateSignal0, QObject.PrivateSignal1<A>, QObject.PrivateSignal2<A,B>, QObject.PrivateSignal3<A,B,C>, QObject.PrivateSignal4<A,B,C,D>, QObject.PrivateSignal5<A,B,C,D,E>, QObject.PrivateSignal6<A,B,C,D,E,F>, QObject.PrivateSignal7<A,B,C,D,E,F,G>, QObject.PrivateSignal8<A,B,C,D,E,F,G,H>, QObject.PrivateSignal9<A,B,C,D,E,F,G,H,I>, QObject.QDeclarativeConstructor, QObject.Signal0, QObject.Signal1<A>, QObject.Signal1Default1<A>, QObject.Signal2<A,B>, QObject.Signal2Default1<A,B>, QObject.Signal2Default2<A,B>, QObject.Signal3<A,B,C>, QObject.Signal3Default1<A,B,C>, QObject.Signal3Default2<A,B,C>, QObject.Signal3Default3<A,B,C>, QObject.Signal4<A,B,C,D>, QObject.Signal4Default1<A,B,C,D>, QObject.Signal4Default2<A,B,C,D>, QObject.Signal4Default3<A,B,C,D>, QObject.Signal4Default4<A,B,C,D>, QObject.Signal5<A,B,C,D,E>, QObject.Signal5Default1<A,B,C,D,E>, QObject.Signal5Default2<A,B,C,D,E>, QObject.Signal5Default3<A,B,C,D,E>, QObject.Signal5Default4<A,B,C,D,E>, QObject.Signal5Default5<A,B,C,D,E>, QObject.Signal6<A,B,C,D,E,F>, QObject.Signal6Default1<A,B,C,D,E,F>, QObject.Signal6Default2<A,B,C,D,E,F>, QObject.Signal6Default3<A,B,C,D,E,F>, QObject.Signal6Default4<A,B,C,D,E,F>, QObject.Signal6Default5<A,B,C,D,E,F>, QObject.Signal6Default6<A,B,C,D,E,F>, QObject.Signal7<A,B,C,D,E,F,G>, QObject.Signal7Default1<A,B,C,D,E,F,G>, QObject.Signal7Default2<A,B,C,D,E,F,G>, QObject.Signal7Default3<A,B,C,D,E,F,G>, QObject.Signal7Default4<A,B,C,D,E,F,G>, QObject.Signal7Default5<A,B,C,D,E,F,G>, QObject.Signal7Default6<A,B,C,D,E,F,G>, QObject.Signal7Default7<A,B,C,D,E,F,G>, QObject.Signal8<A,B,C,D,E,F,G,H>, QObject.Signal8Default1<A,B,C,D,E,F,G,H>, QObject.Signal8Default2<A,B,C,D,E,F,G,H>, QObject.Signal8Default3<A,B,C,D,E,F,G,H>, QObject.Signal8Default4<A,B,C,D,E,F,G,H>, QObject.Signal8Default5<A,B,C,D,E,F,G,H>, QObject.Signal8Default6<A,B,C,D,E,F,G,H>, QObject.Signal8Default7<A,B,C,D,E,F,G,H>, QObject.Signal8Default8<A,B,C,D,E,F,G,H>, QObject.Signal9<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default1<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default2<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default3<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default4<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default5<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default6<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default7<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default8<A,B,C,D,E,F,G,H,I>, QObject.Signal9Default9<A,B,C,D,E,F,G,H,I>, QObject.SignalConfiguration
-
Field Summary
Fields Modifier and Type Field Description QObject.PrivateSignal0
aboutToQuit
QObject.Signal0
applicationNameChanged
QObject.Signal0
applicationVersionChanged
QObject.Signal0
organizationDomainChanged
QObject.Signal0
organizationNameChanged
static QMetaObject
staticMetaObject
This variable stores the meta-object for the class. -
Constructor Summary
Constructors Modifier Constructor Description protected
QCoreApplication(QtObject.QPrivateConstructor p)
Constructor for internal use only.protected
QCoreApplication(String[] argv)
-
Method Summary
Modifier and Type Method Description static void
addLibraryPath(String arg__1)
static void
addPostRoutine(Runnable cleanUpFunction)
Adds a post-routine to be executed when deleting QCoreApplication.static void
addPreRoutine(Runnable startUpFunction)
Adds a pre-routine to be executed before initializing QCoreApplication.static String
applicationDirPath()
static String
applicationFilePath()
static String
applicationName()
static long
applicationPid()
static String
applicationVersion()
static List<String>
arguments()
static boolean
closingDown()
boolean
event(QEvent arg__1)
static QAbstractEventDispatcher
eventDispatcher()
static int
exec()
Enters the main event loop and waits until exit() is called.static void
exit()
Overloaded function forexit(int)
withretcode = 0
.static void
exit(int retcode)
static void
flush()
Deprecated.static boolean
hasPendingEvents()
Deprecated.static QCoreApplication
initialize(String[] args)
Initializes the QCoreApplication with the given arguments.static <T extends QCoreApplication>
Tinitialize(String[] args, Function<String[],T> constructor)
Initializes a custom QCoreApplication subclass with the given arguments.static QCoreApplication
initialize(String applicationName, String[] args)
Initializes the QCoreApplication with the given arguments and applicationName.static <T extends QCoreApplication>
Tinitialize(String applicationName, String[] args, Function<String[],T> constructor)
Initializes a custom QCoreApplication subclass with the given arguments and applicationName.static boolean
installTranslator(QTranslator messageFile)
static QCoreApplication
instance()
static boolean
isQuitLockEnabled()
static boolean
isSetuidAllowed()
static List<String>
libraryPaths()
boolean
notify(QObject arg__1, QEvent arg__2)
static String
organizationDomain()
static String
organizationName()
static void
postEvent(QObject receiver, QEvent event)
Overloaded function forpostEvent(io.qt.core.QObject, io.qt.core.QEvent, int)
withpriority = 0
.static void
postEvent(QObject receiver, QEvent event, int priority)
static void
processEvents()
Overloaded function forprocessEvents(io.qt.core.QEventLoop.ProcessEventsFlags)
withflags = new io.qt.core.QEventLoop.ProcessEventsFlags(0)
.static void
processEvents(QEventLoop.ProcessEventsFlag... flags)
Overloaded function forprocessEvents(io.qt.core.QEventLoop.ProcessEventsFlags)
.static void
processEvents(QEventLoop.ProcessEventsFlags flags)
static void
processEvents(QEventLoop.ProcessEventsFlags flags, int maxtime)
static void
quit()
static void
removeLibraryPath(String arg__1)
static void
removePostedEvents(QObject receiver)
Overloaded function forremovePostedEvents(io.qt.core.QObject, int)
witheventType = 0
.static void
removePostedEvents(QObject receiver, int eventType)
static void
removePostRoutine(Runnable cleanUpFunction)
Removes a previously added post-routine.static boolean
removeTranslator(QTranslator messageFile)
static boolean
sendEvent(QObject receiver, QEvent event)
static void
sendPostedEvents()
Overloaded function forsendPostedEvents(io.qt.core.QObject, int)
static void
sendPostedEvents(QObject receiver)
Overloaded function forsendPostedEvents(io.qt.core.QObject, int)
withevent_type = 0
.static void
sendPostedEvents(QObject receiver, int event_type)
static void
setApplicationName(String application)
static void
setApplicationVersion(String version)
static void
setAttribute(Qt.ApplicationAttribute attribute)
Overloaded function forsetAttribute(io.qt.core.Qt.ApplicationAttribute, boolean)
withon = true
.static void
setAttribute(Qt.ApplicationAttribute attribute, boolean on)
static void
setEventDispatcher(QAbstractEventDispatcher eventDispatcher)
static void
setLibraryPaths(Collection<String> arg__1)
static void
setOrganizationDomain(String orgDomain)
static void
setOrganizationName(String orgName)
static void
setQuitLockEnabled(boolean enabled)
static void
setSetuidAllowed(boolean allow)
static void
shutdown()
Destroys the QCoreApplication instance and purges Qt.static boolean
startingUp()
static boolean
testAttribute(Qt.ApplicationAttribute attribute)
static String
translate(String context, String key)
Overloaded function fortranslate(java.lang.String, java.lang.String, java.lang.String, int)
static String
translate(String context, String key, String disambiguation)
Overloaded function fortranslate(java.lang.String, java.lang.String, java.lang.String, int)
withn = -1
.static String
translate(String context, String key, String disambiguation, int n)
Methods inherited from class io.qt.core.QObject
blockSignals, childEvent, children, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connectNotify, customEvent, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnectNotify, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, eventFilter, findChild, findChild, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, findChildren, inherits, inherits, installEventFilter, isSignalConnected, isWidgetType, isWindowType, killTimer, metaObject, moveToThread, objectName, parent, property, qt_metacast, receivers, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, startTimer, thread, timerEvent, toString, tr, tr, tr
-
Field Details
-
staticMetaObject
This variable stores the meta-object for the class. -
aboutToQuit
-
applicationNameChanged
-
applicationVersionChanged
-
organizationDomainChanged
-
organizationNameChanged
-
-
Constructor Details
-
QCoreApplication
-
QCoreApplication
Constructor for internal use only.- Parameters:
p
- expected to benull
.
-
-
Method Details
-
event
-
notify
-
addLibraryPath
-
applicationDirPath
-
applicationFilePath
-
applicationName
-
applicationPid
public static long applicationPid() -
applicationVersion
-
arguments
-
closingDown
public static boolean closingDown() -
eventDispatcher
-
exit
public static void exit()Overloaded function for
exit(int)
withretcode = 0
. -
exit
public static void exit(int retcode) -
flush
Deprecated. -
hasPendingEvents
Deprecated. -
installTranslator
-
instance
-
isQuitLockEnabled
public static boolean isQuitLockEnabled() -
isSetuidAllowed
public static boolean isSetuidAllowed() -
libraryPaths
-
organizationDomain
-
organizationName
-
postEvent
Overloaded function for
postEvent(io.qt.core.QObject, io.qt.core.QEvent, int)
withpriority = 0
. -
postEvent
-
processEvents
Overloaded function for
processEvents(io.qt.core.QEventLoop.ProcessEventsFlags)
. -
processEvents
public static void processEvents()Overloaded function for
processEvents(io.qt.core.QEventLoop.ProcessEventsFlags)
withflags = new io.qt.core.QEventLoop.ProcessEventsFlags(0)
. -
processEvents
-
processEvents
-
quit
public static void quit() -
removeLibraryPath
-
removePostedEvents
Overloaded function for
removePostedEvents(io.qt.core.QObject, int)
witheventType = 0
. -
removePostedEvents
-
removeTranslator
-
sendEvent
-
sendPostedEvents
Overloaded function for
sendPostedEvents(io.qt.core.QObject, int)
withevent_type = 0
. -
sendPostedEvents
public static void sendPostedEvents()Overloaded function for
sendPostedEvents(io.qt.core.QObject, int)
with:
receiver = null
event_type = 0
-
sendPostedEvents
-
setApplicationName
-
setApplicationVersion
-
setAttribute
Overloaded function for
setAttribute(io.qt.core.Qt.ApplicationAttribute, boolean)
withon = true
. -
setAttribute
-
setEventDispatcher
-
setLibraryPaths
-
setOrganizationDomain
-
setOrganizationName
-
setQuitLockEnabled
public static void setQuitLockEnabled(boolean enabled) -
setSetuidAllowed
public static void setSetuidAllowed(boolean allow) -
startingUp
public static boolean startingUp() -
testAttribute
-
translate
Overloaded function for
translate(java.lang.String, java.lang.String, java.lang.String, int)
withn = -1
. -
translate
Overloaded function for
translate(java.lang.String, java.lang.String, java.lang.String, int)
with:
disambiguation = null
n = -1
-
translate
-
initialize
Initializes the QCoreApplication with the given arguments.- Parameters:
args
-- Returns:
- QCoreApplication instance
-
initialize
Initializes the QCoreApplication with the given arguments and applicationName.- Parameters:
applicationName
-args
-- Returns:
- QCoreApplication instance
-
initialize
public static <T extends QCoreApplication> T initialize(String[] args, Function<String[],T> constructor)Initializes a custom QCoreApplication subclass with the given arguments.- Type Parameters:
T
- QCoreApplication subclass- Parameters:
args
-constructor
-- Returns:
- T instance
-
initialize
public static <T extends QCoreApplication> T initialize(String applicationName, String[] args, Function<String[],T> constructor)Initializes a custom QCoreApplication subclass with the given arguments and applicationName.- Type Parameters:
T
- QCoreApplication subclass- Parameters:
applicationName
-args
-constructor
-- Returns:
- T instance
-
shutdown
public static void shutdown()Destroys the QCoreApplication instance and purges Qt. -
exec
public static int exec()Enters the main event loop and waits until exit() is called.- Returns:
- the value that was passed to exit() (which is 0 if exit() is called via quit()).
-
addPreRoutine
Adds a pre-routine to be executed before initializing QCoreApplication.- See Also:
initialize(java.lang.String[])
-
addPostRoutine
Adds a post-routine to be executed when deleting QCoreApplication.- See Also:
shutdown()
-
removePostRoutine
Removes a previously added post-routine.- See Also:
addPostRoutine(java.lang.Runnable)
,shutdown()
-