Replace Q_NULLPTR with nullptr where possible

Remaining uses of Q_NULLPTR are in:
src/corelib/global/qcompilerdetection.h
  (definition and documentation of Q_NULLPTR)
tests/manual/qcursor/qcursorhighdpi/main.cpp
  (a test executable compilable both under Qt4 and Qt5)

Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Kevin Funk 2017-09-18 11:49:52 +02:00
parent 47c92fbb0b
commit 58c14c4a7e
550 changed files with 1565 additions and 1565 deletions

View File

@ -60,7 +60,7 @@ Client::Client(QWidget *parent)
, portLineEdit(new QLineEdit)
, getFortuneButton(new QPushButton(tr("Get Fortune")))
, tcpSocket(new QTcpSocket(this))
, networkSession(Q_NULLPTR)
, networkSession(nullptr)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
//! [0]
@ -127,7 +127,7 @@ Client::Client(QWidget *parent)
this, &Client::displayError);
//! [4]
QGridLayout *mainLayout = Q_NULLPTR;
QGridLayout *mainLayout = nullptr;
if (QGuiApplication::styleHints()->showIsFullScreen() || QGuiApplication::styleHints()->showIsMaximized()) {
QVBoxLayout *outerVerticalLayout = new QVBoxLayout(this);
outerVerticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));

View File

@ -70,7 +70,7 @@ class Client : public QDialog
Q_OBJECT
public:
explicit Client(QWidget *parent = Q_NULLPTR);
explicit Client(QWidget *parent = nullptr);
private slots:
void requestNewFortune();

View File

@ -58,7 +58,7 @@
Server::Server(QWidget *parent)
: QDialog(parent)
, statusLabel(new QLabel)
, tcpServer(Q_NULLPTR)
, tcpServer(nullptr)
, networkSession(0)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
@ -109,7 +109,7 @@ Server::Server(QWidget *parent)
buttonLayout->addWidget(quitButton);
buttonLayout->addStretch(1);
QVBoxLayout *mainLayout = Q_NULLPTR;
QVBoxLayout *mainLayout = nullptr;
if (QGuiApplication::styleHints()->showIsFullScreen() || QGuiApplication::styleHints()->showIsMaximized()) {
QVBoxLayout *outerVerticalLayout = new QVBoxLayout(this);
outerVerticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));

View File

@ -66,7 +66,7 @@ class Server : public QDialog
Q_OBJECT
public:
explicit Server(QWidget *parent = Q_NULLPTR);
explicit Server(QWidget *parent = nullptr);
private slots:
void sessionOpened();

View File

@ -87,8 +87,8 @@ HttpWindow::HttpWindow(QWidget *parent)
, launchCheckBox(new QCheckBox("Launch file"))
, defaultFileLineEdit(new QLineEdit(defaultFileName))
, downloadDirectoryLineEdit(new QLineEdit)
, reply(Q_NULLPTR)
, file(Q_NULLPTR)
, reply(nullptr)
, file(nullptr)
, httpRequestAborted(false)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
@ -204,7 +204,7 @@ QFile *HttpWindow::openFileForWrite(const QString &fileName)
tr("Unable to save the file %1: %2.")
.arg(QDir::toNativeSeparators(fileName),
file->errorString()));
return Q_NULLPTR;
return nullptr;
}
return file.take();
}
@ -224,12 +224,12 @@ void HttpWindow::httpFinished()
fi.setFile(file->fileName());
file->close();
delete file;
file = Q_NULLPTR;
file = nullptr;
}
if (httpRequestAborted) {
reply->deleteLater();
reply = Q_NULLPTR;
reply = nullptr;
return;
}
@ -238,14 +238,14 @@ void HttpWindow::httpFinished()
statusLabel->setText(tr("Download failed:\n%1.").arg(reply->errorString()));
downloadButton->setEnabled(true);
reply->deleteLater();
reply = Q_NULLPTR;
reply = nullptr;
return;
}
const QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
reply->deleteLater();
reply = Q_NULLPTR;
reply = nullptr;
if (!redirectionTarget.isNull()) {
const QUrl redirectedUrl = url.resolved(redirectionTarget.toUrl());

View File

@ -71,7 +71,7 @@ class ProgressDialog : public QProgressDialog {
Q_OBJECT
public:
explicit ProgressDialog(const QUrl &url, QWidget *parent = Q_NULLPTR);
explicit ProgressDialog(const QUrl &url, QWidget *parent = nullptr);
public slots:
void networkReplyProgress(qint64 bytesRead, qint64 totalBytes);
@ -82,7 +82,7 @@ class HttpWindow : public QDialog
Q_OBJECT
public:
explicit HttpWindow(QWidget *parent = Q_NULLPTR);
explicit HttpWindow(QWidget *parent = nullptr);
void startRequest(const QUrl &requestedUrl);

View File

@ -146,7 +146,7 @@ void FragmentToy::draw(const QSize &windowSize)
m_fragment_shader.reset(new QOpenGLShader(QOpenGLShader::Fragment));
if (!m_fragment_shader->compileSourceCode(data)) {
qWarning() << "Failed to compile fragment shader:" << m_fragment_shader->log();
m_fragment_shader.reset(Q_NULLPTR);
m_fragment_shader.reset(nullptr);
}
} else {
qWarning() << "Unknown error, no fragment shader";
@ -198,14 +198,14 @@ void FragmentToy::fileChanged(const QString &path)
m_recompile_shaders = true;
if (m_program) {
m_program->removeShader(m_fragment_shader.data());
m_fragment_shader.reset(Q_NULLPTR);
m_fragment_shader.reset(nullptr);
}
}
} else {
m_recompile_shaders = true;
if (m_program) {
m_program->removeShader(m_fragment_shader.data());
m_fragment_shader.reset(Q_NULLPTR);
m_fragment_shader.reset(nullptr);
}
}
}

View File

@ -468,7 +468,7 @@ static ColorSwatch *findByName(const QMainWindow *mainWindow, const QString &nam
if (name == dock->objectName())
return dock;
}
return Q_NULLPTR;
return nullptr;
}
void ColorSwatch::splitInto(QAction *action)

View File

@ -62,7 +62,7 @@ class ColorSwatch : public QDockWidget
Q_OBJECT
public:
explicit ColorSwatch(const QString &colorName, QMainWindow *parent = Q_NULLPTR, Qt::WindowFlags flags = 0);
explicit ColorSwatch(const QString &colorName, QMainWindow *parent = nullptr, Qt::WindowFlags flags = 0);
void setCustomSizeHint(const QSize &size);
QMenu *colorSwatchMenu() const { return menu; }
@ -128,7 +128,7 @@ class BlueTitleBar : public QWidget
{
Q_OBJECT
public:
explicit BlueTitleBar(QWidget *parent = Q_NULLPTR);
explicit BlueTitleBar(QWidget *parent = nullptr);
QSize sizeHint() const override { return minimumSizeHint(); }
QSize minimumSizeHint() const override;

View File

@ -382,7 +382,7 @@ void MainWindow::switchLayoutDirection()
class CreateDockWidgetDialog : public QDialog
{
public:
explicit CreateDockWidgetDialog(QWidget *parent = Q_NULLPTR);
explicit CreateDockWidgetDialog(QWidget *parent = nullptr);
QString enteredObjectName() const { return m_objectName->text(); }
Qt::DockWidgetArea location() const;

View File

@ -64,7 +64,7 @@ public:
typedef QMap<QString, QSize> CustomSizeHintMap;
explicit MainWindow(const CustomSizeHintMap &customSizeHints,
QWidget *parent = Q_NULLPTR,
QWidget *parent = nullptr,
Qt::WindowFlags flags = 0);
public slots:

View File

@ -81,8 +81,8 @@ static QPixmap genIcon(const QSize &iconSize, int number, const QColor &color)
ToolBar::ToolBar(const QString &title, QWidget *parent)
: QToolBar(parent)
, spinbox(Q_NULLPTR)
, spinboxAction(Q_NULLPTR)
, spinbox(nullptr)
, spinboxAction(nullptr)
{
setWindowTitle(title);
setObjectName(title);

View File

@ -67,7 +67,7 @@ int main(int argc, char *argv[])
parser.addPositionalArgument("file", "The file(s) to open.");
parser.process(app);
MainWindow *mainWin = Q_NULLPTR;
MainWindow *mainWin = nullptr;
foreach (const QString &file, parser.positionalArguments()) {
MainWindow *newWin = new MainWindow(file);
newWin->tile(mainWin);

View File

@ -69,7 +69,7 @@ class PreviewForm : public QDialog
Q_OBJECT
public:
explicit PreviewForm(QWidget *parent = Q_NULLPTR);
explicit PreviewForm(QWidget *parent = nullptr);
void setCodecList(const QList<QTextCodec *> &list);
void setEncodedData(const QByteArray &data);

View File

@ -56,7 +56,7 @@
MainWindow::MainWindow()
: settingsTree(new SettingsTree)
, locationDialog(Q_NULLPTR)
, locationDialog(nullptr)
{
setCentralWidget(settingsTree);

View File

@ -244,7 +244,7 @@ void MainWindow::updateClipboard()
class FontInfoDialog : public QDialog
{
public:
explicit FontInfoDialog(QWidget *parent = Q_NULLPTR);
explicit FontInfoDialog(QWidget *parent = nullptr);
private:
QString text() const;

View File

@ -190,7 +190,7 @@ QLabel *IconPreviewArea::createPixmapLabel()
//! [5]
void IconPreviewArea::updatePixmapLabels()
{
QWindow *window = Q_NULLPTR;
QWindow *window = nullptr;
if (const QWidget *nativeParent = nativeParentWidget())
window = nativeParent->windowHandle();
for (int column = 0; column < NumModes; ++column) {

View File

@ -66,7 +66,7 @@ class IconPreviewArea : public QWidget
Q_OBJECT
public:
explicit IconPreviewArea(QWidget *parent = Q_NULLPTR);
explicit IconPreviewArea(QWidget *parent = nullptr);
void setIcon(const QIcon &icon);
void setSize(const QSize &size);

View File

@ -59,7 +59,7 @@ class IconSizeSpinBox : public QSpinBox
Q_OBJECT
public:
explicit IconSizeSpinBox(QWidget *parent = Q_NULLPTR);
explicit IconSizeSpinBox(QWidget *parent = nullptr);
int valueFromText(const QString &text) const override;
QString textFromValue(int value) const override;

View File

@ -59,7 +59,7 @@ class ImageDelegate : public QItemDelegate
Q_OBJECT
public:
explicit ImageDelegate(QObject *parent = Q_NULLPTR);
explicit ImageDelegate(QObject *parent = nullptr);
//! [0]
//! [1]

View File

@ -55,7 +55,7 @@
//! [0]
MainWindow::MainWindow(TabletCanvas *canvas)
: m_canvas(canvas), m_colorDialog(Q_NULLPTR)
: m_canvas(canvas), m_colorDialog(nullptr)
{
createMenus();
setWindowTitle(tr("Tablet Example"));

View File

@ -55,7 +55,7 @@
//! [0]
TabletCanvas::TabletCanvas()
: QWidget(Q_NULLPTR)
: QWidget(nullptr)
, m_alphaChannelValuator(TangentialPressureValuator)
, m_colorSaturationValuator(NoValuator)
, m_lineWidthValuator(PressureValuator)

View File

@ -159,7 +159,7 @@ public:
inline ResultReporter(ThreadEngine<void> *) { }
inline void reserveSpace(int) { }
inline void reportResults(int) { }
inline void * getPointer() { return Q_NULLPTR; }
inline void * getPointer() { return nullptr; }
};
inline bool selectIteration(std::bidirectional_iterator_tag)

View File

@ -132,7 +132,7 @@ class ThreadEngine : public virtual ThreadEngineBase
public:
typedef T ResultType;
virtual T *result() { return Q_NULLPTR; }
virtual T *result() { return nullptr; }
QFutureInterface<T> *futureInterfaceTyped()
{

View File

@ -82,7 +82,7 @@ public:
DeleteWhenStopped
};
QAbstractAnimation(QObject *parent = Q_NULLPTR);
QAbstractAnimation(QObject *parent = nullptr);
virtual ~QAbstractAnimation();
State state() const;
@ -117,7 +117,7 @@ public Q_SLOTS:
void setCurrentTime(int msecs);
protected:
QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = nullptr);
bool event(QEvent *event) override;
virtual void updateCurrentTime(int currentTime) = 0;
@ -136,7 +136,7 @@ class Q_CORE_EXPORT QAnimationDriver : public QObject
Q_DECLARE_PRIVATE(QAnimationDriver)
public:
QAnimationDriver(QObject *parent = Q_NULLPTR);
QAnimationDriver(QObject *parent = nullptr);
~QAnimationDriver();
virtual void advance();
@ -162,7 +162,7 @@ protected:
virtual void start();
virtual void stop();
QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = Q_NULLPTR);
QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = nullptr);
private:
friend class QUnifiedTimer;

View File

@ -53,7 +53,7 @@ class Q_CORE_EXPORT QAnimationGroup : public QAbstractAnimation
Q_OBJECT
public:
QAnimationGroup(QObject *parent = Q_NULLPTR);
QAnimationGroup(QObject *parent = nullptr);
~QAnimationGroup();
QAbstractAnimation *animationAt(int index) const;

View File

@ -53,7 +53,7 @@ class Q_CORE_EXPORT QParallelAnimationGroup : public QAnimationGroup
Q_OBJECT
public:
QParallelAnimationGroup(QObject *parent = Q_NULLPTR);
QParallelAnimationGroup(QObject *parent = nullptr);
~QParallelAnimationGroup();
int duration() const override;

View File

@ -54,8 +54,8 @@ class Q_CORE_EXPORT QPauseAnimation : public QAbstractAnimation
Q_OBJECT
Q_PROPERTY(int duration READ duration WRITE setDuration)
public:
QPauseAnimation(QObject *parent = Q_NULLPTR);
QPauseAnimation(int msecs, QObject *parent = Q_NULLPTR);
QPauseAnimation(QObject *parent = nullptr);
QPauseAnimation(int msecs, QObject *parent = nullptr);
~QPauseAnimation();
int duration() const override;

View File

@ -55,8 +55,8 @@ class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
Q_PROPERTY(QObject* targetObject READ targetObject WRITE setTargetObject)
public:
QPropertyAnimation(QObject *parent = Q_NULLPTR);
QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = Q_NULLPTR);
QPropertyAnimation(QObject *parent = nullptr);
QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = nullptr);
~QPropertyAnimation();
QObject *targetObject() const;

View File

@ -56,7 +56,7 @@ class Q_CORE_EXPORT QSequentialAnimationGroup : public QAnimationGroup
Q_PROPERTY(QAbstractAnimation* currentAnimation READ currentAnimation NOTIFY currentAnimationChanged)
public:
QSequentialAnimationGroup(QObject *parent = Q_NULLPTR);
QSequentialAnimationGroup(QObject *parent = nullptr);
~QSequentialAnimationGroup();
QPauseAnimation *addPause(int msecs);

View File

@ -65,7 +65,7 @@ public:
typedef QPair<qreal, QVariant> KeyValue;
typedef QVector<KeyValue> KeyValues;
QVariantAnimation(QObject *parent = Q_NULLPTR);
QVariantAnimation(QObject *parent = nullptr);
~QVariantAnimation();
QVariant startValue() const;
@ -94,7 +94,7 @@ Q_SIGNALS:
void valueChanged(const QVariant &value);
protected:
QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = nullptr);
bool event(QEvent *event) override;
void updateCurrentTime(int) override;

View File

@ -276,7 +276,7 @@ template <typename X> struct QAtomicOps
static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; }
template <typename T>
static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed, std::memory_order_relaxed);
if (currentValue)
@ -285,7 +285,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire, std::memory_order_acquire);
if (currentValue)
@ -294,7 +294,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release, std::memory_order_relaxed);
if (currentValue)
@ -303,7 +303,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel, std::memory_order_acquire);
if (currentValue)

View File

@ -100,7 +100,7 @@ public:
struct Q_CORE_EXPORT ConverterState {
ConverterState(ConversionFlags f = DefaultConversion)
: flags(f), remainingChars(0), invalidChars(0), d(Q_NULLPTR) { state_data[0] = state_data[1] = state_data[2] = 0; }
: flags(f), remainingChars(0), invalidChars(0), d(nullptr) { state_data[0] = state_data[1] = state_data[2] = 0; }
~ConverterState();
ConversionFlags flags;
int remainingChars;
@ -111,9 +111,9 @@ public:
Q_DISABLE_COPY(ConverterState)
};
QString toUnicode(const char *in, int length, ConverterState *state = Q_NULLPTR) const
QString toUnicode(const char *in, int length, ConverterState *state = nullptr) const
{ return convertToUnicode(in, length, state); }
QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = Q_NULLPTR) const
QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = nullptr) const
{ return convertFromUnicode(in, length, state); }
QTextDecoder* makeDecoder(ConversionFlags flags = DefaultConversion) const;

View File

@ -118,7 +118,7 @@ public:
Q_DECL_CONSTEXPR inline QFlags &operator=(const QFlags &other);
#endif
Q_DECL_CONSTEXPR inline QFlags(Enum f) Q_DECL_NOTHROW : i(Int(f)) {}
Q_DECL_CONSTEXPR inline QFlags(Zero = Q_NULLPTR) Q_DECL_NOTHROW : i(0) {}
Q_DECL_CONSTEXPR inline QFlags(Zero = nullptr) Q_DECL_NOTHROW : i(0) {}
Q_DECL_CONSTEXPR inline QFlags(QFlag f) Q_DECL_NOTHROW : i(f) {}
#ifdef Q_COMPILER_INITIALIZER_LISTS

View File

@ -1138,7 +1138,7 @@ Q_CORE_EXPORT bool qunsetenv(const char *varName);
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT;
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT;
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=Q_NULLPTR) Q_DECL_NOEXCEPT;
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) Q_DECL_NOEXCEPT;
inline int qIntCast(double f) { return int(f); }
inline int qIntCast(float f) { return int(f); }

View File

@ -64,7 +64,7 @@ class QMessageLogContext
Q_DISABLE_COPY(QMessageLogContext)
public:
Q_DECL_CONSTEXPR QMessageLogContext()
: version(2), line(0), file(Q_NULLPTR), function(Q_NULLPTR), category(Q_NULLPTR) {}
: version(2), line(0), file(nullptr), function(nullptr), category(nullptr) {}
Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName)
: version(2), line(lineNumber), file(fileName), function(functionName), category(categoryName) {}
@ -150,9 +150,9 @@ private:
#define QT_MESSAGELOG_LINE __LINE__
#define QT_MESSAGELOG_FUNC Q_FUNC_INFO
#else
#define QT_MESSAGELOG_FILE Q_NULLPTR
#define QT_MESSAGELOG_FILE nullptr
#define QT_MESSAGELOG_LINE 0
#define QT_MESSAGELOG_FUNC Q_NULLPTR
#define QT_MESSAGELOG_FUNC nullptr
#endif
#define qDebug QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).debug

View File

@ -57,8 +57,8 @@ class Q_CORE_EXPORT QBuffer : public QIODevice
public:
#ifndef QT_NO_QOBJECT
explicit QBuffer(QObject *parent = Q_NULLPTR);
QBuffer(QByteArray *buf, QObject *parent = Q_NULLPTR);
explicit QBuffer(QObject *parent = nullptr);
QBuffer(QByteArray *buf, QObject *parent = nullptr);
#else
QBuffer();
explicit QBuffer(QByteArray *buf);

View File

@ -142,7 +142,7 @@ protected:
#ifdef QT_NO_QOBJECT
QFile(QFilePrivate &dd);
#else
QFile(QFilePrivate &dd, QObject *parent = Q_NULLPTR);
QFile(QFilePrivate &dd, QObject *parent = nullptr);
#endif
private:

View File

@ -136,7 +136,7 @@ protected:
QFileDevice(QFileDevicePrivate &dd);
#else
explicit QFileDevice(QObject *parent);
QFileDevice(QFileDevicePrivate &dd, QObject *parent = Q_NULLPTR);
QFileDevice(QFileDevicePrivate &dd, QObject *parent = nullptr);
#endif
qint64 readData(char *data, qint64 maxlen) override;

View File

@ -50,7 +50,7 @@ class Q_CORE_EXPORT QFileSelector : public QObject
{
Q_OBJECT
public:
explicit QFileSelector(QObject *parent = Q_NULLPTR);
explicit QFileSelector(QObject *parent = nullptr);
~QFileSelector();
QString select(const QString &filePath) const;

View File

@ -55,8 +55,8 @@ class Q_CORE_EXPORT QFileSystemWatcher : public QObject
Q_DECLARE_PRIVATE(QFileSystemWatcher)
public:
QFileSystemWatcher(QObject *parent = Q_NULLPTR);
QFileSystemWatcher(const QStringList &paths, QObject *parent = Q_NULLPTR);
QFileSystemWatcher(QObject *parent = nullptr);
QFileSystemWatcher(const QStringList &paths, QObject *parent = nullptr);
~QFileSystemWatcher();
bool addPath(const QString &file);

View File

@ -336,7 +336,7 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
QMutexLocker locker(&lock);
bool wasRunning = stream != Q_NULLPTR;
bool wasRunning = stream != nullptr;
bool needsRestart = false;
WatchingState oldState = watchingState;

View File

@ -161,7 +161,7 @@ protected:
#ifdef QT_NO_QOBJECT
QIODevice(QIODevicePrivate &dd);
#else
QIODevice(QIODevicePrivate &dd, QObject *parent = Q_NULLPTR);
QIODevice(QIODevicePrivate &dd, QObject *parent = nullptr);
#endif
virtual qint64 readData(char *data, qint64 maxlen) = 0;
virtual qint64 readLineData(char *data, qint64 maxlen);

View File

@ -88,14 +88,14 @@ public:
class QRingBufferRef {
QRingBuffer *m_buf;
inline QRingBufferRef() : m_buf(Q_NULLPTR) { }
inline QRingBufferRef() : m_buf(nullptr) { }
friend class QIODevicePrivate;
public:
// wrap functions from QRingBuffer
inline void setChunkSize(int size) { Q_ASSERT(m_buf); m_buf->setChunkSize(size); }
inline int chunkSize() const { Q_ASSERT(m_buf); return m_buf->chunkSize(); }
inline qint64 nextDataBlockSize() const { return (m_buf ? m_buf->nextDataBlockSize() : Q_INT64_C(0)); }
inline const char *readPointer() const { return (m_buf ? m_buf->readPointer() : Q_NULLPTR); }
inline const char *readPointer() const { return (m_buf ? m_buf->readPointer() : nullptr); }
inline const char *readPointerAtPosition(qint64 pos, qint64 &length) const { Q_ASSERT(m_buf); return m_buf->readPointerAtPosition(pos, length); }
inline void free(qint64 bytes) { Q_ASSERT(m_buf); m_buf->free(bytes); }
inline char *reserve(qint64 bytes) { Q_ASSERT(m_buf); return m_buf->reserve(bytes); }

View File

@ -155,7 +155,7 @@ public:
};
Q_ENUM(ExitStatus)
explicit QProcess(QObject *parent = Q_NULLPTR);
explicit QProcess(QObject *parent = nullptr);
virtual ~QProcess();
void start(const QString &program, const QStringList &arguments, OpenMode mode = ReadWrite);
@ -253,7 +253,7 @@ public:
#if defined(Q_QDOC)
= QString()
#endif
, qint64 *pid = Q_NULLPTR);
, qint64 *pid = nullptr);
#if !defined(Q_QDOC)
static bool startDetached(const QString &program, const QStringList &arguments); // ### Qt6: merge overloads
#endif

View File

@ -352,7 +352,7 @@ public:
#if defined(Q_OS_UNIX)
void execChild(const char *workingDirectory, char **argv, char **envp);
#endif
bool processStarted(QString *errorMessage = Q_NULLPTR);
bool processStarted(QString *errorMessage = nullptr);
void terminateProcess();
void killProcess();
void findExitCode();

View File

@ -885,7 +885,7 @@ bool QProcessPrivate::waitForDeadChild()
// read the process information from our fd
forkfd_info info;
int ret;
EINTR_LOOP(ret, forkfd_wait(forkfd, &info, Q_NULLPTR));
EINTR_LOOP(ret, forkfd_wait(forkfd, &info, nullptr));
exitCode = info.status;
crashed = info.code != CLD_EXITED;

View File

@ -67,7 +67,7 @@ public:
explicit QSaveFile(const QString &name);
#ifndef QT_NO_QOBJECT
explicit QSaveFile(QObject *parent = Q_NULLPTR);
explicit QSaveFile(QObject *parent = nullptr);
explicit QSaveFile(const QString &name, QObject *parent);
#endif
~QSaveFile();

View File

@ -125,13 +125,13 @@ public:
#ifndef QT_NO_QOBJECT
explicit QSettings(const QString &organization,
const QString &application = QString(), QObject *parent = Q_NULLPTR);
const QString &application = QString(), QObject *parent = nullptr);
QSettings(Scope scope, const QString &organization,
const QString &application = QString(), QObject *parent = Q_NULLPTR);
const QString &application = QString(), QObject *parent = nullptr);
QSettings(Format format, Scope scope, const QString &organization,
const QString &application = QString(), QObject *parent = Q_NULLPTR);
QSettings(const QString &fileName, Format format, QObject *parent = Q_NULLPTR);
explicit QSettings(QObject *parent = Q_NULLPTR);
const QString &application = QString(), QObject *parent = nullptr);
QSettings(const QString &fileName, Format format, QObject *parent = nullptr);
explicit QSettings(QObject *parent = nullptr);
#else
explicit QSettings(const QString &organization,
const QString &application = QString());

View File

@ -616,7 +616,7 @@ bool QConfFileSettingsPrivate::readPlistFile(const QByteArray &data, ParsedSetti
{
QCFType<CFDataRef> cfData = data.toRawCFData();
QCFType<CFPropertyListRef> propertyList =
CFPropertyListCreateWithData(kCFAllocatorDefault, cfData, kCFPropertyListImmutable, Q_NULLPTR, Q_NULLPTR);
CFPropertyListCreateWithData(kCFAllocatorDefault, cfData, kCFPropertyListImmutable, nullptr, nullptr);
if (!propertyList)
return true;

View File

@ -112,7 +112,7 @@ void QStorageInfoPrivate::retrieveUrlProperties(bool initRootPath)
QCFType<CFArrayRef> keys = CFArrayCreate(kCFAllocatorDefault,
initRootPath ? rootPathKeys : propertyKeys,
size,
Q_NULLPTR);
nullptr);
if (!keys)
return;
@ -178,9 +178,9 @@ QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes()
QList<QStorageInfo> volumes;
QCFType<CFURLEnumeratorRef> enumerator;
enumerator = CFURLEnumeratorCreateForMountedVolumes(Q_NULLPTR,
enumerator = CFURLEnumeratorCreateForMountedVolumes(nullptr,
kCFURLEnumeratorSkipInvisibles,
Q_NULLPTR);
nullptr);
CFURLEnumeratorResult result = kCFURLEnumeratorSuccess;
do {

View File

@ -257,7 +257,7 @@ inline QStorageIterator::~QStorageIterator()
inline bool QStorageIterator::isValid() const
{
return fp != Q_NULLPTR;
return fp != nullptr;
}
inline bool QStorageIterator::next()
@ -357,12 +357,12 @@ inline QStorageIterator::~QStorageIterator()
inline bool QStorageIterator::isValid() const
{
return fp != Q_NULLPTR;
return fp != nullptr;
}
inline bool QStorageIterator::next()
{
return ::getmntent_r(fp, &mnt, buffer.data(), buffer.size()) != Q_NULLPTR;
return ::getmntent_r(fp, &mnt, buffer.data(), buffer.size()) != nullptr;
}
inline QString QStorageIterator::rootPath() const

View File

@ -147,8 +147,8 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
const bool result = ::GetVolumeInformation(reinterpret_cast<const wchar_t *>(path.utf16()),
nameBuffer,
defaultBufferSize,
Q_NULLPTR,
Q_NULLPTR,
nullptr,
nullptr,
&fileSystemFlags,
fileSystemTypeBuffer,
defaultBufferSize);

View File

@ -212,8 +212,8 @@ typedef void (QTextStream::*QTSMFC)(QChar); // manipulator w/QChar argument
class Q_CORE_EXPORT QTextStreamManipulator
{
public:
Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFI m, int a) Q_DECL_NOTHROW : mf(m), mc(Q_NULLPTR), arg(a), ch() {}
Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) Q_DECL_NOTHROW : mf(Q_NULLPTR), mc(m), arg(-1), ch(c) {}
Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFI m, int a) Q_DECL_NOTHROW : mf(m), mc(nullptr), arg(a), ch() {}
Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) Q_DECL_NOTHROW : mf(nullptr), mc(m), arg(-1), ch(c) {}
void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
private:

View File

@ -184,7 +184,7 @@ public:
#endif
#ifdef Q_COMPILER_RVALUE_REFS
QUrl(QUrl &&other) Q_DECL_NOTHROW : d(other.d)
{ other.d = Q_NULLPTR; }
{ other.d = nullptr; }
inline QUrl &operator=(QUrl &&other) Q_DECL_NOTHROW
{ qSwap(d, other.d); return *this; }
#endif

View File

@ -55,7 +55,7 @@ class Q_CORE_EXPORT QModelIndex
{
friend class QAbstractItemModel;
public:
Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(Q_NULLPTR) {}
Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(nullptr) {}
// compiler-generated copy/move ctors/assignment operators are fine!
Q_DECL_CONSTEXPR inline int row() const Q_DECL_NOTHROW { return r; }
Q_DECL_CONSTEXPR inline int column() const Q_DECL_NOTHROW { return c; }
@ -69,7 +69,7 @@ public:
inline QVariant data(int role = Qt::DisplayRole) const;
inline Qt::ItemFlags flags() const;
Q_DECL_CONSTEXPR inline const QAbstractItemModel *model() const Q_DECL_NOTHROW { return m; }
Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW { return (r >= 0) && (c >= 0) && (m != Q_NULLPTR); }
Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW { return (r >= 0) && (c >= 0) && (m != nullptr); }
Q_DECL_CONSTEXPR inline bool operator==(const QModelIndex &other) const Q_DECL_NOTHROW
{ return (other.r == r) && (other.i == i) && (other.c == c) && (other.m == m); }
Q_DECL_CONSTEXPR inline bool operator!=(const QModelIndex &other) const Q_DECL_NOTHROW
@ -115,7 +115,7 @@ public:
QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline QPersistentModelIndex(QPersistentModelIndex &&other) Q_DECL_NOTHROW
: d(other.d) { other.d = Q_NULLPTR; }
: d(other.d) { other.d = nullptr; }
inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) Q_DECL_NOTHROW
{ qSwap(d, other.d); return *this; }
#endif
@ -171,7 +171,7 @@ class Q_CORE_EXPORT QAbstractItemModel : public QObject
friend class QIdentityProxyModel;
public:
explicit QAbstractItemModel(QObject *parent = Q_NULLPTR);
explicit QAbstractItemModel(QObject *parent = nullptr);
virtual ~QAbstractItemModel();
Q_INVOKABLE bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const;
@ -286,9 +286,9 @@ protected Q_SLOTS:
void resetInternalData();
protected:
QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = Q_NULLPTR);
QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = nullptr);
inline QModelIndex createIndex(int row, int column, void *data = Q_NULLPTR) const;
inline QModelIndex createIndex(int row, int column, void *data = nullptr) const;
inline QModelIndex createIndex(int row, int column, quintptr id) const;
void encodeData(const QModelIndexList &indexes, QDataStream &stream) const;
@ -367,7 +367,7 @@ class Q_CORE_EXPORT QAbstractTableModel : public QAbstractItemModel
Q_OBJECT
public:
explicit QAbstractTableModel(QObject *parent = Q_NULLPTR);
explicit QAbstractTableModel(QObject *parent = nullptr);
~QAbstractTableModel();
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
@ -393,7 +393,7 @@ class Q_CORE_EXPORT QAbstractListModel : public QAbstractItemModel
Q_OBJECT
public:
explicit QAbstractListModel(QObject *parent = Q_NULLPTR);
explicit QAbstractListModel(QObject *parent = nullptr);
~QAbstractListModel();
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;

View File

@ -56,7 +56,7 @@ class Q_CORE_EXPORT QAbstractProxyModel : public QAbstractItemModel
Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
public:
explicit QAbstractProxyModel(QObject *parent = Q_NULLPTR);
explicit QAbstractProxyModel(QObject *parent = nullptr);
~QAbstractProxyModel();
virtual void setSourceModel(QAbstractItemModel *sourceModel);

View File

@ -54,7 +54,7 @@ class Q_CORE_EXPORT QIdentityProxyModel : public QAbstractProxyModel
{
Q_OBJECT
public:
explicit QIdentityProxyModel(QObject* parent = Q_NULLPTR);
explicit QIdentityProxyModel(QObject* parent = nullptr);
~QIdentityProxyModel();
int columnCount(const QModelIndex& parent = QModelIndex()) const override;

View File

@ -164,7 +164,7 @@ public:
Q_DECLARE_FLAGS(SelectionFlags, SelectionFlag)
Q_FLAG(SelectionFlags)
explicit QItemSelectionModel(QAbstractItemModel *model = Q_NULLPTR);
explicit QItemSelectionModel(QAbstractItemModel *model = nullptr);
explicit QItemSelectionModel(QAbstractItemModel *model, QObject *parent);
virtual ~QItemSelectionModel();

View File

@ -70,7 +70,7 @@ class Q_CORE_EXPORT QSortFilterProxyModel : public QAbstractProxyModel
Q_PROPERTY(bool recursiveFiltering READ recursiveFiltering WRITE setRecursiveFiltering)
public:
explicit QSortFilterProxyModel(QObject *parent = Q_NULLPTR);
explicit QSortFilterProxyModel(QObject *parent = nullptr);
~QSortFilterProxyModel();
void setSourceModel(QAbstractItemModel *sourceModel) override;

View File

@ -52,8 +52,8 @@ class Q_CORE_EXPORT QStringListModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit QStringListModel(QObject *parent = Q_NULLPTR);
explicit QStringListModel(const QStringList &strings, QObject *parent = Q_NULLPTR);
explicit QStringListModel(QObject *parent = nullptr);
explicit QStringListModel(const QStringList &strings, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;

View File

@ -133,7 +133,7 @@ public:
typedef QJsonValueRef reference;
typedef QJsonValueRefPtr pointer;
inline iterator() : a(Q_NULLPTR), i(0) { }
inline iterator() : a(nullptr), i(0) { }
explicit inline iterator(QJsonArray *array, int index) : a(array), i(index) { }
inline QJsonValueRef operator*() const { return QJsonValueRef(a, i); }
@ -178,7 +178,7 @@ public:
typedef QJsonValue reference;
typedef QJsonValuePtr pointer;
inline const_iterator() : a(Q_NULLPTR), i(0) { }
inline const_iterator() : a(nullptr), i(0) { }
explicit inline const_iterator(const QJsonArray *array, int index) : a(array), i(index) { }
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
inline const_iterator(const const_iterator &o) : a(o.a), i(o.i) {} // ### Qt 6: Removed so class can be trivially-copyable

View File

@ -129,7 +129,7 @@ public:
Compact
};
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = Q_NULLPTR);
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = nullptr);
#ifdef Q_QDOC
QByteArray toJson(JsonFormat format = Indented) const;

View File

@ -135,7 +135,7 @@ public:
typedef QJsonValueRef reference;
typedef QJsonValuePtr pointer;
Q_DECL_CONSTEXPR inline iterator() : o(Q_NULLPTR), i(0) {}
Q_DECL_CONSTEXPR inline iterator() : o(nullptr), i(0) {}
Q_DECL_CONSTEXPR inline iterator(QJsonObject *obj, int index) : o(obj), i(index) {}
inline QString key() const { return o->keyAt(i); }
@ -178,7 +178,7 @@ public:
typedef QJsonValue reference;
typedef QJsonValuePtr pointer;
Q_DECL_CONSTEXPR inline const_iterator() : o(Q_NULLPTR), i(0) {}
Q_DECL_CONSTEXPR inline const_iterator() : o(nullptr), i(0) {}
Q_DECL_CONSTEXPR inline const_iterator(const QJsonObject *obj, int index)
: o(obj), i(index) {}
inline const_iterator(const iterator &other)

View File

@ -82,7 +82,7 @@ public:
QJsonValue(QLatin1String s);
#ifndef QT_NO_CAST_FROM_ASCII
inline QT_ASCII_CAST_WARN QJsonValue(const char *s)
: d(Q_NULLPTR), t(String) { stringDataFromQStringHelper(QString::fromUtf8(s)); }
: d(nullptr), t(String) { stringDataFromQStringHelper(QString::fromUtf8(s)); }
#endif
QJsonValue(const QJsonArray &a);
QJsonValue(const QJsonObject &o);

View File

@ -70,10 +70,10 @@ public:
{ }
};
explicit QAbstractEventDispatcher(QObject *parent = Q_NULLPTR);
explicit QAbstractEventDispatcher(QObject *parent = nullptr);
~QAbstractEventDispatcher();
static QAbstractEventDispatcher *instance(QThread *thread = Q_NULLPTR);
static QAbstractEventDispatcher *instance(QThread *thread = nullptr);
virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0;
virtual bool hasPendingEvents() = 0; // ### Qt6: remove, mark final or make protected
@ -112,7 +112,7 @@ public:
bool filterNativeEvent(const QByteArray &eventType, void *message, long *result);
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED bool filterEvent(void *message)
{ return filterNativeEvent("", message, Q_NULLPTR); }
{ return filterNativeEvent("", message, nullptr); }
#endif
Q_SIGNALS:

View File

@ -130,7 +130,7 @@ int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout
if (!timeout_ts) {
// no timeout -> block forever
int ret;
EINTR_LOOP(ret, qt_ppoll(fds, nfds, Q_NULLPTR));
EINTR_LOOP(ret, qt_ppoll(fds, nfds, nullptr));
return ret;
}

View File

@ -362,7 +362,7 @@ Q_CORE_EXPORT int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct tim
static inline int qt_poll_msecs(struct pollfd *fds, nfds_t nfds, int timeout)
{
timespec ts, *pts = Q_NULLPTR;
timespec ts, *pts = nullptr;
if (timeout >= 0) {
ts.tv_sec = timeout / 1000;

View File

@ -426,7 +426,7 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
, argv(aargv)
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
, origArgc(0)
, origArgv(Q_NULLPTR)
, origArgv(nullptr)
#endif
, application_type(QCoreApplicationPrivate::Tty)
#ifndef QT_NO_QOBJECT

View File

@ -123,7 +123,7 @@ public:
static bool sendEvent(QObject *receiver, QEvent *event);
static void postEvent(QObject *receiver, QEvent *event, int priority = Qt::NormalEventPriority);
static void sendPostedEvents(QObject *receiver = Q_NULLPTR, int event_type = 0);
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();
@ -155,7 +155,7 @@ public:
static QString translate(const char * context,
const char * key,
const char * disambiguation = Q_NULLPTR,
const char * disambiguation = nullptr,
int n = -1);
#if QT_DEPRECATED_SINCE(5, 0)
enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = UnicodeUTF8, CodecForTr = UnicodeUTF8 };
@ -241,13 +241,13 @@ inline bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *ev
# 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 = Q_NULLPTR, int n = -1) \
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 = Q_NULLPTR, int n = -1) \
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:

View File

@ -53,7 +53,7 @@ class Q_CORE_EXPORT QEventLoop : public QObject
Q_DECLARE_PRIVATE(QEventLoop)
public:
explicit QEventLoop(QObject *parent = Q_NULLPTR);
explicit QEventLoop(QObject *parent = nullptr);
~QEventLoop();
enum ProcessEventsFlag {

View File

@ -260,7 +260,7 @@ QJNIEnvironmentPrivate::QJNIEnvironmentPrivate()
return;
if (ret == JNI_EDETACHED) { // We need to (re-)attach
JavaVMAttachArgs args = { JNI_VERSION_1_6, qJniThreadName, Q_NULLPTR };
JavaVMAttachArgs args = { JNI_VERSION_1_6, qJniThreadName, nullptr };
if (vm->AttachCurrentThread(&jniEnv, &args) != JNI_OK)
return;

View File

@ -64,14 +64,14 @@ namespace QtAndroidPrivate {
KeyEventListener::~KeyEventListener() {}
}
static JavaVM *g_javaVM = Q_NULLPTR;
static jobject g_jActivity = Q_NULLPTR;
static jobject g_jService = Q_NULLPTR;
static jobject g_jClassLoader = Q_NULLPTR;
static JavaVM *g_javaVM = nullptr;
static jobject g_jActivity = nullptr;
static jobject g_jService = nullptr;
static jobject g_jClassLoader = nullptr;
static jint g_androidSdkVersion = 0;
static jclass g_jNativeClass = Q_NULLPTR;
static jmethodID g_runPendingCppRunnablesMethodID = Q_NULLPTR;
static jmethodID g_hideSplashScreenMethodID = Q_NULLPTR;
static jclass g_jNativeClass = nullptr;
static jmethodID g_runPendingCppRunnablesMethodID = nullptr;
static jmethodID g_hideSplashScreenMethodID = nullptr;
Q_GLOBAL_STATIC(std::deque<QtAndroidPrivate::Runnable>, g_pendingRunnables);
static QBasicMutex g_pendingRunnablesMutex;

View File

@ -61,7 +61,7 @@ Q_CORE_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
__android_log_print(ANDROID_LOG_INFO, logTag, "Start");
_JNIEnv uenv;
uenv.venv = Q_NULLPTR;
uenv.venv = nullptr;
if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_6) != JNI_OK)
{

View File

@ -1589,7 +1589,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
*/
/*!
\fn bool QMetaObject::invokeMethod(QObject *receiver, PointerToMemberFunction function, Qt::ConnectionType type = Qt::AutoConnection, MemberFunctionReturnType *ret = Q_NULLPTR)
\fn bool QMetaObject::invokeMethod(QObject *receiver, PointerToMemberFunction function, Qt::ConnectionType type = Qt::AutoConnection, MemberFunctionReturnType *ret = nullptr)
\since 5.10
@ -1607,7 +1607,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
*/
/*!
\fn bool QMetaObject::invokeMethod(QObject *context, Functor function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = Q_NULLPTR)
\fn bool QMetaObject::invokeMethod(QObject *context, Functor function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = nullptr)
\since 5.10
@ -1617,7 +1617,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
*/
/*!
\fn bool QMetaObject::invokeMethod(QObject *context, Functor function, FunctorReturnType *ret = Q_NULLPTR)
\fn bool QMetaObject::invokeMethod(QObject *context, Functor function, FunctorReturnType *ret = nullptr)
\since 5.10

View File

@ -54,7 +54,7 @@ template <typename T> class QList;
class Q_CORE_EXPORT QMetaMethod
{
public:
Q_DECL_CONSTEXPR inline QMetaMethod() : mobj(Q_NULLPTR), handle(0) {}
Q_DECL_CONSTEXPR inline QMetaMethod() : mobj(nullptr), handle(0) {}
QByteArray methodSignature() const;
QByteArray name() const;
@ -80,7 +80,7 @@ public:
bool invoke(QObject *object,
Qt::ConnectionType connectionType,
QGenericReturnArgument returnValue,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -92,7 +92,7 @@ public:
QGenericArgument val9 = QGenericArgument()) const;
inline bool invoke(QObject *object,
QGenericReturnArgument returnValue,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -108,7 +108,7 @@ public:
}
inline bool invoke(QObject *object,
Qt::ConnectionType connectionType,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -123,7 +123,7 @@ public:
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
inline bool invoke(QObject *object,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -140,7 +140,7 @@ public:
bool invokeOnGadget(void *gadget,
QGenericReturnArgument returnValue,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -151,7 +151,7 @@ public:
QGenericArgument val8 = QGenericArgument(),
QGenericArgument val9 = QGenericArgument()) const;
inline bool invokeOnGadget(void *gadget,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -166,7 +166,7 @@ public:
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
inline bool isValid() const { return mobj != Q_NULLPTR; }
inline bool isValid() const { return mobj != nullptr; }
template <typename PointerToMemberFunction>
static inline QMetaMethod fromSignal(PointerToMemberFunction signal)
@ -183,7 +183,7 @@ private:
// signature() has been renamed to methodSignature() in Qt 5.
// Warning, that function returns a QByteArray; check the life time if
// you convert to char*.
char *signature(struct renamedInQt5_warning_checkTheLifeTime * = Q_NULLPTR) Q_DECL_EQ_DELETE;
char *signature(struct renamedInQt5_warning_checkTheLifeTime * = nullptr) Q_DECL_EQ_DELETE;
#endif
static QMetaMethod fromSignalImpl(const QMetaObject *, void **);
@ -206,7 +206,7 @@ inline bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2)
class Q_CORE_EXPORT QMetaEnum
{
public:
Q_DECL_CONSTEXPR inline QMetaEnum() : mobj(Q_NULLPTR), handle(0) {}
Q_DECL_CONSTEXPR inline QMetaEnum() : mobj(nullptr), handle(0) {}
const char *name() const;
bool isFlag() const;
@ -218,14 +218,14 @@ public:
const char *scope() const;
int keyToValue(const char *key, bool *ok = Q_NULLPTR) const;
int keyToValue(const char *key, bool *ok = nullptr) const;
const char* valueToKey(int value) const;
int keysToValue(const char * keys, bool *ok = Q_NULLPTR) const;
int keysToValue(const char * keys, bool *ok = nullptr) const;
QByteArray valueToKeys(int value) const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
inline bool isValid() const { return name() != Q_NULLPTR; }
inline bool isValid() const { return name() != nullptr; }
template<typename T> static QMetaEnum fromType() {
Q_STATIC_ASSERT_X(QtPrivate::IsQEnumHelper<T>::Value,
@ -256,11 +256,11 @@ public:
bool isReadable() const;
bool isWritable() const;
bool isResettable() const;
bool isDesignable(const QObject *obj = Q_NULLPTR) const;
bool isScriptable(const QObject *obj = Q_NULLPTR) const;
bool isStored(const QObject *obj = Q_NULLPTR) const;
bool isEditable(const QObject *obj = Q_NULLPTR) const;
bool isUser(const QObject *obj = Q_NULLPTR) const;
bool isDesignable(const QObject *obj = nullptr) const;
bool isScriptable(const QObject *obj = nullptr) const;
bool isStored(const QObject *obj = nullptr) const;
bool isEditable(const QObject *obj = nullptr) const;
bool isUser(const QObject *obj = nullptr) const;
bool isConstant() const;
bool isFinal() const;
@ -300,7 +300,7 @@ private:
class Q_CORE_EXPORT QMetaClassInfo
{
public:
Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(Q_NULLPTR), handle(0) {}
Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(nullptr), handle(0) {}
const char *name() const;
const char *value() const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }

View File

@ -234,7 +234,7 @@ struct AbstractDebugStreamFunction
{
typedef void (*Stream)(const AbstractDebugStreamFunction *, QDebug&, const void *);
typedef void (*Destroy)(AbstractDebugStreamFunction *);
explicit AbstractDebugStreamFunction(Stream s = Q_NULLPTR, Destroy d = Q_NULLPTR)
explicit AbstractDebugStreamFunction(Stream s = nullptr, Destroy d = nullptr)
: stream(s), destroy(d) {}
Q_DISABLE_COPY(AbstractDebugStreamFunction)
Stream stream;
@ -264,7 +264,7 @@ struct AbstractComparatorFunction
typedef bool (*LessThan)(const AbstractComparatorFunction *, const void *, const void *);
typedef bool (*Equals)(const AbstractComparatorFunction *, const void *, const void *);
typedef void (*Destroy)(AbstractComparatorFunction *);
explicit AbstractComparatorFunction(LessThan lt = Q_NULLPTR, Equals e = Q_NULLPTR, Destroy d = Q_NULLPTR)
explicit AbstractComparatorFunction(LessThan lt = nullptr, Equals e = nullptr, Destroy d = nullptr)
: lessThan(lt), equals(e), destroy(d) {}
Q_DISABLE_COPY(AbstractComparatorFunction)
LessThan lessThan;
@ -301,7 +301,7 @@ template<typename T>
struct BuiltInEqualsComparatorFunction : public AbstractComparatorFunction
{
BuiltInEqualsComparatorFunction()
: AbstractComparatorFunction(Q_NULLPTR, equals, destroy) {}
: AbstractComparatorFunction(nullptr, equals, destroy) {}
static bool equals(const AbstractComparatorFunction *, const void *l, const void *r)
{
const T *lhs = static_cast<const T *>(l);
@ -318,7 +318,7 @@ struct BuiltInEqualsComparatorFunction : public AbstractComparatorFunction
struct AbstractConverterFunction
{
typedef bool (*Converter)(const AbstractConverterFunction *, const void *, void*);
explicit AbstractConverterFunction(Converter c = Q_NULLPTR)
explicit AbstractConverterFunction(Converter c = nullptr)
: convert(c) {}
Q_DISABLE_COPY(AbstractConverterFunction)
Converter convert;
@ -513,9 +513,9 @@ public:
static TypeFlags typeFlags(int type);
static const QMetaObject *metaObjectForType(int type);
static bool isRegistered(int type);
static void *create(int type, const void *copy = Q_NULLPTR);
static void *create(int type, const void *copy = nullptr);
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED static void *construct(int type, const void *copy = Q_NULLPTR)
QT_DEPRECATED static void *construct(int type, const void *copy = nullptr)
{ return create(type, copy); }
#endif
static void destroy(int type, void *data);
@ -536,9 +536,9 @@ public:
inline TypeFlags flags() const;
inline const QMetaObject *metaObject() const;
inline void *create(const void *copy = Q_NULLPTR) const;
inline void *create(const void *copy = nullptr) const;
inline void destroy(void *data) const;
inline void *construct(void *where, const void *copy = Q_NULLPTR) const;
inline void *construct(void *where, const void *copy = nullptr) const;
inline void destruct(void *data) const;
public:
@ -617,7 +617,7 @@ public:
return registerConverterFunction(&f, fromTypeId, toTypeId);
}
// member function as in "double QString::toDouble(bool *ok = Q_NULLPTR) const"
// member function as in "double QString::toDouble(bool *ok = nullptr) const"
template<typename From, typename To>
static bool registerConverter(To(From::*function)(bool*) const)
{
@ -680,9 +680,9 @@ private:
uint sizeExtended() const;
QMetaType::TypeFlags flagsExtended() const;
const QMetaObject *metaObjectExtended() const;
void *createExtended(const void *copy = Q_NULLPTR) const;
void *createExtended(const void *copy = nullptr) const;
void destroyExtended(void *data) const;
void *constructExtended(void *where, const void *copy = Q_NULLPTR) const;
void *constructExtended(void *where, const void *copy = nullptr) const;
void destructExtended(void *data) const;
static bool registerComparatorFunction(const QtPrivate::AbstractComparatorFunction *f, int type);
@ -782,7 +782,7 @@ struct QMetaTypeFunctionHelper {
template <typename T>
struct QMetaTypeFunctionHelper<T, /* Accepted */ false> {
static void Destruct(void *) {}
static void *Construct(void *, const void *) { return Q_NULLPTR; }
static void *Construct(void *, const void *) { return nullptr; }
#ifndef QT_NO_DATASTREAM
static void Save(QDataStream &, const void *) {}
static void Load(QDataStream &, void *) {}
@ -1020,7 +1020,7 @@ public:
public:
template<class T> QSequentialIterableImpl(const T*p)
: _iterable(p)
, _iterator(Q_NULLPTR)
, _iterator(nullptr)
, _metaType_id(qMetaTypeId<typename T::value_type>())
, _metaType_flags(QTypeInfo<typename T::value_type>::isPointer)
, _iteratorCapabilities(ContainerAPI<T>::IteratorCapabilities)
@ -1037,20 +1037,20 @@ public:
}
QSequentialIterableImpl()
: _iterable(Q_NULLPTR)
, _iterator(Q_NULLPTR)
: _iterable(nullptr)
, _iterator(nullptr)
, _metaType_id(QMetaType::UnknownType)
, _metaType_flags(0)
, _iteratorCapabilities(0)
, _size(Q_NULLPTR)
, _at(Q_NULLPTR)
, _moveToBegin(Q_NULLPTR)
, _moveToEnd(Q_NULLPTR)
, _advance(Q_NULLPTR)
, _get(Q_NULLPTR)
, _destroyIter(Q_NULLPTR)
, _equalIter(Q_NULLPTR)
, _copyIter(Q_NULLPTR)
, _size(nullptr)
, _at(nullptr)
, _moveToBegin(nullptr)
, _moveToEnd(nullptr)
, _advance(nullptr)
, _get(nullptr)
, _destroyIter(nullptr)
, _equalIter(nullptr)
, _copyIter(nullptr)
{
}
@ -1189,7 +1189,7 @@ public:
public:
template<class T> QAssociativeIterableImpl(const T*p)
: _iterable(p)
, _iterator(Q_NULLPTR)
, _iterator(nullptr)
, _metaType_id_key(qMetaTypeId<typename T::key_type>())
, _metaType_flags_key(QTypeInfo<typename T::key_type>::isPointer)
, _metaType_id_value(qMetaTypeId<typename T::mapped_type>())
@ -1208,22 +1208,22 @@ public:
}
QAssociativeIterableImpl()
: _iterable(Q_NULLPTR)
, _iterator(Q_NULLPTR)
: _iterable(nullptr)
, _iterator(nullptr)
, _metaType_id_key(QMetaType::UnknownType)
, _metaType_flags_key(0)
, _metaType_id_value(QMetaType::UnknownType)
, _metaType_flags_value(0)
, _size(Q_NULLPTR)
, _find(Q_NULLPTR)
, _begin(Q_NULLPTR)
, _end(Q_NULLPTR)
, _advance(Q_NULLPTR)
, _getKey(Q_NULLPTR)
, _getValue(Q_NULLPTR)
, _destroyIter(Q_NULLPTR)
, _equalIter(Q_NULLPTR)
, _copyIter(Q_NULLPTR)
, _size(nullptr)
, _find(nullptr)
, _begin(nullptr)
, _end(nullptr)
, _advance(nullptr)
, _getKey(nullptr)
, _getValue(nullptr)
, _destroyIter(nullptr)
, _equalIter(nullptr)
, _copyIter(nullptr)
{
}
@ -1292,13 +1292,13 @@ public:
}
QPairVariantInterfaceImpl()
: _pair(Q_NULLPTR)
: _pair(nullptr)
, _metaType_id_first(QMetaType::UnknownType)
, _metaType_flags_first(0)
, _metaType_id_second(QMetaType::UnknownType)
, _metaType_flags_second(0)
, _getFirst(Q_NULLPTR)
, _getSecond(Q_NULLPTR)
, _getFirst(nullptr)
, _getSecond(nullptr)
{
}
@ -1374,7 +1374,7 @@ namespace QtPrivate
#endif
static no_type checkType(...);
Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined");
enum { Value = sizeof(checkType(static_cast<T*>(Q_NULLPTR))) == sizeof(yes_type) };
enum { Value = sizeof(checkType(static_cast<T*>(nullptr))) == sizeof(yes_type) };
};
template<typename T, typename Enable = void>
@ -1419,12 +1419,12 @@ namespace QtPrivate
template<typename T, typename Enable = void>
struct MetaObjectForType
{
static inline const QMetaObject *value() { return Q_NULLPTR; }
static inline const QMetaObject *value() { return nullptr; }
};
template<>
struct MetaObjectForType<void>
{
static inline const QMetaObject *value() { return Q_NULLPTR; }
static inline const QMetaObject *value() { return nullptr; }
};
template<typename T>
struct MetaObjectForType<T*, typename std::enable_if<IsPointerToTypeDerivedFromQObject<T*>::Value>::type>
@ -1720,7 +1720,7 @@ int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normaliz
template <typename T>
int qRegisterMetaType(const char *typeName
#ifndef Q_QDOC
, T * dummy = Q_NULLPTR
, T * dummy = nullptr
, typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
)
@ -1737,7 +1737,7 @@ int qRegisterMetaType(const char *typeName
template <typename T>
void qRegisterMetaTypeStreamOperators(const char *typeName
#ifndef Q_QDOC
, T * /* dummy */ = Q_NULLPTR
, T * /* dummy */ = nullptr
#endif
)
{
@ -2150,7 +2150,7 @@ inline QMetaType::QMetaType(const ExtensionFlag extensionFlags, const QMetaTypeI
, m_loadOp(loadOp)
, m_constructor(constructor)
, m_destructor(destructor)
, m_extension(Q_NULLPTR)
, m_extension(nullptr)
, m_size(size)
, m_typeFlags(theTypeFlags)
, m_extensionFlags(extensionFlags)

View File

@ -998,7 +998,7 @@ QObject::~QObject()
if (senderLists)
senderLists->dirty = true;
QtPrivate::QSlotObjectBase *slotObj = Q_NULLPTR;
QtPrivate::QSlotObjectBase *slotObj = nullptr;
if (node->isSlotObject) {
slotObj = node->slotObj;
node->isSlotObject = false;
@ -1468,14 +1468,14 @@ void QObject::moveToThread(QThread *targetThread)
}
QThreadData *currentData = QThreadData::current();
QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : Q_NULLPTR;
QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : nullptr;
if (d->threadData->thread == 0 && currentData == targetData) {
// one exception to the rule: we allow moving objects with no thread affinity to the current thread
currentData = d->threadData;
} else if (d->threadData != currentData) {
qWarning("QObject::moveToThread: Current thread (%p) is not the object's thread (%p).\n"
"Cannot move to target thread (%p)\n",
currentData->thread.load(), d->threadData->thread.load(), targetData ? targetData->thread.load() : Q_NULLPTR);
currentData->thread.load(), d->threadData->thread.load(), targetData ? targetData->thread.load() : nullptr);
#ifdef Q_OS_MAC
qWarning("You might be loading two sets of Qt binaries into the same process. "

View File

@ -120,23 +120,23 @@ class Q_CORE_EXPORT QObject
Q_DECLARE_PRIVATE(QObject)
public:
Q_INVOKABLE explicit QObject(QObject *parent=Q_NULLPTR);
Q_INVOKABLE explicit QObject(QObject *parent=nullptr);
virtual ~QObject();
virtual bool event(QEvent *event);
virtual bool eventFilter(QObject *watched, QEvent *event);
#ifdef Q_QDOC
static QString tr(const char *sourceText, const char *comment = Q_NULLPTR, int n = -1);
static QString trUtf8(const char *sourceText, const char *comment = Q_NULLPTR, int n = -1);
static QString tr(const char *sourceText, const char *comment = nullptr, int n = -1);
static QString trUtf8(const char *sourceText, const char *comment = nullptr, int n = -1);
virtual const QMetaObject *metaObject() const;
static const QMetaObject staticMetaObject;
#endif
#ifdef QT_NO_TRANSLATION
static QString tr(const char *sourceText, const char * = Q_NULLPTR, int = -1)
static QString tr(const char *sourceText, const char * = nullptr, int = -1)
{ return QString::fromUtf8(sourceText); }
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED static QString trUtf8(const char *sourceText, const char * = Q_NULLPTR, int = -1)
QT_DEPRECATED static QString trUtf8(const char *sourceText, const char * = nullptr, int = -1)
{ return QString::fromUtf8(sourceText); }
#endif
#endif //QT_NO_TRANSLATION
@ -248,7 +248,7 @@ public:
Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
const int *types = Q_NULLPTR;
const int *types = nullptr;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
@ -288,11 +288,11 @@ public:
Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
const int *types = Q_NULLPTR;
const int *types = nullptr;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, Q_NULLPTR,
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, nullptr,
new QtPrivate::QStaticSlotObject<Func2,
typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
typename SignalType::ReturnType>(slot),
@ -327,11 +327,11 @@ public:
Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
"No Q_OBJECT in the class with the signal");
const int *types = Q_NULLPTR;
const int *types = nullptr;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, Q_NULLPTR,
return connectImpl(sender, reinterpret_cast<void **>(&signal), context, nullptr,
new QtPrivate::QFunctorSlotObject<Func2, SlotArgumentCount,
typename QtPrivate::List_Left<typename SignalType::Arguments, SlotArgumentCount>::Value,
typename SignalType::ReturnType>(std::move(slot)),
@ -343,11 +343,11 @@ public:
const QObject *receiver, const char *member);
static bool disconnect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &member);
inline bool disconnect(const char *signal = Q_NULLPTR,
const QObject *receiver = Q_NULLPTR, const char *member = Q_NULLPTR) const
inline bool disconnect(const char *signal = nullptr,
const QObject *receiver = nullptr, const char *member = nullptr) const
{ return disconnect(this, signal, receiver, member); }
inline bool disconnect(const QObject *receiver, const char *member = Q_NULLPTR) const
{ return disconnect(this, Q_NULLPTR, receiver, member); }
inline bool disconnect(const QObject *receiver, const char *member = nullptr) const
{ return disconnect(this, nullptr, receiver, member); }
static bool disconnect(const QMetaObject::Connection &);
#ifdef Q_QDOC
@ -375,7 +375,7 @@ public:
static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const QObject *receiver, void **zero)
{
// This is the overload for when one wish to disconnect a signal from any slot. (slot=Q_NULLPTR)
// This is the overload for when one wish to disconnect a signal from any slot. (slot=nullptr)
// Since the function template parameter cannot be deduced from '0', we use a
// dummy void ** parameter that must be equal to 0
Q_ASSERT(!zero);
@ -406,14 +406,14 @@ public:
#endif // QT_NO_USERDATA
Q_SIGNALS:
void destroyed(QObject * = Q_NULLPTR);
void destroyed(QObject * = nullptr);
void objectNameChanged(const QString &objectName, QPrivateSignal);
public:
inline QObject *parent() const { return d_ptr->parent; }
inline bool inherits(const char *classname) const
{ return const_cast<QObject *>(this)->qt_metacast(classname) != Q_NULLPTR; }
{ return const_cast<QObject *>(this)->qt_metacast(classname) != nullptr; }
public Q_SLOTS:
void deleteLater();
@ -432,7 +432,7 @@ protected:
virtual void disconnectNotify(const QMetaMethod &signal);
protected:
QObject(QObjectPrivate &dd, QObject *parent = Q_NULLPTR);
QObject(QObjectPrivate &dd, QObject *parent = nullptr);
protected:
QScopedPointer<QObjectData> d_ptr;
@ -525,16 +525,16 @@ inline T qobject_cast(const QObject *object)
template <class T> inline const char * qobject_interface_iid()
{ return Q_NULLPTR; }
{ return nullptr; }
#ifndef Q_MOC_RUN
# define Q_DECLARE_INTERFACE(IFace, IId) \
template <> inline const char *qobject_interface_iid<IFace *>() \
{ return IId; } \
template <> inline IFace *qobject_cast<IFace *>(QObject *object) \
{ return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : Q_NULLPTR)); } \
{ return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : nullptr)); } \
template <> inline IFace *qobject_cast<IFace *>(const QObject *object) \
{ return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : Q_NULLPTR)); }
{ return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : nullptr)); }
#endif // Q_MOC_RUN
#ifndef QT_NO_DEBUG_STREAM
@ -580,7 +580,7 @@ QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW
m_blocked(other.m_blocked),
m_inhibited(other.m_inhibited)
{
other.m_o = Q_NULLPTR;
other.m_o = nullptr;
}
QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
@ -594,7 +594,7 @@ QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
m_blocked = other.m_blocked;
m_inhibited = other.m_inhibited;
// disable other:
other.m_o = Q_NULLPTR;
other.m_o = nullptr;
}
return *this;
}

View File

@ -68,9 +68,9 @@ namespace QtPrivate {
{ enum { Value = QMetaTypeId2<Arg>::Defined && TypesAreDeclaredMetaType<List<Tail...>>::Value }; };
template <typename ArgList, bool Declared = TypesAreDeclaredMetaType<ArgList>::Value > struct ConnectionTypes
{ static const int *types() { return Q_NULLPTR; } };
{ static const int *types() { return nullptr; } };
template <> struct ConnectionTypes<List<>, true>
{ static const int *types() { return Q_NULLPTR; } };
{ static const int *types() { return nullptr; } };
template <typename... Args> struct ConnectionTypes<List<Args...>, true>
{ static const int *types() { static const int t[sizeof...(Args) + 1] = { (QtPrivate::QMetaTypeIdHelper<Args>::qt_metatype_id())..., 0 }; return t; } };

View File

@ -137,9 +137,9 @@ class QString;
#ifndef QT_NO_TRANSLATION
// full set of tr functions
# define QT_TR_FUNCTIONS \
static inline QString tr(const char *s, const char *c = Q_NULLPTR, int n = -1) \
static inline QString tr(const char *s, const char *c = nullptr, int n = -1) \
{ return staticMetaObject.tr(s, c, n); } \
QT_DEPRECATED static inline QString trUtf8(const char *s, const char *c = Q_NULLPTR, int n = -1) \
QT_DEPRECATED static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) \
{ return staticMetaObject.tr(s, c, n); }
#else
// inherit the ones from QObject
@ -294,7 +294,7 @@ class QMetaClassInfo;
class Q_CORE_EXPORT QGenericArgument
{
public:
inline QGenericArgument(const char *aName = Q_NULLPTR, const void *aData = Q_NULLPTR)
inline QGenericArgument(const char *aName = nullptr, const void *aData = nullptr)
: _data(aData), _name(aName) {}
inline void *data() const { return const_cast<void *>(_data); }
inline const char *name() const { return _name; }
@ -307,7 +307,7 @@ private:
class Q_CORE_EXPORT QGenericReturnArgument: public QGenericArgument
{
public:
inline QGenericReturnArgument(const char *aName = Q_NULLPTR, void *aData = Q_NULLPTR)
inline QGenericReturnArgument(const char *aName = nullptr, void *aData = nullptr)
: QGenericArgument(aName, aData)
{}
};
@ -388,7 +388,7 @@ struct Q_CORE_EXPORT QMetaObject
// internal index-based connect
static Connection connect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index,
int type = 0, int *types = Q_NULLPTR);
int type = 0, int *types = nullptr);
// internal index-based disconnect
static bool disconnect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index);
@ -405,7 +405,7 @@ struct Q_CORE_EXPORT QMetaObject
static bool invokeMethod(QObject *obj, const char *member,
Qt::ConnectionType,
QGenericReturnArgument ret,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -418,7 +418,7 @@ struct Q_CORE_EXPORT QMetaObject
static inline bool invokeMethod(QObject *obj, const char *member,
QGenericReturnArgument ret,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -435,7 +435,7 @@ struct Q_CORE_EXPORT QMetaObject
static inline bool invokeMethod(QObject *obj, const char *member,
Qt::ConnectionType type,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -451,7 +451,7 @@ struct Q_CORE_EXPORT QMetaObject
}
static inline bool invokeMethod(QObject *obj, const char *member,
QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -551,7 +551,7 @@ struct Q_CORE_EXPORT QMetaObject
#endif
QObject *newInstance(QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
QObject *newInstance(QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@ -611,11 +611,11 @@ public:
operator bool() const;
#else
typedef void *Connection::*RestrictedBool;
operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : Q_NULLPTR; }
operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : nullptr; }
#endif
#ifdef Q_COMPILER_RVALUE_REFS
inline Connection(Connection &&o) : d_ptr(o.d_ptr) { o.d_ptr = Q_NULLPTR; }
inline Connection(Connection &&o) : d_ptr(o.d_ptr) { o.d_ptr = nullptr; }
inline Connection &operator=(Connection &&other)
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif

View File

@ -372,10 +372,10 @@ namespace QtPrivate {
inline int ref() Q_DECL_NOTHROW { return m_ref.ref(); }
inline void destroyIfLastRef() Q_DECL_NOTHROW
{ if (!m_ref.deref()) m_impl(Destroy, this, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR); }
{ if (!m_ref.deref()) m_impl(Destroy, this, nullptr, nullptr, nullptr); }
inline bool compare(void **a) { bool ret = false; m_impl(Compare, this, Q_NULLPTR, a, &ret); return ret; }
inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, Q_NULLPTR); }
inline bool compare(void **a) { bool ret = false; m_impl(Compare, this, nullptr, a, &ret); return ret; }
inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, nullptr); }
protected:
~QSlotObjectBase() {}
private:

View File

@ -74,8 +74,8 @@ public:
UnknownError
};
QSharedMemory(QObject *parent = Q_NULLPTR);
QSharedMemory(const QString &key, QObject *parent = Q_NULLPTR);
QSharedMemory(QObject *parent = nullptr);
QSharedMemory(const QString &key, QObject *parent = nullptr);
~QSharedMemory();
void setKey(const QString &key);

View File

@ -53,7 +53,7 @@ class Q_CORE_EXPORT QSocketNotifier : public QObject
public:
enum Type { Read, Write, Exception };
QSocketNotifier(qintptr socket, Type, QObject *parent = Q_NULLPTR);
QSocketNotifier(qintptr socket, Type, QObject *parent = nullptr);
~QSocketNotifier();
qintptr socket() const;

View File

@ -63,7 +63,7 @@ class Q_CORE_EXPORT QTimer : public QObject
Q_PROPERTY(Qt::TimerType timerType READ timerType WRITE setTimerType)
Q_PROPERTY(bool active READ isActive)
public:
explicit QTimer(QObject *parent = Q_NULLPTR);
explicit QTimer(QObject *parent = nullptr);
~QTimer();
inline bool isActive() const { return id >= 0; }

View File

@ -55,11 +55,11 @@ class Q_CORE_EXPORT QTranslator : public QObject
{
Q_OBJECT
public:
explicit QTranslator(QObject *parent = Q_NULLPTR);
explicit QTranslator(QObject *parent = nullptr);
~QTranslator();
virtual QString translate(const char *context, const char *sourceText,
const char *disambiguation = Q_NULLPTR, int n = -1) const;
const char *disambiguation = nullptr, int n = -1) const;
virtual bool isEmpty() const;

View File

@ -284,14 +284,14 @@ class Q_CORE_EXPORT QVariant
void detach();
inline bool isDetached() const;
int toInt(bool *ok = Q_NULLPTR) const;
uint toUInt(bool *ok = Q_NULLPTR) const;
qlonglong toLongLong(bool *ok = Q_NULLPTR) const;
qulonglong toULongLong(bool *ok = Q_NULLPTR) const;
int toInt(bool *ok = nullptr) const;
uint toUInt(bool *ok = nullptr) const;
qlonglong toLongLong(bool *ok = nullptr) const;
qulonglong toULongLong(bool *ok = nullptr) const;
bool toBool() const;
double toDouble(bool *ok = Q_NULLPTR) const;
float toFloat(bool *ok = Q_NULLPTR) const;
qreal toReal(bool *ok = Q_NULLPTR) const;
double toDouble(bool *ok = nullptr) const;
float toFloat(bool *ok = nullptr) const;
qreal toReal(bool *ok = nullptr) const;
QByteArray toByteArray() const;
QBitArray toBitArray() const;
QString toString() const;
@ -370,7 +370,7 @@ class Q_CORE_EXPORT QVariant
struct Private
{
inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true)
{ data.ptr = Q_NULLPTR; }
{ data.ptr = nullptr; }
// Internal constructor for initialized variants.
explicit inline Private(uint variantType) Q_DECL_NOTHROW

View File

@ -54,8 +54,8 @@ class Q_CORE_EXPORT QWinEventNotifier : public QObject
typedef Qt::HANDLE HANDLE;
public:
explicit QWinEventNotifier(QObject *parent = Q_NULLPTR);
explicit QWinEventNotifier(HANDLE hEvent, QObject *parent = Q_NULLPTR);
explicit QWinEventNotifier(QObject *parent = nullptr);
explicit QWinEventNotifier(HANDLE hEvent, QObject *parent = nullptr);
~QWinEventNotifier();
void setHandle(HANDLE hEvent);

View File

@ -90,7 +90,7 @@ public:
int endPos() const { return m_endPos; }
QByteArray mask() const;
bool isValid() const { return m_matchFunction != Q_NULLPTR; }
bool isValid() const { return m_matchFunction != nullptr; }
bool matches(const QByteArray &data) const;

View File

@ -65,10 +65,10 @@ public:
Q_FLAG(LoadHint)
Q_FLAG(LoadHints)
explicit QLibrary(QObject *parent = Q_NULLPTR);
explicit QLibrary(const QString& fileName, QObject *parent = Q_NULLPTR);
explicit QLibrary(const QString& fileName, int verNum, QObject *parent = Q_NULLPTR);
explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = Q_NULLPTR);
explicit QLibrary(QObject *parent = nullptr);
explicit QLibrary(const QString& fileName, QObject *parent = nullptr);
explicit QLibrary(const QString& fileName, int verNum, QObject *parent = nullptr);
explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = nullptr);
~QLibrary();
QFunctionPointer resolve(const char *symbol);

View File

@ -59,8 +59,8 @@ class Q_CORE_EXPORT QPluginLoader : public QObject
Q_PROPERTY(QString fileName READ fileName WRITE setFileName)
Q_PROPERTY(QLibrary::LoadHints loadHints READ loadHints WRITE setLoadHints)
public:
explicit QPluginLoader(QObject *parent = Q_NULLPTR);
explicit QPluginLoader(const QString &fileName, QObject *parent = Q_NULLPTR);
explicit QPluginLoader(QObject *parent = nullptr);
explicit QPluginLoader(const QString &fileName, QObject *parent = nullptr);
~QPluginLoader();
QObject *instance();

View File

@ -68,7 +68,7 @@ Q_SIGNALS:
void activeChanged(bool active);
protected:
QAbstractState(QState *parent = Q_NULLPTR);
QAbstractState(QState *parent = nullptr);
virtual void onEntry(QEvent *event) = 0;
virtual void onExit(QEvent *event) = 0;

View File

@ -258,7 +258,7 @@ void QAbstractTransition::setTargetStates(const QList<QAbstractState*> &targets)
// Verify if any of the new target states is a null-pointer:
for (int i = 0; i < targets.size(); ++i) {
if (targets.at(i) == Q_NULLPTR) {
if (targets.at(i) == nullptr) {
qWarning("QAbstractTransition::setTargetStates: target state(s) cannot be null");
return;
}

View File

@ -72,7 +72,7 @@ public:
};
Q_ENUM(TransitionType)
QAbstractTransition(QState *sourceState = Q_NULLPTR);
QAbstractTransition(QState *sourceState = nullptr);
virtual ~QAbstractTransition();
QState *sourceState() const;

View File

@ -54,8 +54,8 @@ class Q_CORE_EXPORT QEventTransition : public QAbstractTransition
Q_PROPERTY(QObject* eventSource READ eventSource WRITE setEventSource)
Q_PROPERTY(QEvent::Type eventType READ eventType WRITE setEventType)
public:
QEventTransition(QState *sourceState = Q_NULLPTR);
QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = Q_NULLPTR);
QEventTransition(QState *sourceState = nullptr);
QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = nullptr);
~QEventTransition();
QObject *eventSource() const;

View File

@ -51,7 +51,7 @@ class Q_CORE_EXPORT QFinalState : public QAbstractState
{
Q_OBJECT
public:
QFinalState(QState *parent = Q_NULLPTR);
QFinalState(QState *parent = nullptr);
~QFinalState();
protected:

View File

@ -203,7 +203,7 @@ void QHistoryState::setDefaultTransition(QAbstractTransition *transition)
QAbstractState *QHistoryState::defaultState() const
{
Q_D(const QHistoryState);
return d->defaultTransition ? d->defaultTransition->targetState() : Q_NULLPTR;
return d->defaultTransition ? d->defaultTransition->targetState() : nullptr;
}
static inline bool isSoleEntry(const QList<QAbstractState*> &states, const QAbstractState * state)

View File

@ -61,8 +61,8 @@ public:
};
Q_ENUM(HistoryType)
QHistoryState(QState *parent = Q_NULLPTR);
QHistoryState(HistoryType type, QState *parent = Q_NULLPTR);
QHistoryState(QState *parent = nullptr);
QHistoryState(HistoryType type, QState *parent = nullptr);
~QHistoryState();
QAbstractTransition *defaultTransition() const;

View File

@ -55,17 +55,17 @@ class Q_CORE_EXPORT QSignalTransition : public QAbstractTransition
Q_PROPERTY(QByteArray signal READ signal WRITE setSignal NOTIFY signalChanged)
public:
QSignalTransition(QState *sourceState = Q_NULLPTR);
QSignalTransition(QState *sourceState = nullptr);
QSignalTransition(const QObject *sender, const char *signal,
QState *sourceState = Q_NULLPTR);
QState *sourceState = nullptr);
#ifdef Q_QDOC
template<typename PointerToMemberFunction>
QSignalTransition(const QObject *object, PointerToMemberFunction signal,
QState *sourceState = Q_NULLPTR);
QState *sourceState = nullptr);
#elif defined(Q_COMPILER_DELEGATING_CONSTRUCTORS)
template <typename Func>
QSignalTransition(const typename QtPrivate::FunctionPointer<Func>::Object *obj,
Func sig, QState *srcState = Q_NULLPTR)
Func sig, QState *srcState = nullptr)
: QSignalTransition(obj, QMetaMethod::fromSignal(sig).methodSignature().constData(), srcState)
{
}

View File

@ -524,7 +524,7 @@ void QState::setChildMode(ChildMode mode)
if (mode == QState::ParallelStates && d->initialState) {
qWarning("QState::setChildMode: setting the child-mode of state %p to "
"parallel removes the initial state", this);
d->initialState = Q_NULLPTR;
d->initialState = nullptr;
emit initialStateChanged(QState::QPrivateSignal());
}

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