summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/main.cpp6
-rw-r--r--tools/qmlcachegen/generateloader.cpp8
-rw-r--r--tools/qmlcachegen/qmlcachegen.cpp4
-rw-r--r--tools/qmleasing/segmentproperties.cpp2
-rw-r--r--tools/qmleasing/splineeditor.cpp2
-rw-r--r--tools/qmlimportscanner/main.cpp2
-rw-r--r--tools/qmlplugindump/main.cpp10
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.cpp2
-rw-r--r--tools/qmlscene/main.cpp48
-rw-r--r--tools/qmltime/qmltime.cpp4
10 files changed, 36 insertions, 52 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index c8858a44ae..6cf6ad3b2c 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -71,8 +71,8 @@
#define FILE_OPEN_EVENT_WAIT_TIME 3000 // ms
-static Config *conf = 0;
-static QQmlApplicationEngine *qae = 0;
+static Config *conf = nullptr;
+static QQmlApplicationEngine *qae = nullptr;
#if defined(Q_OS_DARWIN) || defined(QT_GUI_LIB)
static int exitTimerId = -1;
#endif
@@ -438,7 +438,7 @@ static void loadDummyDataFiles(QQmlEngine &engine, const QString& directory)
int main(int argc, char *argv[])
{
getAppFlags(argc, argv);
- QCoreApplication *app = 0;
+ QCoreApplication *app = nullptr;
switch (applicationType) {
case QmlApplicationTypeCore:
app = new QCoreApplication(argc, argv);
diff --git a/tools/qmlcachegen/generateloader.cpp b/tools/qmlcachegen/generateloader.cpp
index 083af29a2d..1a0b987c64 100644
--- a/tools/qmlcachegen/generateloader.cpp
+++ b/tools/qmlcachegen/generateloader.cpp
@@ -58,12 +58,10 @@ struct VirtualDirectoryEntry
{
QString name;
QVector<VirtualDirectoryEntry*> dirEntries;
- int firstChildIndex; // node index inside generated data
- bool isDirectory;
+ int firstChildIndex = -1; // node index inside generated data
+ bool isDirectory = true;
VirtualDirectoryEntry()
- : firstChildIndex(-1)
- , isDirectory(true)
{}
~VirtualDirectoryEntry()
@@ -98,7 +96,7 @@ struct VirtualDirectoryEntry
struct DataStream
{
- DataStream(QVector<unsigned char > *data = 0)
+ DataStream(QVector<unsigned char > *data = nullptr)
: data(data)
{}
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp
index 1751ba2ecf..9c97ef7694 100644
--- a/tools/qmlcachegen/qmlcachegen.cpp
+++ b/tools/qmlcachegen/qmlcachegen.cpp
@@ -197,7 +197,7 @@ static bool compileQmlFile(const QString &inputFileName, SaveFunction saveFuncti
QmlIR::JSCodeGen v4CodeGen(irDocument.code,
&irDocument.jsGenerator, &irDocument.jsModule,
&irDocument.jsParserEngine, irDocument.program,
- /*import cache*/0, &irDocument.jsGenerator.stringTable, illegalNames);
+ /*import cache*/nullptr, &irDocument.jsGenerator.stringTable, illegalNames);
v4CodeGen.setUseFastLookups(false); // Disable lookups in non-standalone (aka QML) mode
for (QmlIR::Object *object: qAsConst(irDocument.objects)) {
if (object->functionsAndExpressions->count == 0)
@@ -298,7 +298,7 @@ static bool compileJSFile(const QString &inputFileName, const QString &inputFile
{
QmlIR::JSCodeGen v4CodeGen(irDocument.code, &irDocument.jsGenerator,
&irDocument.jsModule, &irDocument.jsParserEngine,
- irDocument.program, /*import cache*/0,
+ irDocument.program, /*import cache*/nullptr,
&irDocument.jsGenerator.stringTable, illegalNames);
v4CodeGen.setUseFastLookups(false); // Disable lookups in non-standalone (aka QML) mode
v4CodeGen.generateFromProgram(inputFileName, inputFileUrl, sourceCode, program,
diff --git a/tools/qmleasing/segmentproperties.cpp b/tools/qmleasing/segmentproperties.cpp
index 01123d3e97..f37527f863 100644
--- a/tools/qmleasing/segmentproperties.cpp
+++ b/tools/qmleasing/segmentproperties.cpp
@@ -30,7 +30,7 @@
#include "splineeditor.h"
SegmentProperties::SegmentProperties(QWidget *parent) :
- QWidget(parent), m_splineEditor(0), m_blockSignals(false)
+ QWidget(parent), m_splineEditor(nullptr), m_blockSignals(false)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);
diff --git a/tools/qmleasing/splineeditor.cpp b/tools/qmleasing/splineeditor.cpp
index af5c519b04..2a6081903f 100644
--- a/tools/qmleasing/splineeditor.cpp
+++ b/tools/qmleasing/splineeditor.cpp
@@ -42,7 +42,7 @@ const int canvasHeight = 320;
const int canvasMargin = 160;
SplineEditor::SplineEditor(QWidget *parent) :
- QWidget(parent), m_pointListWidget(0), m_block(false)
+ QWidget(parent), m_pointListWidget(nullptr), m_block(false)
{
setFixedSize(canvasWidth + canvasMargin * 2, canvasHeight + canvasMargin * 2);
diff --git a/tools/qmlimportscanner/main.cpp b/tools/qmlimportscanner/main.cpp
index d596613553..5bd66243e6 100644
--- a/tools/qmlimportscanner/main.cpp
+++ b/tools/qmlimportscanner/main.cpp
@@ -509,7 +509,7 @@ int main(int argc, char *argv[])
while (i < args.count()) {
const QString &arg = args.at(i);
++i;
- QStringList *argReceiver = 0;
+ QStringList *argReceiver = nullptr;
if (!arg.startsWith(QLatin1Char('-')) || arg == QLatin1String("-")) {
qmlRootPaths += arg;
} else if (arg == QLatin1String("-rootPath")) {
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 422e37fd89..5c5a6a8eb1 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -300,7 +300,7 @@ QSet<const QMetaObject *> collectReachableMetaObjects(QQmlEngine *engine,
continue;
inObjectInstantiation = tyName;
- QObject *object = 0;
+ QObject *object = nullptr;
if (ty.isSingleton()) {
QQmlType::SingletonInstanceInfo *siinfo = ty.singletonInstanceInfo();
@@ -403,7 +403,7 @@ public:
return exportString;
}
- void writeMetaContent(const QMetaObject *meta, KnownAttributes *knownAttributes = 0)
+ void writeMetaContent(const QMetaObject *meta, KnownAttributes *knownAttributes = nullptr)
{
QSet<QString> implicitSignals;
for (int index = meta->propertyOffset(); index < meta->propertyCount(); ++index) {
@@ -642,7 +642,7 @@ private:
qml->writeScriptBinding(QLatin1String("isPointer"), QLatin1String("true"));
}
- void dump(const QMetaProperty &prop, KnownAttributes *knownAttributes = 0)
+ void dump(const QMetaProperty &prop, KnownAttributes *knownAttributes = nullptr)
{
int revision = prop.revision();
QByteArray propName = prop.name();
@@ -658,7 +658,7 @@ private:
}
void dump(const QMetaMethod &meth, const QSet<QString> &implicitSignals,
- KnownAttributes *knownAttributes = 0)
+ KnownAttributes *knownAttributes = nullptr)
{
if (meth.methodType() == QMetaMethod::Signal) {
if (meth.access() != QMetaMethod::Public)
@@ -973,7 +973,7 @@ int main(int argc, char *argv[])
sigAction.sa_handler = &sigSegvHandler;
sigAction.sa_flags = 0;
- sigaction(SIGSEGV, &sigAction, 0);
+ sigaction(SIGSEGV, &sigAction, nullptr);
#endif
#ifdef QT_SIMULATOR
diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp
index fd65e1599a..64cd4ec87f 100644
--- a/tools/qmlprofiler/qmlprofilerapplication.cpp
+++ b/tools/qmlprofiler/qmlprofilerapplication.cpp
@@ -76,7 +76,7 @@ Q_STATIC_ASSERT(sizeof(features) ==
QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) :
QCoreApplication(argc, argv),
m_runMode(LaunchMode),
- m_process(0),
+ m_process(nullptr),
m_hostName(QLatin1String("127.0.0.1")),
m_port(0),
m_pendingRequest(REQUEST_NONE),
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index fc8b9c5292..bc7fe72d4c 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -145,21 +145,7 @@ struct Options
};
Options()
- : originalQml(false)
- , originalQmlRaster(false)
- , maximized(false)
- , fullscreen(false)
- , transparent(false)
- , clip(false)
- , versionDetection(true)
- , slowAnimations(false)
- , quitImmediately(false)
- , resizeViewToRootItem(false)
- , multisample(false)
- , coreProfile(false)
- , verbose(false)
- , applicationType(DefaultQmlApplicationType)
- , textRenderType(QQuickWindow::textRenderType())
+ : textRenderType(QQuickWindow::textRenderType())
{
// QtWebEngine needs a shared context in order for the GPU thread to
// upload textures.
@@ -167,22 +153,22 @@ struct Options
}
QUrl url;
- bool originalQml;
- bool originalQmlRaster;
- bool maximized;
- bool fullscreen;
- bool transparent;
- bool clip;
- bool versionDetection;
- bool slowAnimations;
- bool quitImmediately;
- bool resizeViewToRootItem;
- bool multisample;
- bool coreProfile;
- bool verbose;
+ bool originalQml = false;
+ bool originalQmlRaster = false;
+ bool maximized = false;
+ bool fullscreen = false;
+ bool transparent = false;
+ bool clip = false;
+ bool versionDetection = true;
+ bool slowAnimations = false;
+ bool quitImmediately = false;
+ bool resizeViewToRootItem = false;
+ bool multisample = false;
+ bool coreProfile = false;
+ bool verbose = false;
QVector<Qt::ApplicationAttribute> applicationAttributes;
QString translationFile;
- QmlApplicationType applicationType;
+ QmlApplicationType applicationType = DefaultQmlApplicationType;
QQuickWindow::TextRenderType textRenderType;
};
@@ -310,7 +296,7 @@ static void displayFileDialog(Options *options)
{
#if defined(QT_WIDGETS_LIB) && QT_CONFIG(filedialog)
if (options->applicationType == Options::QmlApplicationTypeWidget) {
- QString fileName = QFileDialog::getOpenFileName(0, "Open QML file", QString(), "QML Files (*.qml)");
+ QString fileName = QFileDialog::getOpenFileName(nullptr, "Open QML file", QString(), "QML Files (*.qml)");
if (!fileName.isEmpty()) {
QFileInfo fi(fileName);
options->url = QUrl::fromLocalFile(fi.canonicalFilePath());
@@ -640,7 +626,7 @@ int main(int argc, char ** argv)
} else {
QQuickItem *contentItem = qobject_cast<QQuickItem *>(topLevel);
if (contentItem) {
- QQuickView* qxView = new QQuickView(&engine, NULL);
+ QQuickView* qxView = new QQuickView(&engine, nullptr);
window.reset(qxView);
// Set window default properties; the qml can still override them
if (options.resizeViewToRootItem)
diff --git a/tools/qmltime/qmltime.cpp b/tools/qmltime/qmltime.cpp
index b337ccac5c..b897d304fc 100644
--- a/tools/qmltime/qmltime.cpp
+++ b/tools/qmltime/qmltime.cpp
@@ -66,10 +66,10 @@ private:
};
QML_DECLARE_TYPE(Timer);
-Timer *Timer::m_timer = 0;
+Timer *Timer::m_timer = nullptr;
Timer::Timer()
- : m_component(0)
+ : m_component(nullptr)
, m_willparent(false)
, m_item(new QQuickItem)
{