Another round of replacing 0 with nullptr

This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.

Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2020-10-07 13:05:48 +02:00
parent b5fc1e4e26
commit 564b59d903
351 changed files with 740 additions and 736 deletions

View File

@ -85,7 +85,7 @@ class NicknameDialog: public QDialog, public Ui::NicknameDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
NicknameDialog(QWidget *parent = 0); NicknameDialog(QWidget *parent = nullptr);
}; };
#endif // CHAT_H #endif // CHAT_H

View File

@ -71,7 +71,7 @@ Q_SIGNALS:
void crashed(); void crashed();
protected: protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
void timerEvent(QTimerEvent *event); void timerEvent(QTimerEvent *event);
private: private:

View File

@ -59,7 +59,7 @@ class Controller : public QWidget
Q_OBJECT Q_OBJECT
public: public:
Controller(QWidget *parent = 0); Controller(QWidget *parent = nullptr);
protected: protected:
void timerEvent(QTimerEvent *event); void timerEvent(QTimerEvent *event);

View File

@ -298,7 +298,7 @@ class DigiFlip : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
DigiFlip(QWidget *parent = 0) DigiFlip(QWidget *parent = nullptr)
: QMainWindow(parent) : QMainWindow(parent)
{ {
m_hour = new Digits(this); m_hour = new Digits(this);

View File

@ -87,7 +87,7 @@ class ColorList : public QWidget, public Flickable
Q_OBJECT Q_OBJECT
public: public:
ColorList(QWidget *parent = 0) ColorList(QWidget *parent = nullptr)
: QWidget(parent) { : QWidget(parent) {
m_offset = 0; m_offset = 0;
m_height = QFontMetrics(font()).height() + 5; m_height = QFontMetrics(font()).height() + 5;

View File

@ -110,7 +110,7 @@ private:
public: public:
FlightInfo(QMainWindow *parent = 0): QMainWindow(parent) { FlightInfo(QMainWindow *parent = nullptr): QMainWindow(parent) {
QWidget *w = new QWidget(this); QWidget *w = new QWidget(this);
ui.setupUi(w); ui.setupUi(w);

View File

@ -61,7 +61,7 @@ class LightMaps: public QWidget
Q_OBJECT Q_OBJECT
public: public:
LightMaps(QWidget *parent = 0); LightMaps(QWidget *parent = nullptr);
void setCenter(qreal lat, qreal lng); void setCenter(qreal lat, qreal lng);
public slots: public slots:
@ -94,4 +94,4 @@ private:
bool invert; bool invert;
}; };
#endif #endif

View File

@ -65,7 +65,7 @@ class SlippyMap: public QObject
Q_OBJECT Q_OBJECT
public: public:
SlippyMap(QObject *parent = 0); SlippyMap(QObject *parent = nullptr);
void invalidate(); void invalidate();
void render(QPainter *p, const QRect &rect); void render(QPainter *p, const QRect &rect);
void pan(const QPoint &delta); void pan(const QPoint &delta);

View File

@ -70,7 +70,7 @@ int world_map[WORLD_SIZE][WORLD_SIZE] = {
class Raycasting: public QWidget class Raycasting: public QWidget
{ {
public: public:
Raycasting(QWidget *parent = 0) Raycasting(QWidget *parent = nullptr)
: QWidget(parent) : QWidget(parent)
, angle(0.5) , angle(0.5)
, playerPos(1.5, 1.5) , playerPos(1.5, 1.5)

View File

@ -58,7 +58,7 @@ class StyleWidget : public QFrame
{ {
Q_OBJECT Q_OBJECT
public: public:
StyleWidget(QWidget *parent = 0); StyleWidget(QWidget *parent = nullptr);
private: private:
Ui_StyleWidget m_ui; Ui_StyleWidget m_ui;

View File

@ -58,7 +58,7 @@ class RasterWindow : public QWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit RasterWindow(QWindow *parent = 0); explicit RasterWindow(QWindow *parent = nullptr);
virtual void render(QPainter *painter); virtual void render(QPainter *painter);

View File

@ -58,7 +58,7 @@ class MyDialog : public QDialog, public Ui::MyDialog
Q_OBJECT Q_OBJECT
public: public:
MyDialog(QWidget *parent = 0); MyDialog(QWidget *parent = nullptr);
}; };
#endif #endif

View File

@ -54,7 +54,7 @@
class Window : public QWindow class Window : public QWindow
{ {
public: public:
Window(QWindow *parent = 0); Window(QWindow *parent = nullptr);
Window(QScreen *screen); Window(QScreen *screen);
protected: protected:

View File

@ -70,7 +70,7 @@ class Window : public QWidget
Q_OBJECT Q_OBJECT
public: public:
Window(QWidget *parent = 0); Window(QWidget *parent = nullptr);
private slots: private slots:
void updateButtons(int row); void updateButtons(int row);

View File

@ -60,7 +60,7 @@ class MySortFilterProxyModel : public QSortFilterProxyModel
Q_OBJECT Q_OBJECT
public: public:
MySortFilterProxyModel(QObject *parent = 0); MySortFilterProxyModel(QObject *parent = nullptr);
QDate filterMinimumDate() const { return minDate; } QDate filterMinimumDate() const { return minDate; }
void setFilterMinimumDate(QDate date); void setFilterMinimumDate(QDate date);

View File

@ -60,7 +60,7 @@ class ImageModel : public QAbstractTableModel
Q_OBJECT Q_OBJECT
public: public:
ImageModel(QObject *parent = 0); ImageModel(QObject *parent = nullptr);
void setImage(const QImage &image); void setImage(const QImage &image);

View File

@ -68,7 +68,7 @@ class Dialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
Dialog(QWidget *parent = 0); Dialog(QWidget *parent = nullptr);
private slots: private slots:
void buttonsOrientationChanged(int index); void buttonsOrientationChanged(int index);

View File

@ -59,7 +59,7 @@ class CircleWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
CircleWidget(QWidget *parent = 0); CircleWidget(QWidget *parent = nullptr);
void setFloatBased(bool floatBased); void setFloatBased(bool floatBased);
void setAntialiased(bool antialiased); void setAntialiased(bool antialiased);

View File

@ -65,7 +65,7 @@ class Highlighter : public QSyntaxHighlighter
Q_OBJECT Q_OBJECT
public: public:
Highlighter(QTextDocument *parent = 0); Highlighter(QTextDocument *parent = nullptr);
protected: protected:
void highlightBlock(const QString &text) override; void highlightBlock(const QString &text) override;

View File

@ -65,7 +65,7 @@ class MainWindow : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
MainWindow(QWidget *parent = 0); MainWindow(QWidget *parent = nullptr);
public slots: public slots:
void about(); void about();

View File

@ -70,7 +70,7 @@ class TextEdit : public QMainWindow
Q_OBJECT Q_OBJECT
public: public:
TextEdit(QWidget *parent = 0); TextEdit(QWidget *parent = nullptr);
bool load(const QString &f); bool load(const QString &f);

View File

@ -60,7 +60,7 @@ class XbelTree : public QTreeWidget
Q_OBJECT Q_OBJECT
public: public:
XbelTree(QWidget *parent = 0); XbelTree(QWidget *parent = nullptr);
bool read(QIODevice *device); bool read(QIODevice *device);
bool write(QIODevice *device) const; bool write(QIODevice *device) const;
@ -75,9 +75,9 @@ private slots:
private: private:
void parseFolderElement(const QDomElement &element, void parseFolderElement(const QDomElement &element,
QTreeWidgetItem *parentItem = 0); QTreeWidgetItem *parentItem = nullptr);
QTreeWidgetItem *createItem(const QDomElement &element, QTreeWidgetItem *createItem(const QDomElement &element,
QTreeWidgetItem *parentItem = 0); QTreeWidgetItem *parentItem = nullptr);
QDomDocument domDocument; QDomDocument domDocument;
QIcon folderIcon; QIcon folderIcon;

View File

@ -70,7 +70,7 @@ class RSSListing : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
RSSListing(QWidget *widget = 0); RSSListing(QWidget *widget = nullptr);
public slots: public slots:
void fetch(); void fetch();

View File

@ -106,7 +106,7 @@ class MyClass : public QObject
Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged) Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged)
public: public:
MyClass(QObject *parent = 0); MyClass(QObject *parent = nullptr);
~MyClass(); ~MyClass();
enum Priority { High, Low, VeryHigh, VeryLow }; enum Priority { High, Low, VeryHigh, VeryLow };

View File

@ -58,7 +58,7 @@ class FilterObject : public QObject
Q_OBJECT Q_OBJECT
public: public:
FilterObject(QObject *parent = 0); FilterObject(QObject *parent = nullptr);
bool eventFilter(QObject *object, QEvent *event) override; bool eventFilter(QObject *object, QEvent *event) override;
void setFilteredObject(QObject *object); void setFilteredObject(QObject *object);

View File

@ -55,7 +55,7 @@
class MyItemModel : public QStandardItemModel class MyItemModel : public QStandardItemModel
{ {
public: public:
MyItemModel(QWidget *parent = 0); MyItemModel(QWidget *parent = nullptr);
}; };
MyItemModel::MyItemModel(QWidget *parent) MyItemModel::MyItemModel(QWidget *parent)
@ -65,7 +65,7 @@ MyItemModel::MyItemModel(QWidget *parent)
class Widget : public QWidget class Widget : public QWidget
{ {
public: public:
Widget(QWidget *parent = 0); Widget(QWidget *parent = nullptr);
}; };
Widget::Widget(QWidget *parent) Widget::Widget(QWidget *parent)

View File

@ -55,7 +55,7 @@
class Widget : public QWidget class Widget : public QWidget
{ {
public: public:
Widget(QWidget *parent = 0); Widget(QWidget *parent = nullptr);
void constCharPointer(); void constCharPointer();
void constCharArray(); void constCharArray();

View File

@ -55,7 +55,7 @@ using namespace std;
class Widget : public QWidget class Widget : public QWidget
{ {
public: public:
Widget(QWidget *parent = 0); Widget(QWidget *parent = nullptr);
}; };
Widget::Widget(QWidget *parent) Widget::Widget(QWidget *parent)

View File

@ -53,7 +53,7 @@
class Widget : public QWidget class Widget : public QWidget
{ {
public: public:
Widget(QWidget *parent = 0); Widget(QWidget *parent = nullptr);
}; };
Widget::Widget(QWidget *parent) Widget::Widget(QWidget *parent)

View File

@ -1184,7 +1184,7 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1);
# define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check) # define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check)
template<typename T, typename X> template<typename T, typename X>
T qt_dynamic_cast_check(X, T* = 0) T qt_dynamic_cast_check(X, T* = nullptr)
{ return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; } { return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; }
#endif #endif

View File

@ -567,7 +567,7 @@ QString QFileSystemEngine::nativeAbsoluteFilePath(const QString &path)
// can be //server or //server/share // can be //server or //server/share
QString absPath; QString absPath;
QVarLengthArray<wchar_t, MAX_PATH> buf(qMax(MAX_PATH, path.size() + 1)); QVarLengthArray<wchar_t, MAX_PATH> buf(qMax(MAX_PATH, path.size() + 1));
wchar_t *fileName = 0; wchar_t *fileName = nullptr;
DWORD retLen = GetFullPathName((wchar_t*)path.utf16(), buf.size(), buf.data(), &fileName); DWORD retLen = GetFullPathName((wchar_t*)path.utf16(), buf.size(), buf.data(), &fileName);
if (retLen > (DWORD)buf.size()) { if (retLen > (DWORD)buf.size()) {
buf.resize(retLen); buf.resize(retLen);

View File

@ -406,7 +406,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
pathInfo = fileInfo; pathInfo = fileInfo;
// Look for a thread // Look for a thread
QWindowsFileSystemWatcherEngineThread *thread = 0; QWindowsFileSystemWatcherEngineThread *thread = nullptr;
QWindowsFileSystemWatcherEngine::Handle handle; QWindowsFileSystemWatcherEngine::Handle handle;
QList<QWindowsFileSystemWatcherEngineThread *>::const_iterator jt, end; QList<QWindowsFileSystemWatcherEngineThread *>::const_iterator jt, end;
end = threads.constEnd(); end = threads.constEnd();

View File

@ -134,7 +134,7 @@ static QString getExternalStoragePublicDirectory(const char *directoryField)
* Locations where applications can place persistent files it owns. * Locations where applications can place persistent files it owns.
* E.g., /storage/org.app/Music * E.g., /storage/org.app/Music
*/ */
static QString getExternalFilesDir(const char *directoryField = 0) static QString getExternalFilesDir(const char *directoryField = nullptr)
{ {
QString &path = (*androidDirCache)[QLatin1String("APPNAME_%1").arg(QLatin1String(directoryField))]; QString &path = (*androidDirCache)[QLatin1String("APPNAME_%1").arg(QLatin1String(directoryField))];
if (!path.isEmpty()) if (!path.isEmpty())

View File

@ -62,7 +62,7 @@ class Q_CORE_EXPORT QWindowsPipeReader : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QWindowsPipeReader(QObject *parent = 0); explicit QWindowsPipeReader(QObject *parent = nullptr);
~QWindowsPipeReader(); ~QWindowsPipeReader();
void setHandle(HANDLE hPipeReadEnd); void setHandle(HANDLE hPipeReadEnd);

View File

@ -111,7 +111,7 @@ class Q_CORE_EXPORT QWindowsPipeWriter : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QWindowsPipeWriter(HANDLE pipeWriteEnd, QObject *parent = 0); explicit QWindowsPipeWriter(HANDLE pipeWriteEnd, QObject *parent = nullptr);
~QWindowsPipeWriter(); ~QWindowsPipeWriter();
bool write(const QByteArray &ba); bool write(const QByteArray &ba);

View File

@ -209,7 +209,7 @@ class Q_CORE_EXPORT QEventDispatcherCoreFoundation : public QAbstractEventDispat
Q_OBJECT Q_OBJECT
public: public:
explicit QEventDispatcherCoreFoundation(QObject *parent = 0); explicit QEventDispatcherCoreFoundation(QObject *parent = nullptr);
void startingUp() override; void startingUp() override;
~QEventDispatcherCoreFoundation(); ~QEventDispatcherCoreFoundation();

View File

@ -162,8 +162,8 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
#else #else
auto q = reinterpret_cast<QEventDispatcherWin32 *>(GetWindowLong(hwnd, GWL_USERDATA)); auto q = reinterpret_cast<QEventDispatcherWin32 *>(GetWindowLong(hwnd, GWL_USERDATA));
#endif #endif
QEventDispatcherWin32Private *d = 0; QEventDispatcherWin32Private *d = nullptr;
if (q != 0) if (q != nullptr)
d = q->d_func(); d = q->d_func();
switch (message) { switch (message) {
@ -187,7 +187,7 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
break; break;
} }
if (type >= 0) { if (type >= 0) {
Q_ASSERT(d != 0); Q_ASSERT(d != nullptr);
QSNDict *sn_vec[4] = { &d->sn_read, &d->sn_write, &d->sn_except, &d->sn_read }; QSNDict *sn_vec[4] = { &d->sn_read, &d->sn_write, &d->sn_except, &d->sn_read };
QSNDict *dict = sn_vec[type]; QSNDict *dict = sn_vec[type];
@ -217,7 +217,7 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
return 0; return 0;
} }
case WM_QT_ACTIVATENOTIFIERS: { case WM_QT_ACTIVATENOTIFIERS: {
Q_ASSERT(d != 0); Q_ASSERT(d != nullptr);
// Postpone activation if we have unhandled socket notifier messages // Postpone activation if we have unhandled socket notifier messages
// in the queue. WM_QT_ACTIVATENOTIFIERS will be posted again as a result of // in the queue. WM_QT_ACTIVATENOTIFIERS will be posted again as a result of
@ -242,7 +242,7 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
return 0; return 0;
} }
case WM_TIMER: case WM_TIMER:
Q_ASSERT(d != 0); Q_ASSERT(d != nullptr);
if (wp == d->sendPostedEventsTimerId) if (wp == d->sendPostedEventsTimerId)
q->sendPostedEvents(); q->sendPostedEvents();
@ -250,7 +250,7 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
d->sendTimerEvent(wp); d->sendTimerEvent(wp);
return 0; return 0;
case WM_QT_SENDPOSTEDEVENTS: case WM_QT_SENDPOSTEDEVENTS:
Q_ASSERT(d != 0); Q_ASSERT(d != nullptr);
// We send posted events manually, if the window procedure was invoked // We send posted events manually, if the window procedure was invoked
// by the foreign event loop (e.g. from the native modal dialog). // by the foreign event loop (e.g. from the native modal dialog).
@ -268,7 +268,7 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp) LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
{ {
QEventDispatcherWin32 *q = qobject_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance()); QEventDispatcherWin32 *q = qobject_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance());
Q_ASSERT(q != 0); Q_ASSERT(q != nullptr);
QEventDispatcherWin32Private *d = q->d_func(); QEventDispatcherWin32Private *d = q->d_func();
MSG *msg = reinterpret_cast<MSG *>(lp); MSG *msg = reinterpret_cast<MSG *>(lp);
// Windows unexpectedly passes PM_NOYIELD flag to the hook procedure, // Windows unexpectedly passes PM_NOYIELD flag to the hook procedure,

View File

@ -73,7 +73,7 @@ class Q_CORE_EXPORT QEventDispatcherWin32 : public QAbstractEventDispatcher
Q_DECLARE_PRIVATE(QEventDispatcherWin32) Q_DECLARE_PRIVATE(QEventDispatcherWin32)
public: public:
explicit QEventDispatcherWin32(QObject *parent = 0); explicit QEventDispatcherWin32(QObject *parent = nullptr);
~QEventDispatcherWin32(); ~QEventDispatcherWin32();
bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) override; bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) override;
@ -103,7 +103,7 @@ public:
HWND internalHwnd(); HWND internalHwnd();
protected: protected:
QEventDispatcherWin32(QEventDispatcherWin32Private &dd, QObject *parent = 0); QEventDispatcherWin32(QEventDispatcherWin32Private &dd, QObject *parent = nullptr);
virtual void sendPostedEvents(); virtual void sendPostedEvents();
void doUnregisterSocketNotifier(QSocketNotifier *notifier); void doUnregisterSocketNotifier(QSocketNotifier *notifier);
void doUnregisterEventNotifier(QWinEventNotifier *notifier); void doUnregisterEventNotifier(QWinEventNotifier *notifier);

View File

@ -81,7 +81,7 @@ static QByteArray toBinaryEncClassName(const QByteArray &className)
return QByteArray(className).replace('/', '.'); return QByteArray(className).replace('/', '.');
} }
static jclass getCachedClass(const QByteArray &classBinEnc, bool *isCached = 0) static jclass getCachedClass(const QByteArray &classBinEnc, bool *isCached = nullptr)
{ {
QReadLocker locker(cachedClassesLock); QReadLocker locker(cachedClassesLock);
const QHash<QString, jclass>::const_iterator &it = cachedClasses->constFind(QString::fromLatin1(classBinEnc)); const QHash<QString, jclass>::const_iterator &it = cachedClasses->constFind(QString::fromLatin1(classBinEnc));

View File

@ -72,7 +72,7 @@ public:
~QJNIEnvironmentPrivate(); ~QJNIEnvironmentPrivate();
JNIEnv *operator->(); JNIEnv *operator->();
operator JNIEnv*() const; operator JNIEnv*() const;
static jclass findClass(const char *className, JNIEnv *env = 0); static jclass findClass(const char *className, JNIEnv *env = nullptr);
private: private:
friend class QAndroidJniEnvironment; friend class QAndroidJniEnvironment;

View File

@ -579,7 +579,7 @@ const QMetaObject *QMetaType::metaObject() const
} }
/*! /*!
\fn void *QMetaType::create(const void *copy = 0) const \fn void *QMetaType::create(const void *copy = nullptr) const
\since 5.0 \since 5.0
Returns a copy of \a copy, assuming it is of the type that this Returns a copy of \a copy, assuming it is of the type that this
@ -624,7 +624,7 @@ void QMetaType::destroy(void *data) const
} }
/*! /*!
\fn void *QMetaType::construct(void *where, const void *copy = 0) const \fn void *QMetaType::construct(void *where, const void *copy = nullptr) const
\since 5.0 \since 5.0
Constructs a value of the type that this QMetaType instance Constructs a value of the type that this QMetaType instance

View File

@ -177,7 +177,7 @@ int qt_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)
} }
fd_set read_fds, write_fds, except_fds; fd_set read_fds, write_fds, except_fds;
struct timeval tv, *ptv = 0; struct timeval tv, *ptv = nullptr;
if (timeout_ts) { if (timeout_ts) {
tv = timespecToTimeval(*timeout_ts); tv = timespecToTimeval(*timeout_ts);

View File

@ -207,7 +207,7 @@ public:
namespace Qt { namespace Qt {
template <typename Functor> template <typename Functor>
auto makePropertyBinding(Functor &&f, const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION, auto makePropertyBinding(Functor &&f, const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION,
std::enable_if_t<std::is_invocable_v<Functor>> * = 0) std::enable_if_t<std::is_invocable_v<Functor>> * = nullptr)
{ {
return QPropertyBinding<std::invoke_result_t<Functor>>(std::forward<Functor>(f), location); return QPropertyBinding<std::invoke_result_t<Functor>>(std::forward<Functor>(f), location);
} }
@ -321,7 +321,7 @@ public:
#ifndef Q_CLANG_QDOC #ifndef Q_CLANG_QDOC
template <typename Functor> template <typename Functor>
explicit QProperty(Functor &&f, const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION, explicit QProperty(Functor &&f, const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION,
typename std::enable_if_t<std::is_invocable_r_v<T, Functor&>> * = 0) typename std::enable_if_t<std::is_invocable_r_v<T, Functor&>> * = nullptr)
: QProperty(QPropertyBinding<T>(std::forward<Functor>(f), location)) : QProperty(QPropertyBinding<T>(std::forward<Functor>(f), location))
{} {}
#else #else
@ -821,7 +821,7 @@ public:
#ifndef Q_CLANG_QDOC #ifndef Q_CLANG_QDOC
template <typename Functor> template <typename Functor>
explicit QObjectBindableProperty(Functor &&f, const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION, explicit QObjectBindableProperty(Functor &&f, const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION,
typename std::enable_if_t<std::is_invocable_r_v<T, Functor&>> * = 0) typename std::enable_if_t<std::is_invocable_r_v<T, Functor&>> * = nullptr)
: QObjectBindableProperty(QPropertyBinding<T>(std::forward<Functor>(f), location)) : QObjectBindableProperty(QPropertyBinding<T>(std::forward<Functor>(f), location))
{} {}
#else #else

View File

@ -76,7 +76,7 @@ namespace {
static QString windowsErrorString(int errorCode) static QString windowsErrorString(int errorCode)
{ {
QString ret; QString ret;
wchar_t *string = 0; wchar_t *string = nullptr;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
NULL, NULL,
errorCode, errorCode,

View File

@ -103,7 +103,7 @@ int QMachOParser::parse(const char *m_s, ulong fdlen, const QString &library, QS
return ns(QLibrary::tr("file too small"), library, errorString); return ns(QLibrary::tr("file too small"), library, errorString);
// find out if this is a fat Mach-O binary first // find out if this is a fat Mach-O binary first
const my_mach_header *header = 0; const my_mach_header *header = nullptr;
const fat_header *fat = reinterpret_cast<const fat_header *>(m_s); const fat_header *fat = reinterpret_cast<const fat_header *>(m_s);
if (fat->magic == qToBigEndian(FAT_MAGIC)) { if (fat->magic == qToBigEndian(FAT_MAGIC)) {
// find our architecture in the binary // find our architecture in the binary

View File

@ -895,7 +895,7 @@ bool QThread::isRunning() const
} }
// No threads: so we can just use static variables // No threads: so we can just use static variables
static QThreadData *data = 0; static QThreadData *data = nullptr;
QThreadData *QThreadData::current(bool createIfNecessary) QThreadData *QThreadData::current(bool createIfNecessary)
{ {

View File

@ -208,7 +208,7 @@ public:
class QThreadPrivate : public QObjectPrivate class QThreadPrivate : public QObjectPrivate
{ {
public: public:
QThreadPrivate(QThreadData *d = 0); QThreadPrivate(QThreadData *d = nullptr);
~QThreadPrivate(); ~QThreadPrivate();
mutable QMutex mutex; mutable QMutex mutex;

View File

@ -126,7 +126,7 @@ QT_BEGIN_NAMESPACE
*/ */
/*! /*!
\fn template <typename T, typename Cleanup> QScopedPointer<T, Cleanup>::QScopedPointer(T *p = 0) \fn template <typename T, typename Cleanup> QScopedPointer<T, Cleanup>::QScopedPointer(T *p = nullptr)
Constructs this QScopedPointer instance and sets its pointer to \a p. Constructs this QScopedPointer instance and sets its pointer to \a p.
*/ */
@ -242,7 +242,7 @@ QT_BEGIN_NAMESPACE
*/ */
/*! /*!
\fn template <typename T, typename Cleanup> void QScopedPointer<T, Cleanup>::reset(T *other = 0) \fn template <typename T, typename Cleanup> void QScopedPointer<T, Cleanup>::reset(T *other = nullptr)
Deletes the existing object it is pointing to (if any), and sets its pointer to Deletes the existing object it is pointing to (if any), and sets its pointer to
\a other. QScopedPointer now owns \a other and will delete it in its \a other. QScopedPointer now owns \a other and will delete it in its

View File

@ -64,7 +64,7 @@ template <typename T, typename Cleanup = QScopedPointerDeleter<T> >
class QCustomScopedPointer : public QScopedPointer<T, Cleanup> class QCustomScopedPointer : public QScopedPointer<T, Cleanup>
{ {
public: public:
explicit inline QCustomScopedPointer(T *p = 0) explicit inline QCustomScopedPointer(T *p = nullptr)
: QScopedPointer<T, Cleanup>(p) : QScopedPointer<T, Cleanup>(p)
{ {
} }
@ -107,7 +107,7 @@ template <typename T>
class QScopedSharedPointer : public QCustomScopedPointer<T, QScopedPointerSharedDeleter<T> > class QScopedSharedPointer : public QCustomScopedPointer<T, QScopedPointerSharedDeleter<T> >
{ {
public: public:
explicit inline QScopedSharedPointer(T *p = 0) explicit inline QScopedSharedPointer(T *p = nullptr)
: QCustomScopedPointer<T, QScopedPointerSharedDeleter<T> >(p) : QCustomScopedPointer<T, QScopedPointerSharedDeleter<T> >(p)
{ {
} }

View File

@ -56,7 +56,7 @@ void (*qdbus_resolve_me(const char *name))();
#if !defined QT_LINKED_LIBDBUS #if !defined QT_LINKED_LIBDBUS
#if QT_CONFIG(library) #if QT_CONFIG(library)
static QLibrary *qdbus_libdbus = 0; static QLibrary *qdbus_libdbus = nullptr;
void qdbus_unloadLibDBus() void qdbus_unloadLibDBus()
{ {
@ -66,7 +66,7 @@ void qdbus_unloadLibDBus()
qdbus_libdbus->unload(); qdbus_libdbus->unload();
} }
delete qdbus_libdbus; delete qdbus_libdbus;
qdbus_libdbus = 0; qdbus_libdbus = nullptr;
} }
#endif #endif
@ -118,7 +118,7 @@ bool qdbus_loadLibDBus()
} }
delete lib; delete lib;
lib = 0; lib = nullptr;
return false; return false;
#else #else
return true; return true;

View File

@ -130,9 +130,9 @@ void MainWindow::showList()
headerLabels << tr("Lists"); headerLabels << tr("Lists");
treeWidget->setHeaderLabels(headerLabels); treeWidget->setHeaderLabels(headerLabels);
QTreeWidgetItem *parentItem = 0; QTreeWidgetItem *parentItem = nullptr;
QTreeWidgetItem *item; QTreeWidgetItem *item;
QTreeWidgetItem *lastItem = 0; QTreeWidgetItem *lastItem = nullptr;
parentItems.clear(); parentItems.clear();
previousItems.clear(); previousItems.clear();

View File

@ -1752,7 +1752,7 @@ void restoreOverrideCursor();
static QFont font(); static QFont font();
static QFont font(const QWidget*); static QFont font(const QWidget*);
static QFont font(const char *className); static QFont font(const char *className);
static void setFont(const QFont &, const char* className = 0); static void setFont(const QFont &, const char *className = nullptr);
static QFontMetrics fontMetrics(); static QFontMetrics fontMetrics();
#ifndef QT_NO_CLIPBOARD #ifndef QT_NO_CLIPBOARD

View File

@ -68,7 +68,7 @@ typedef double GLdouble;
unsigned clamped = qMin(unsigned(error - GL_INVALID_ENUM), 4U); \ unsigned clamped = qMin(unsigned(error - GL_INVALID_ENUM), 4U); \
const char *errors[] = { "GL_INVALID_ENUM", "GL_INVALID_VALUE", "GL_INVALID_OPERATION", "Unknown" }; \ const char *errors[] = { "GL_INVALID_ENUM", "GL_INVALID_VALUE", "GL_INVALID_OPERATION", "Unknown" }; \
printf("GL error at %s:%d: %s\n", __FILE__, __LINE__, errors[clamped]); \ printf("GL error at %s:%d: %s\n", __FILE__, __LINE__, errors[clamped]); \
int *value = 0; \ int *value = nullptr; \
*value = 0; \ *value = 0; \
} }
#else #else

View File

@ -510,7 +510,7 @@ void QMacCGContext::initialize(const QImage *image, QPainter *painter)
clip &= painterClip; clip &= painterClip;
} }
qt_mac_clip_cg(context, clip, 0); qt_mac_clip_cg(context, clip, nullptr);
CGContextTranslateCTM(context, deviceTransform.dx(), deviceTransform.dy()); CGContextTranslateCTM(context, deviceTransform.dx(), deviceTransform.dy());
} }

View File

@ -60,7 +60,7 @@ class Q_GUI_EXPORT QWindowsGuiEventDispatcher : public QEventDispatcherWin32
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QWindowsGuiEventDispatcher(QObject *parent = 0); explicit QWindowsGuiEventDispatcher(QObject *parent = nullptr);
static const char *windowsMessageName(UINT msg); static const char *windowsMessageName(UINT msg);

View File

@ -84,7 +84,7 @@ QStaticTextUserData::~QStaticTextUserData()
class MyWidget: public QWidget class MyWidget: public QWidget
{ {
public: public:
MyWidget(QWidget *parent = 0) : QWidget(parent), m_staticText("This is static text") MyWidget(QWidget *parent = nullptr) : QWidget(parent), m_staticText("This is static text")
protected: protected:
void paintEvent(QPaintEvent *) void paintEvent(QPaintEvent *)

View File

@ -1139,7 +1139,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q
int dpi, int dpi,
const QSharedPointer<QWindowsFontEngineData> &data) const QSharedPointer<QWindowsFontEngineData> &data)
{ {
QFontEngine *fe = 0; QFontEngine *fe = nullptr;
LOGFONT lf = fontDefToLOGFONT(request, faceName); LOGFONT lf = fontDefToLOGFONT(request, faceName);
const bool preferClearTypeAA = lf.lfQuality == CLEARTYPE_QUALITY; const bool preferClearTypeAA = lf.lfQuality == CLEARTYPE_QUALITY;

View File

@ -642,7 +642,7 @@ qreal QWindowsFontEngine::minRightBearing() const
HDC hdc = m_fontEngineData->hdc; HDC hdc = m_fontEngineData->hdc;
SelectObject(hdc, hfont); SelectObject(hdc, hfont);
if (ttf) { if (ttf) {
ABC *abc = 0; ABC *abc = nullptr;
int n = tm.tmLastChar - tm.tmFirstChar; int n = tm.tmLastChar - tm.tmFirstChar;
if (n <= max_font_count) { if (n <= max_font_count) {
abc = new ABC[n+1]; abc = new ABC[n+1];
@ -706,7 +706,7 @@ static inline QPointF qt_to_qpointf(const POINTFX &pt, qreal scale, qreal stretc
#endif #endif
static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc, static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
QPainterPath *path, bool ttf, glyph_metrics_t *metric = 0, QPainterPath *path, bool ttf, glyph_metrics_t *metric = nullptr,
qreal scale = 1.0, qreal stretch = 1.0) qreal scale = 1.0, qreal stretch = 1.0)
{ {
MAT2 mat; MAT2 mat;

View File

@ -115,7 +115,7 @@ public:
bool supportsTransformation(const QTransform &transform) const override; bool supportsTransformation(const QTransform &transform) const override;
#ifndef Q_CC_MINGW #ifndef Q_CC_MINGW
void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0) override; void getGlyphBearings(glyph_t glyph, qreal *leftBearing = nullptr, qreal *rightBearing = nullptr) override;
#endif #endif
bool hasUnreliableGlyphOutline() const override; bool hasUnreliableGlyphOutline() const override;

View File

@ -209,7 +209,7 @@ static QSet<QByteArray> interfaceNames(int socket)
static QNetworkInterfacePrivate *findInterface(int socket, QList<QNetworkInterfacePrivate *> &interfaces, static QNetworkInterfacePrivate *findInterface(int socket, QList<QNetworkInterfacePrivate *> &interfaces,
struct ifreq &req) struct ifreq &req)
{ {
QNetworkInterfacePrivate *iface = 0; QNetworkInterfacePrivate *iface = nullptr;
int ifindex = 0; int ifindex = 0;
#if !defined(QT_NO_IPV6IFNAME) || defined(SIOCGIFINDEX) #if !defined(QT_NO_IPV6IFNAME) || defined(SIOCGIFINDEX)
@ -618,7 +618,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
for (ifaddrs *ptr = interfaceListing; ptr; ptr = ptr->ifa_next) { for (ifaddrs *ptr = interfaceListing; ptr; ptr = ptr->ifa_next) {
// Find the interface // Find the interface
QLatin1String name(ptr->ifa_name); QLatin1String name(ptr->ifa_name);
QNetworkInterfacePrivate *iface = 0; QNetworkInterfacePrivate *iface = nullptr;
QList<QNetworkInterfacePrivate *>::Iterator if_it = interfaces.begin(); QList<QNetworkInterfacePrivate *>::Iterator if_it = interfaces.begin();
for ( ; if_it != interfaces.end(); ++if_it) for ( ; if_it != interfaces.end(); ++if_it)
if ((*if_it)->name == name) { if ((*if_it)->name == name) {

View File

@ -60,7 +60,7 @@ class QDeviceDiscoveryDummy : public QDeviceDiscovery
Q_OBJECT Q_OBJECT
public: public:
QDeviceDiscoveryDummy(QDeviceTypes types, QObject *parent = 0); QDeviceDiscoveryDummy(QDeviceTypes types, QObject *parent = nullptr);
QStringList scanConnectedDevices() override; QStringList scanConnectedDevices() override;
}; };

View File

@ -60,7 +60,7 @@ class QDeviceDiscoveryStatic : public QDeviceDiscovery
Q_OBJECT Q_OBJECT
public: public:
QDeviceDiscoveryStatic(QDeviceTypes types, QObject *parent = 0); QDeviceDiscoveryStatic(QDeviceTypes types, QObject *parent = nullptr);
QStringList scanConnectedDevices() override; QStringList scanConnectedDevices() override;
private: private:

View File

@ -60,7 +60,7 @@ QDeviceDiscovery *QDeviceDiscovery::create(QDeviceTypes types, QObject *parent)
{ {
qCDebug(lcDD) << "udev device discovery for type" << types; qCDebug(lcDD) << "udev device discovery for type" << types;
QDeviceDiscovery *helper = 0; QDeviceDiscovery *helper = nullptr;
struct udev *udev; struct udev *udev;
udev = udev_new(); udev = udev_new();

View File

@ -250,8 +250,8 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
KeycodeAction result = None; KeycodeAction result = None;
bool first_press = pressed && !autorepeat; bool first_press = pressed && !autorepeat;
const QEvdevKeyboardMap::Mapping *map_plain = 0; const QEvdevKeyboardMap::Mapping *map_plain = nullptr;
const QEvdevKeyboardMap::Mapping *map_withmod = 0; const QEvdevKeyboardMap::Mapping *map_withmod = nullptr;
quint8 modifiers = m_modifiers; quint8 modifiers = m_modifiers;

View File

@ -64,7 +64,7 @@ class QTsLibMouseHandler : public QObject
Q_OBJECT Q_OBJECT
public: public:
QTsLibMouseHandler(const QString &key, const QString &specification, QObject *parent = 0); QTsLibMouseHandler(const QString &key, const QString &specification, QObject *parent = nullptr);
~QTsLibMouseHandler(); ~QTsLibMouseHandler();
private slots: private slots:

View File

@ -98,7 +98,7 @@ namespace QtAndroidAccessibility
QAccessibleInterface *interfaceFromId(jint objectId) QAccessibleInterface *interfaceFromId(jint objectId)
{ {
QAccessibleInterface *iface = 0; QAccessibleInterface *iface = nullptr;
if (objectId == -1) { if (objectId == -1) {
QWindow *win = qApp->focusWindow(); QWindow *win = qApp->focusWindow();
if (win) if (win)
@ -164,7 +164,7 @@ namespace QtAndroidAccessibility
QPoint pos = QHighDpi::fromNativePixels(QPoint(int(x), int(y)), root->window()); QPoint pos = QHighDpi::fromNativePixels(QPoint(int(x), int(y)), root->window());
QAccessibleInterface *child = root->childAt(pos.x(), pos.y()); QAccessibleInterface *child = root->childAt(pos.x(), pos.y());
QAccessibleInterface *lastChild = 0; QAccessibleInterface *lastChild = nullptr;
while (child && (child != lastChild)) { while (child && (child != lastChild)) {
lastChild = child; lastChild = child;
child = child->childAt(pos.x(), pos.y()); child = child->childAt(pos.x(), pos.y());

View File

@ -96,9 +96,9 @@ namespace QtAndroid
}; };
void setSystemUiVisibility(SystemUiVisibility uiVisibility); void setSystemUiVisibility(SystemUiVisibility uiVisibility);
jobject createBitmap(QImage img, JNIEnv *env = 0); jobject createBitmap(QImage img, JNIEnv *env = nullptr);
jobject createBitmap(int width, int height, QImage::Format format, JNIEnv *env); jobject createBitmap(int width, int height, QImage::Format format, JNIEnv *env);
jobject createBitmapDrawable(jobject bitmap, JNIEnv *env = 0); jobject createBitmapDrawable(jobject bitmap, JNIEnv *env = nullptr);
const char *classErrorMsgFmt(); const char *classErrorMsgFmt();
const char *methodErrorMsgFmt(); const char *methodErrorMsgFmt();

View File

@ -59,12 +59,12 @@ using namespace QtAndroid;
namespace QtAndroidMenu namespace QtAndroidMenu
{ {
static QList<QAndroidPlatformMenu *> pendingContextMenus; static QList<QAndroidPlatformMenu *> pendingContextMenus;
static QAndroidPlatformMenu *visibleMenu = 0; static QAndroidPlatformMenu *visibleMenu = nullptr;
static QRecursiveMutex visibleMenuMutex; static QRecursiveMutex visibleMenuMutex;
static QSet<QAndroidPlatformMenuBar *> menuBars; static QSet<QAndroidPlatformMenuBar *> menuBars;
static QAndroidPlatformMenuBar *visibleMenuBar = 0; static QAndroidPlatformMenuBar *visibleMenuBar = nullptr;
static QWindow *activeTopLevelWindow = 0; static QWindow *activeTopLevelWindow = nullptr;
static QRecursiveMutex menuBarMutex; static QRecursiveMutex menuBarMutex;
static jmethodID openContextMenuMethodID = 0; static jmethodID openContextMenuMethodID = 0;

View File

@ -48,7 +48,7 @@ class QAndroidEventDispatcher : public QUnixEventDispatcherQPA
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QAndroidEventDispatcher(QObject *parent = 0); explicit QAndroidEventDispatcher(QObject *parent = nullptr);
~QAndroidEventDispatcher(); ~QAndroidEventDispatcher();
void start(); void start();
void stop(); void stop();

View File

@ -91,7 +91,7 @@ private:
} // namespace anonymous } // namespace anonymous
static QAndroidInputContext *m_androidInputContext = 0; static QAndroidInputContext *m_androidInputContext = nullptr;
static char const *const QtNativeInputConnectionClassName = "org/qtproject/qt/android/QtNativeInputConnection"; static char const *const QtNativeInputConnectionClassName = "org/qtproject/qt/android/QtNativeInputConnection";
static char const *const QtExtractedTextClassName = "org/qtproject/qt/android/QtExtractedText"; static char const *const QtExtractedTextClassName = "org/qtproject/qt/android/QtExtractedText";
static jclass m_extractedTextClass = 0; static jclass m_extractedTextClass = 0;

View File

@ -64,7 +64,7 @@ public:
QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system, const QStringList& paramList) QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{ {
Q_UNUSED(paramList); Q_UNUSED(paramList);
QDirectFbIntegration *integration = 0; QDirectFbIntegration *integration = nullptr;
if (!system.compare(QLatin1String("directfb"), Qt::CaseInsensitive)) if (!system.compare(QLatin1String("directfb"), Qt::CaseInsensitive))
integration = new QDirectFbIntegration; integration = new QDirectFbIntegration;

View File

@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
extern QDirectFBEGLHooks platform_hook; extern QDirectFBEGLHooks platform_hook;
static QDirectFBEGLHooks *hooks = &platform_hook; static QDirectFBEGLHooks *hooks = &platform_hook;
#else #else
static QDirectFBEGLHooks *hooks = 0; static QDirectFBEGLHooks *hooks = nullptr;
#endif #endif
/** /**

View File

@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
IDirectFB *QDirectFbConvenience::dfbInterface() IDirectFB *QDirectFbConvenience::dfbInterface()
{ {
static IDirectFB *dfb = 0; static IDirectFB *dfb = nullptr;
if (!dfb) { if (!dfb) {
DFBResult result = DirectFBCreate(&dfb); DFBResult result = DirectFBCreate(&dfb);
if (result != DFB_OK) { if (result != DFB_OK) {
@ -247,7 +247,7 @@ QEvent::Type QDirectFbConvenience::eventType(DFBWindowEventType type)
return QEvent::None; return QEvent::None;
} }
} }
QDirectFbKeyMap *QDirectFbConvenience::dfbKeymap = 0; QDirectFbKeyMap *QDirectFbConvenience::dfbKeymap = nullptr;
QDirectFbKeyMap *QDirectFbConvenience::keyMap() QDirectFbKeyMap *QDirectFbConvenience::keyMap()
{ {
if (!dfbKeymap) if (!dfbKeymap)

View File

@ -98,13 +98,13 @@ template <typename T>
class QDirectFBPointer : public QScopedPointer<T, QDirectFBInterfaceCleanupHandler<T> > class QDirectFBPointer : public QScopedPointer<T, QDirectFBInterfaceCleanupHandler<T> >
{ {
public: public:
QDirectFBPointer(T *t = 0) QDirectFBPointer(T *t = nullptr)
: QScopedPointer<T, QDirectFBInterfaceCleanupHandler<T> >(t) : QScopedPointer<T, QDirectFBInterfaceCleanupHandler<T> >(t)
{} {}
T** outPtr() T** outPtr()
{ {
this->reset(0); this->reset(nullptr);
return &this->d; return &this->d;
} }
}; };

View File

@ -52,7 +52,7 @@ class QIntegrityHIDManager : public QThread
{ {
Q_OBJECT Q_OBJECT
public: public:
QIntegrityHIDManager(const QString &key, const QString &specification, QObject *parent = 0); QIntegrityHIDManager(const QString &key, const QString &specification, QObject *parent = nullptr);
~QIntegrityHIDManager(); ~QIntegrityHIDManager();
void run(void); void run(void);

View File

@ -52,7 +52,7 @@ class QIosOptionalPlugin_NSPhotoLibrary : public QObject, QIosOptionalPluginInte
Q_INTERFACES(QIosOptionalPluginInterface) Q_INTERFACES(QIosOptionalPluginInterface)
public: public:
explicit QIosOptionalPlugin_NSPhotoLibrary(QObject* = 0) {}; explicit QIosOptionalPlugin_NSPhotoLibrary(QObject * = nullptr) {};
~QIosOptionalPlugin_NSPhotoLibrary() {} ~QIosOptionalPlugin_NSPhotoLibrary() {}
UIViewController* createImagePickerController(QIOSFileDialog *fileDialog) const override UIViewController* createImagePickerController(QIOSFileDialog *fileDialog) const override

View File

@ -54,7 +54,7 @@ static QThreadStorage<QString> g_iteratorCurrentUrl;
static QThreadStorage<QPointer<QIOSAssetData> > g_assetDataCache; static QThreadStorage<QPointer<QIOSAssetData> > g_assetDataCache;
static const int kBufferSize = 10; static const int kBufferSize = 10;
static ALAsset *kNoAsset = 0; static ALAsset *kNoAsset = nullptr;
static bool ensureAuthorizationDialogNotBlocked() static bool ensureAuthorizationDialogNotBlocked()
{ {
@ -366,7 +366,7 @@ bool QIOSFileEngineAssetsLibrary::close()
// Delete later, so that we can reuse the asset if a QFile is // Delete later, so that we can reuse the asset if a QFile is
// opened with the same path during the same event loop cycle. // opened with the same path during the same event loop cycle.
m_data->deleteLater(); m_data->deleteLater();
m_data = 0; m_data = nullptr;
} }
return true; return true;
} }
@ -410,7 +410,7 @@ qint64 QIOSFileEngineAssetsLibrary::read(char *data, qint64 maxlen)
if (!bytesRead) if (!bytesRead)
return 0; return 0;
NSError *error = 0; NSError *error = nullptr;
[[asset defaultRepresentation] getBytes:(uint8_t *)data fromOffset:m_offset length:bytesRead error:&error]; [[asset defaultRepresentation] getBytes:(uint8_t *)data fromOffset:m_offset length:bytesRead error:&error];
if (error) { if (error) {

View File

@ -53,7 +53,7 @@ public:
bool processPostedEvents() override; bool processPostedEvents() override;
protected: protected:
explicit QIOSEventDispatcher(QObject *parent = 0); explicit QIOSEventDispatcher(QObject *parent = nullptr);
}; };
class QIOSJumpingEventDispatcher : public QIOSEventDispatcher class QIOSJumpingEventDispatcher : public QIOSEventDispatcher
@ -61,7 +61,7 @@ class QIOSJumpingEventDispatcher : public QIOSEventDispatcher
Q_OBJECT Q_OBJECT
public: public:
QIOSJumpingEventDispatcher(QObject *parent = 0); QIOSJumpingEventDispatcher(QObject *parent = nullptr);
bool processEvents(QEventLoop::ProcessEventsFlags flags) override; bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
// Public since we can't friend Objective-C methods // Public since we can't friend Objective-C methods
@ -76,4 +76,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QIOSEVENTDISPATCHER_H #endif // QIOSEVENTDISPATCHER_H

View File

@ -185,7 +185,7 @@ FirstResponderCandidate::FirstResponderCandidate(UIResponder *responder)
{ {
} }
UIResponder *FirstResponderCandidate::s_firstResponderCandidate = 0; UIResponder *FirstResponderCandidate::s_firstResponderCandidate = nullptr;
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -111,7 +111,7 @@ public:
void scrollToCursor(); void scrollToCursor();
void scroll(int y); void scroll(int y);
void updateKeyboardState(NSNotification *notification = 0); void updateKeyboardState(NSNotification *notification = nullptr);
const ImeState &imeState() { return m_imeState; } const ImeState &imeState() { return m_imeState; }
const KeyboardState &keyboardState() { return m_keyboardState; } const KeyboardState &keyboardState() { return m_keyboardState; }

View File

@ -54,7 +54,7 @@
// m_currentMenu points to the currently visible menu. // m_currentMenu points to the currently visible menu.
// Only one menu will be visible at a time, and if a second menu // Only one menu will be visible at a time, and if a second menu
// is shown on top of a first, the first one will be told to hide. // is shown on top of a first, the first one will be told to hide.
QIOSMenu *QIOSMenu::m_currentMenu = 0; QIOSMenu *QIOSMenu::m_currentMenu = nullptr;
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -441,7 +441,7 @@ void QIOSMenu::dismiss()
break; break;
} }
m_currentMenu = 0; m_currentMenu = nullptr;
m_visible = false; m_visible = false;
} }
@ -458,13 +458,13 @@ void QIOSMenu::toggleShowUsingUIMenuController(bool show)
Q_ASSERT(m_menuController); Q_ASSERT(m_menuController);
[[UIMenuController sharedMenuController] setMenuVisible:NO animated:YES]; [[UIMenuController sharedMenuController] setMenuVisible:NO animated:YES];
[m_menuController release]; [m_menuController release];
m_menuController = 0; m_menuController = nullptr;
} }
} }
void QIOSMenu::toggleShowUsingUIPickerView(bool show) void QIOSMenu::toggleShowUsingUIPickerView(bool show)
{ {
static QObject *focusObjectWithPickerView = 0; static QObject *focusObjectWithPickerView = nullptr;
if (show) { if (show) {
Q_ASSERT(!m_pickerView); Q_ASSERT(!m_pickerView);
@ -477,12 +477,12 @@ void QIOSMenu::toggleShowUsingUIPickerView(bool show)
} else { } else {
Q_ASSERT(focusObjectWithPickerView); Q_ASSERT(focusObjectWithPickerView);
focusObjectWithPickerView->removeEventFilter(this); focusObjectWithPickerView->removeEventFilter(this);
focusObjectWithPickerView = 0; focusObjectWithPickerView = nullptr;
Q_ASSERT(m_pickerView); Q_ASSERT(m_pickerView);
[m_pickerView listenForKeyboardWillHideNotification:NO]; [m_pickerView listenForKeyboardWillHideNotification:NO];
[m_pickerView release]; [m_pickerView release];
m_pickerView = 0; m_pickerView = nullptr;
qApp->inputMethod()->update(Qt::ImEnabled | Qt::ImPlatformData); qApp->inputMethod()->update(Qt::ImEnabled | Qt::ImPlatformData);
} }

View File

@ -50,7 +50,7 @@ class QQnxAbstractNavigator : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QQnxAbstractNavigator(QObject *parent = 0); explicit QQnxAbstractNavigator(QObject *parent = nullptr);
~QQnxAbstractNavigator(); ~QQnxAbstractNavigator();
bool invokeUrl(const QUrl &url); bool invokeUrl(const QUrl &url);

View File

@ -64,7 +64,7 @@ public:
enum KeyboardMode { Default, Url, Email, Web, NumPunc, Number, Symbol, Phone, Pin, Password, Alphanumeric }; enum KeyboardMode { Default, Url, Email, Web, NumPunc, Number, Symbol, Phone, Pin, Password, Alphanumeric };
enum EnterKeyType { DefaultReturn, Connect, Done, Go, Join, Next, Search, Send, Submit }; enum EnterKeyType { DefaultReturn, Connect, Done, Go, Join, Next, Search, Send, Submit };
explicit QQnxAbstractVirtualKeyboard(QObject *parent = 0); explicit QQnxAbstractVirtualKeyboard(QObject *parent = nullptr);
virtual bool showKeyboard() = 0; virtual bool showKeyboard() = 0;
virtual bool hideKeyboard() = 0; virtual bool hideKeyboard() = 0;

View File

@ -77,7 +77,7 @@ QQnxBuffer::QQnxBuffer(screen_buffer_t buffer)
// Get access to buffer's data // Get access to buffer's data
errno = 0; errno = 0;
uchar *dataPtr = 0; uchar *dataPtr = nullptr;
Q_SCREEN_CRITICALERROR( Q_SCREEN_CRITICALERROR(
screen_get_buffer_property_pv(buffer, SCREEN_PROPERTY_POINTER, (void **)&dataPtr), screen_get_buffer_property_pv(buffer, SCREEN_PROPERTY_POINTER, (void **)&dataPtr),
"Failed to query buffer pointer"); "Failed to query buffer pointer");

View File

@ -55,8 +55,8 @@ public:
virtual ~QQnxBuffer(); virtual ~QQnxBuffer();
screen_buffer_t nativeBuffer() const { return m_buffer; } screen_buffer_t nativeBuffer() const { return m_buffer; }
const QImage *image() const { return (m_buffer != 0) ? &m_image : 0; } const QImage *image() const { return (m_buffer != nullptr) ? &m_image : nullptr; }
QImage *image() { return (m_buffer != 0) ? &m_image : 0; } QImage *image() { return (m_buffer != nullptr) ? &m_image : nullptr; }
QRect rect() const { return m_image.rect(); } QRect rect() const { return m_image.rect(); }

View File

@ -64,7 +64,7 @@ public:
ButtonDown ButtonDown
}; };
explicit QQnxButtonEventNotifier(QObject *parent = 0); explicit QQnxButtonEventNotifier(QObject *parent = nullptr);
~QQnxButtonEventNotifier(); ~QQnxButtonEventNotifier();
public Q_SLOTS: public Q_SLOTS:

View File

@ -76,8 +76,8 @@
static QQnxInputContext *sInputContextInstance; static QQnxInputContext *sInputContextInstance;
static QColor sSelectedColor(0,0xb8,0,85); static QColor sSelectedColor(0,0xb8,0,85);
static const input_session_t *sSpellCheckSession = 0; static const input_session_t *sSpellCheckSession = nullptr;
static const input_session_t *sInputSession = 0; static const input_session_t *sInputSession = nullptr;
static bool isSessionOkay(input_session_t *ic) static bool isSessionOkay(input_session_t *ic)
{ {
return ic !=0 && sInputSession != 0 && ic->component_id == sInputSession->component_id; return ic !=0 && sInputSession != 0 && ic->component_id == sInputSession->component_id;
@ -515,13 +515,13 @@ static spannable_string_t *toSpannableString(const QString &text)
} }
static const input_session_t *(*p_ictrl_open_session)(connection_interface_t *) = 0; static const input_session_t *(*p_ictrl_open_session)(connection_interface_t *) = nullptr;
static void (*p_ictrl_close_session)(input_session_t *) = 0; static void (*p_ictrl_close_session)(input_session_t *) = nullptr;
static int32_t (*p_ictrl_dispatch_event)(event_t*) = 0; static int32_t (*p_ictrl_dispatch_event)(event_t*) = nullptr;
static int32_t (*p_imf_client_init)() = 0; static int32_t (*p_imf_client_init)() = nullptr;
static void (*p_imf_client_disconnect)() = 0; static void (*p_imf_client_disconnect)() = nullptr;
static int32_t (*p_vkb_init_selection_service)() = 0; static int32_t (*p_vkb_init_selection_service)() = nullptr;
static int32_t (*p_ictrl_get_num_active_sessions)() = 0; static int32_t (*p_ictrl_get_num_active_sessions)() = nullptr;
static bool s_imfInitFailed = false; static bool s_imfInitFailed = false;
static bool imfAvailable() static bool imfAvailable()
@ -602,7 +602,7 @@ QQnxInputContext::~QQnxInputContext()
qInputContextDebug(); qInputContextDebug();
Q_ASSERT(sInputContextInstance == this); Q_ASSERT(sInputContextInstance == this);
sInputContextInstance = 0; sInputContextInstance = nullptr;
if (!imfAvailable()) if (!imfAvailable())
return; return;
@ -735,7 +735,7 @@ void QQnxInputContext::closeSession()
if (sInputSession) { if (sInputSession) {
p_ictrl_close_session((input_session_t *)sInputSession); p_ictrl_close_session((input_session_t *)sInputSession);
sInputSession = 0; sInputSession = nullptr;
} }
// These are likely already in the right state but this depends on the text control // These are likely already in the right state but this depends on the text control
// having called reset or commit. So, just in case, set them to proper values. // having called reset or commit. So, just in case, set them to proper values.

View File

@ -48,7 +48,7 @@ class QQnxNavigatorEventHandler : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QQnxNavigatorEventHandler(QObject *parent = 0); explicit QQnxNavigatorEventHandler(QObject *parent = nullptr);
bool handleOrientationCheck(int angle); bool handleOrientationCheck(int angle);
void handleOrientationChange(int angle); void handleOrientationChange(int angle);

View File

@ -51,7 +51,7 @@ class QQnxNavigatorEventNotifier : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QQnxNavigatorEventNotifier(QQnxNavigatorEventHandler *eventHandler, QObject *parent = 0); explicit QQnxNavigatorEventNotifier(QQnxNavigatorEventHandler *eventHandler, QObject *parent = nullptr);
~QQnxNavigatorEventNotifier(); ~QQnxNavigatorEventNotifier();
public Q_SLOTS: public Q_SLOTS:

View File

@ -50,7 +50,7 @@ class QQnxNavigatorPps : public QQnxAbstractNavigator
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QQnxNavigatorPps(QObject *parent = 0); explicit QQnxNavigatorPps(QObject *parent = nullptr);
~QQnxNavigatorPps(); ~QQnxNavigatorPps();
protected: protected:

View File

@ -89,7 +89,7 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
if (!m_needsPosting) if (!m_needsPosting)
return; return;
QQnxWindow *targetWindow = 0; QQnxWindow *targetWindow = nullptr;
if (window) if (window)
targetWindow = static_cast<QQnxWindow *>(window->handle()); targetWindow = static_cast<QQnxWindow *>(window->handle());

View File

@ -566,7 +566,7 @@ void QQnxWindow::removeFromParent()
if (Q_UNLIKELY(!m_parentWindow->m_childWindows.removeAll(this))) if (Q_UNLIKELY(!m_parentWindow->m_childWindows.removeAll(this)))
qFatal("QQnxWindow: Window Hierarchy broken; window has parent, but parent hasn't got child."); qFatal("QQnxWindow: Window Hierarchy broken; window has parent, but parent hasn't got child.");
else else
m_parentWindow = 0; m_parentWindow = nullptr;
} else if (m_screen) { } else if (m_screen) {
m_screen->removeWindow(this); m_screen->removeWindow(this);
} }
@ -634,7 +634,7 @@ void QQnxWindow::lower()
void QQnxWindow::requestActivateWindow() void QQnxWindow::requestActivateWindow()
{ {
QQnxWindow *focusWindow = 0; QQnxWindow *focusWindow = nullptr;
if (QGuiApplication::focusWindow()) if (QGuiApplication::focusWindow())
focusWindow = static_cast<QQnxWindow*>(QGuiApplication::focusWindow()->handle()); focusWindow = static_cast<QQnxWindow*>(QGuiApplication::focusWindow()->handle());
@ -664,7 +664,7 @@ void QQnxWindow::requestActivateWindow()
platformScreen->rootWindow()->m_windowGroupName == currentWindow->m_parentGroupName) { platformScreen->rootWindow()->m_windowGroupName == currentWindow->m_parentGroupName) {
currentWindow = platformScreen->rootWindow(); currentWindow = platformScreen->rootWindow();
} else { } else {
currentWindow = 0; currentWindow = nullptr;
} }
} }

View File

@ -454,7 +454,7 @@ void QWasmCompositor::drawFrameWindow(QWasmFrameOptions options, QPainter *paint
const QColor &c2 = options.palette.shadow().color(); const QColor &c2 = options.palette.shadow().color();
const QColor &c3 = options.palette.midlight().color(); const QColor &c3 = options.palette.midlight().color();
const QColor &c4 = options.palette.dark().color(); const QColor &c4 = options.palette.dark().color();
const QBrush *fill = 0; const QBrush *fill = nullptr;
const qreal devicePixelRatio = painter->device()->devicePixelRatio(); const qreal devicePixelRatio = painter->device()->devicePixelRatio();
if (!qFuzzyCompare(devicePixelRatio, qreal(1))) { if (!qFuzzyCompare(devicePixelRatio, qreal(1))) {

View File

@ -320,7 +320,7 @@ static void init_direct(QXcbColormapPrivate *d, bool ownColormap)
XStoreColors(X11->display, d->colormap, colorTable.data(), colorTable.count()); XStoreColors(X11->display, d->colormap, colorTable.data(), colorTable.count());
} }
static QXcbColormap **cmaps = 0; static QXcbColormap **cmaps = nullptr;
void QXcbColormap::initialize() void QXcbColormap::initialize()
{ {
@ -343,7 +343,7 @@ void QXcbColormap::initialize()
d->visual = DefaultVisual(display, i); d->visual = DefaultVisual(display, i);
d->defaultVisual = true; d->defaultVisual = true;
Visual *argbVisual = 0; Visual *argbVisual = nullptr;
if (X11->visual && i == DefaultScreen(display)) { if (X11->visual && i == DefaultScreen(display)) {
// only use the outside colormap on the default screen // only use the outside colormap on the default screen
@ -356,7 +356,7 @@ void QXcbColormap::initialize()
d->visual = find_visual(display, i, X11->visual_class, X11->visual_id, d->visual = find_visual(display, i, X11->visual_class, X11->visual_id,
&d->depth, &d->defaultVisual); &d->depth, &d->defaultVisual);
} else if (!X11->custom_cmap) { } else if (!X11->custom_cmap) {
XStandardColormap *stdcmap = 0; XStandardColormap *stdcmap = nullptr;
int ncmaps = 0; int ncmaps = 0;
#if QT_CONFIG(xrender) #if QT_CONFIG(xrender)

View File

@ -282,9 +282,9 @@ static uint n_bits(uint v)
return i; return i;
} }
static uint *red_scale_table = 0; static uint *red_scale_table = nullptr;
static uint *green_scale_table = 0; static uint *green_scale_table = nullptr;
static uint *blue_scale_table = 0; static uint *blue_scale_table = nullptr;
static void cleanup_scale_tables() static void cleanup_scale_tables()
{ {
@ -546,10 +546,10 @@ void QX11PlatformPixmap::fromImage(const QImage &img, Qt::ImageConversionFlags f
Display *dpy = xinfo.display(); Display *dpy = xinfo.display();
Visual *visual = (Visual *)xinfo.visual(); Visual *visual = (Visual *)xinfo.visual();
XImage *xi = 0; XImage *xi = nullptr;
bool trucol = (visual->c_class >= TrueColor); bool trucol = (visual->c_class >= TrueColor);
size_t nbytes = image.sizeInBytes(); size_t nbytes = image.sizeInBytes();
uchar *newbits= 0; uchar *newbits= nullptr;
#if QT_CONFIG(xrender) #if QT_CONFIG(xrender)
if (alphaCheck.hasXRenderAndAlpha()) { if (alphaCheck.hasXRenderAndAlpha()) {

View File

@ -725,7 +725,7 @@ void QTessellatorPrivate::cancelCoincidingEdges()
{ {
Vertex **vv = vertices.sorted; Vertex **vv = vertices.sorted;
QCoincidingEdge *tl = 0; QCoincidingEdge *tl = nullptr;
int tlSize = 0; int tlSize = 0;
for (int i = 0; i < vertices.nPoints - 1; ++i) { for (int i = 0; i < vertices.nPoints - 1; ++i) {

View File

@ -95,9 +95,9 @@ static xcb_window_t xdndProxy(QXcbConnection *c, xcb_window_t w)
if (reply && reply->type == XCB_ATOM_WINDOW) { if (reply && reply->type == XCB_ATOM_WINDOW) {
xcb_window_t p = *((xcb_window_t *)xcb_get_property_value(reply.get())); xcb_window_t p = *((xcb_window_t *)xcb_get_property_value(reply.get()));
if (proxy != p) if (proxy != p)
proxy = 0; proxy = XCB_NONE;
} else { } else {
proxy = 0; proxy = XCB_NONE;
} }
return proxy; return proxy;
@ -690,7 +690,7 @@ int QXcbDrag::findTransactionByTime(xcb_timestamp_t timestamp)
#if 0 #if 0
// for embedding only // for embedding only
static QWidget* current_embedding_widget = 0; static QWidget* current_embedding_widget = nullptr;
static xcb_client_message_event_t last_enter_event; static xcb_client_message_event_t last_enter_event;

View File

@ -1052,7 +1052,7 @@ QVariant QDB2Result::data(int field)
return *d->valueCache[field]; return *d->valueCache[field];
QVariant* v = 0; QVariant *v = nullptr;
switch (info.metaType().id()) { switch (info.metaType().id()) {
case QVariant::LongLong: case QVariant::LongLong:
v = new QVariant((qint64) qGetBigIntData(d->hStmt, field, isNull)); v = new QVariant((qint64) qGetBigIntData(d->hStmt, field, isNull));

View File

@ -72,8 +72,8 @@ class Q_EXPORT_SQLDRIVER_DB2 QDB2Driver : public QSqlDriver
friend class QDB2ResultPrivate; friend class QDB2ResultPrivate;
public: public:
explicit QDB2Driver(QObject* parent = 0); explicit QDB2Driver(QObject *parent = nullptr);
QDB2Driver(Qt::HANDLE env, Qt::HANDLE con, QObject* parent = 0); QDB2Driver(Qt::HANDLE env, Qt::HANDLE con, QObject *parent = nullptr);
~QDB2Driver(); ~QDB2Driver();
bool hasFeature(DriverFeature) const override; bool hasFeature(DriverFeature) const override;
void close() override; void close() override;

View File

@ -487,7 +487,7 @@ QVariant QIBaseResultPrivate::fetchBlob(ISC_QUAD *bId)
} }
template<typename T> template<typename T>
static QList<QVariant> toList(char** buf, int count, T* = 0) static QList<QVariant> toList(char** buf, int count, T* = nullptr)
{ {
QList<QVariant> res; QList<QVariant> res;
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
@ -624,7 +624,7 @@ QVariant QIBaseResultPrivate::fetchArray(int pos, ISC_QUAD *arr)
} }
template<typename T> template<typename T>
static char* fillList(char *buffer, const QList<QVariant> &list, T* = 0) static char* fillList(char *buffer, const QList<QVariant> &list, T* = nullptr)
{ {
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
T val; T val;

Some files were not shown because too many files have changed in this diff Show More