QCoreApplication: purge deprecated API

Since 5.9 flush()
Since 5.6 notifyInternal()
Since 5.0 trUtf8()

Change-Id: I1cc0fc5ebc3d7f2f4809c4494ab2a7486a481b10
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Edward Welbourne 2020-07-16 18:00:15 +02:00
parent 72205c829b
commit 80602ce2b3
2 changed files with 2 additions and 84 deletions

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@ -712,26 +712,6 @@ QCoreApplication::QCoreApplication(QCoreApplicationPrivate &p)
// QCoreApplicationPrivate::eventDispatcher->startingUp();
}
#ifndef QT_NO_QOBJECT
/*!
\deprecated
This function is equivalent to calling \c {QCoreApplication::eventDispatcher()->flush()},
which also is deprecated, see QAbstractEventDispatcher::flush(). Use sendPostedEvents()
and processEvents() for more fine-grained control of the event loop instead.
Historically this functions was used to flush the platform-specific native event queues.
\sa sendPostedEvents(), processEvents(), QAbstractEventDispatcher::flush()
*/
#if QT_DEPRECATED_SINCE(5, 9)
void QCoreApplication::flush()
{
if (self && self->d_func()->eventDispatcher)
self->d_func()->eventDispatcher->flush();
}
#endif
#endif
/*!
Constructs a Qt core application. Core applications are applications without
a graphical user interface. Such applications are used at the console or as
@ -1030,20 +1010,6 @@ void QCoreApplication::setQuitLockEnabled(bool enabled)
quitLockRefEnabled = enabled;
}
#if QT_DEPRECATED_SINCE(5, 6)
/*!
\internal
\deprecated
This function is here to make it possible for Qt extensions to
hook into event notification without subclassing QApplication
*/
bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event)
{
return notifyInternal2(receiver, event);
}
#endif
/*!
\internal
\since 5.6
@ -2932,29 +2898,6 @@ void QCoreApplication::removeNativeEventFilter(QAbstractNativeEventFilter *filte
eventDispatcher->removeNativeEventFilter(filterObject);
}
/*!
\deprecated
This function returns \c true if there are pending events; otherwise
returns \c false. Pending events can be either from the window
system or posted events using postEvent().
\note this function is not thread-safe. It may only be called in the main
thread and only if there are no other threads running in the application
(including threads Qt starts for its own purposes).
\sa QAbstractEventDispatcher::hasPendingEvents()
*/
#if QT_DEPRECATED_SINCE(5, 3)
bool QCoreApplication::hasPendingEvents()
{
QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance();
if (eventDispatcher)
return eventDispatcher->hasPendingEvents();
return false;
}
#endif
/*!
Returns a pointer to the event dispatcher object for the main thread. If no
event dispatcher exists for the thread, this function returns \nullptr.

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@ -124,9 +124,6 @@ public:
static void postEvent(QObject *receiver, QEvent *event, int priority = Qt::NormalEventPriority);
static void sendPostedEvents(QObject *receiver = nullptr, int event_type = 0);
static void removePostedEvents(QObject *receiver, int eventType = 0);
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED static bool hasPendingEvents();
#endif
static QAbstractEventDispatcher *eventDispatcher();
static void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher);
@ -156,18 +153,8 @@ public:
const char * key,
const char * disambiguation = nullptr,
int n = -1);
#if QT_DEPRECATED_SINCE(5, 0)
enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = UnicodeUTF8, CodecForTr = UnicodeUTF8 };
QT_DEPRECATED static inline QString translate(const char * context, const char * key,
const char * disambiguation, Encoding, int n = -1)
{ return translate(context, key, disambiguation, n); }
#endif
#ifndef QT_NO_QOBJECT
# if QT_DEPRECATED_SINCE(5, 9)
QT_DEPRECATED static void flush();
# endif
void installNativeEventFilter(QAbstractNativeEventFilter *filterObj);
void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
@ -201,9 +188,6 @@ protected:
private:
#ifndef QT_NO_QOBJECT
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event);
# if QT_DEPRECATED_SINCE(5,6)
QT_DEPRECATED bool notifyInternal(QObject *receiver, QEvent *event); // ### Qt6 BIC: remove me
# endif
static bool notifyInternal2(QObject *receiver, QEvent *);
static bool forwardEvent(QObject *receiver, QEvent *event, QEvent *originatingEvent = nullptr);
#endif
@ -232,19 +216,10 @@ private:
friend class QCommandLineParserPrivate;
};
#ifdef QT_NO_DEPRECATED
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context)
#else
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = nullptr, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); }
#endif
#define Q_DECLARE_TR_FUNCTIONS(context) \
public: \
static inline QString tr(const char *sourceText, const char *disambiguation = nullptr, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); } \
QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
private:
typedef void (*QtStartUpFunction)();