diff --git a/src/plugins/qmlprofiler/flamegraphmodel.cpp b/src/plugins/qmlprofiler/flamegraphmodel.cpp index 9393b4213c6..7b2e26d2524 100644 --- a/src/plugins/qmlprofiler/flamegraphmodel.cpp +++ b/src/plugins/qmlprofiler/flamegraphmodel.cpp @@ -71,7 +71,7 @@ FlameGraphModel::FlameGraphModel(QmlProfilerModelManager *modelManager, void FlameGraphModel::clear() { beginResetModel(); - m_stackBottom = FlameGraphData(0, -1, 0); + m_stackBottom = FlameGraphData(nullptr, -1, 0); m_callStack.clear(); m_compileStack.clear(); m_callStack.append(QmlEvent()); @@ -283,7 +283,7 @@ QModelIndex FlameGraphModel::index(int row, int column, const QModelIndex &paren FlameGraphData *parentData = static_cast(parent.internalPointer()); return createIndex(row, column, parentData->children[row]); } else { - return createIndex(row, column, row >= 0 ? m_stackBottom.children[row] : 0); + return createIndex(row, column, row >= 0 ? m_stackBottom.children[row] : nullptr); } } diff --git a/src/plugins/qmlprofiler/flamegraphmodel.h b/src/plugins/qmlprofiler/flamegraphmodel.h index e55bb1f2302..d0040666b7a 100644 --- a/src/plugins/qmlprofiler/flamegraphmodel.h +++ b/src/plugins/qmlprofiler/flamegraphmodel.h @@ -38,7 +38,7 @@ namespace QmlProfiler { namespace Internal { struct FlameGraphData { - FlameGraphData(FlameGraphData *parent = 0, int typeIndex = -1, qint64 duration = 0); + FlameGraphData(FlameGraphData *parent = nullptr, int typeIndex = -1, qint64 duration = 0); ~FlameGraphData(); qint64 duration; @@ -76,7 +76,7 @@ public: MaxRole }; - FlameGraphModel(QmlProfilerModelManager *modelManager, QObject *parent = 0); + FlameGraphModel(QmlProfilerModelManager *modelManager, QObject *parent = nullptr); QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; diff --git a/src/plugins/qmlprofiler/flamegraphview.cpp b/src/plugins/qmlprofiler/flamegraphview.cpp index 4de7fd1601e..d5b5bcca24e 100644 --- a/src/plugins/qmlprofiler/flamegraphview.cpp +++ b/src/plugins/qmlprofiler/flamegraphview.cpp @@ -85,7 +85,7 @@ void FlameGraphView::onVisibleFeaturesChanged(quint64 features) void FlameGraphView::contextMenuEvent(QContextMenuEvent *ev) { QMenu menu; - QAction *getGlobalStatsAction = 0; + QAction *getGlobalStatsAction = nullptr; QPoint position = ev->globalPos(); diff --git a/src/plugins/qmlprofiler/memoryusagemodel.cpp b/src/plugins/qmlprofiler/memoryusagemodel.cpp index 3257883d71d..b379e7455bc 100644 --- a/src/plugins/qmlprofiler/memoryusagemodel.cpp +++ b/src/plugins/qmlprofiler/memoryusagemodel.cpp @@ -103,7 +103,7 @@ QVariantMap MemoryUsageModel::details(int index) const else result.insert(QLatin1String("displayName"), tr("Memory Freed")); - result.insert(tr("Total"), tr("%n bytes", 0, ev->size)); + result.insert(tr("Total"), tr("%n byte(s)", nullptr, ev->size)); if (ev->allocations > 0) { result.insert(tr("Allocated"), tr("%1 bytes").arg(ev->allocated)); result.insert(tr("Allocations"), QString::number(ev->allocations)); diff --git a/src/plugins/qmlprofiler/qmlprofilerattachdialog.h b/src/plugins/qmlprofiler/qmlprofilerattachdialog.h index c1167d39aac..29fac3eb132 100644 --- a/src/plugins/qmlprofiler/qmlprofilerattachdialog.h +++ b/src/plugins/qmlprofiler/qmlprofilerattachdialog.h @@ -39,7 +39,7 @@ class QmlProfilerAttachDialog : public QDialog Q_OBJECT public: - explicit QmlProfilerAttachDialog(QWidget *parent = 0); + explicit QmlProfilerAttachDialog(QWidget *parent = nullptr); ~QmlProfilerAttachDialog(); int port() const; diff --git a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp index f05146a09e3..c41ecffb83a 100644 --- a/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerbindingloopsrenderpass.cpp @@ -70,7 +70,7 @@ struct BindlingLoopsGeometry { static const QSGGeometry::AttributeSet &point2DWithOffset(); static const int maxEventsPerNode = 0xffff / 18; - BindlingLoopsGeometry() : allocatedVertices(0), usedVertices(0), currentY(-1), node(0) {} + BindlingLoopsGeometry() : allocatedVertices(0), usedVertices(0), currentY(-1), node(nullptr) {} uint allocatedVertices; uint usedVertices; float currentY; @@ -170,7 +170,7 @@ Timeline::TimelineRenderPass::State *QmlProfilerBindingLoopsRenderPass::update( return oldState; BindingLoopsRenderPassState *state; - if (oldState == 0) + if (oldState == nullptr) state = new BindingLoopsRenderPassState(model); else state = static_cast(oldState); @@ -327,7 +327,7 @@ void BindingLoopMaterialShader::updateState(const RenderState &state, QSGMateria char const *const *BindingLoopMaterialShader::attributeNames() const { - static const char *const attr[] = {"vertexCoord", "postScaleOffset", 0}; + static const char *const attr[] = {"vertexCoord", "postScaleOffset", nullptr}; return attr; } diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.h b/src/plugins/qmlprofiler/qmlprofilerclientmanager.h index 8946b595160..6acd81c52b0 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.h @@ -44,7 +44,7 @@ class QmlProfilerClientManager : public QmlDebug::QmlDebugConnectionManager { Q_OBJECT public: - explicit QmlProfilerClientManager(QObject *parent = 0); + explicit QmlProfilerClientManager(QObject *parent = nullptr); void setProfilerStateManager(QmlProfilerStateManager *profilerState); void clearEvents(); void setModelManager(QmlProfilerModelManager *modelManager); diff --git a/src/plugins/qmlprofiler/qmlprofilerconfigwidget.h b/src/plugins/qmlprofiler/qmlprofilerconfigwidget.h index 0daf884b78c..88d53fb85a9 100644 --- a/src/plugins/qmlprofiler/qmlprofilerconfigwidget.h +++ b/src/plugins/qmlprofiler/qmlprofilerconfigwidget.h @@ -41,7 +41,7 @@ class QmlProfilerConfigWidget : public QWidget Q_OBJECT public: - explicit QmlProfilerConfigWidget(QmlProfilerSettings *settings, QWidget *parent = 0); + explicit QmlProfilerConfigWidget(QmlProfilerSettings *settings, QWidget *parent = nullptr); ~QmlProfilerConfigWidget(); private: diff --git a/src/plugins/qmlprofiler/qmlprofilereventsview.h b/src/plugins/qmlprofiler/qmlprofilereventsview.h index df9abad42d1..5671b424f9b 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventsview.h +++ b/src/plugins/qmlprofiler/qmlprofilereventsview.h @@ -37,7 +37,7 @@ class QMLPROFILER_EXPORT QmlProfilerEventsView : public QWidget { Q_OBJECT public: - QmlProfilerEventsView(QWidget *parent = 0) : QWidget(parent) {} + QmlProfilerEventsView(QWidget *parent = nullptr) : QWidget(parent) {} virtual void selectByTypeId(int typeIndex) = 0; virtual void onVisibleFeaturesChanged(quint64 features) = 0; diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h index a6ec8c4364d..922de6ff38e 100644 --- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h @@ -58,7 +58,7 @@ public: typedef std::function EventLoader; typedef std::function Finalizer; - explicit QmlProfilerModelManager(QObject *parent = 0); + explicit QmlProfilerModelManager(QObject *parent = nullptr); ~QmlProfilerModelManager(); State state() const; diff --git a/src/plugins/qmlprofiler/qmlprofilerstatemanager.h b/src/plugins/qmlprofiler/qmlprofilerstatemanager.h index e04870ab1c3..b0ce30440b6 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatemanager.h +++ b/src/plugins/qmlprofiler/qmlprofilerstatemanager.h @@ -40,7 +40,7 @@ public: AppDying, }; - explicit QmlProfilerStateManager(QObject *parent = 0); + explicit QmlProfilerStateManager(QObject *parent = nullptr); ~QmlProfilerStateManager(); QmlProfilerState currentState(); diff --git a/src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp b/src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp index 6b2f455f0de..c25483490f9 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatewidget.cpp @@ -118,7 +118,7 @@ void QmlProfilerStateWidget::updateDisplay() // Heuristic to not show the number if the application will only send the events when it // stops. The number is still > 0 then because we get some StartTrace etc. uint numEvents = d->m_modelManager->numEvents(); - showText(numEvents > 256 ? tr("Profiling application: %n events", 0, numEvents) : + showText(numEvents > 256 ? tr("Profiling application: %n events", nullptr, numEvents) : tr("Profiling application")); return; } @@ -135,7 +135,7 @@ void QmlProfilerStateWidget::updateDisplay() if (d->m_profilerState->currentState() != QmlProfilerStateManager::Idle) { if (state == QmlProfilerModelManager::AcquiringData) { // we don't know how much more, so progress numbers are strange here - showText(tr("Loading buffered data: %n events", 0, + showText(tr("Loading buffered data: %n events", nullptr, d->m_modelManager->numEvents())); } else if (state == QmlProfilerModelManager::ClearingData) { // when starting a second recording from the same process without aggregation @@ -143,7 +143,7 @@ void QmlProfilerStateWidget::updateDisplay() } } else if (state == QmlProfilerModelManager::AcquiringData) { // Application died before all data could be read - showText(tr("Loading offline data: %n events", 0, + showText(tr("Loading offline data: %n events", nullptr, d->m_modelManager->numEvents())); } else if (state == QmlProfilerModelManager::ClearingData) { showText(tr("Clearing old trace")); diff --git a/src/plugins/qmlprofiler/qmlprofilerstatewidget.h b/src/plugins/qmlprofiler/qmlprofilerstatewidget.h index bce98d9ce8e..376ea09fa0c 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatewidget.h +++ b/src/plugins/qmlprofiler/qmlprofilerstatewidget.h @@ -38,7 +38,8 @@ class QmlProfilerStateWidget : public QFrame Q_OBJECT public: explicit QmlProfilerStateWidget(QmlProfilerStateManager *stateManager, - QmlProfilerModelManager *modelManager, QWidget *parent = 0); + QmlProfilerModelManager *modelManager, + QWidget *parent = nullptr); ~QmlProfilerStateWidget(); private: diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp index 94849db8ff0..d3248e2201e 100644 --- a/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsview.cpp @@ -130,10 +130,10 @@ QStringList QmlProfilerStatisticsView::details(int typeId) const void QmlProfilerStatisticsView::contextMenuEvent(QContextMenuEvent *ev) { QMenu menu; - QAction *copyRowAction = 0; - QAction *copyTableAction = 0; - QAction *showExtendedStatsAction = 0; - QAction *getGlobalStatsAction = 0; + QAction *copyRowAction = nullptr; + QAction *copyTableAction = nullptr; + QAction *showExtendedStatsAction = nullptr; + QAction *getGlobalStatsAction = nullptr; QPoint position = ev->globalPos(); diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index c5ddd3e2d1e..e7542f6e52d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -98,31 +98,31 @@ namespace Internal { class QmlProfilerTool::QmlProfilerToolPrivate { public: - QmlProfilerStateManager *m_profilerState = 0; - QmlProfilerClientManager *m_profilerConnections = 0; - QmlProfilerModelManager *m_profilerModelManager = 0; + QmlProfilerStateManager *m_profilerState = nullptr; + QmlProfilerClientManager *m_profilerConnections = nullptr; + QmlProfilerModelManager *m_profilerModelManager = nullptr; - QmlProfilerViewManager *m_viewContainer = 0; - QToolButton *m_recordButton = 0; - QMenu *m_recordFeaturesMenu = 0; + QmlProfilerViewManager *m_viewContainer = nullptr; + QToolButton *m_recordButton = nullptr; + QMenu *m_recordFeaturesMenu = nullptr; - QAction *m_startAction = 0; - QAction *m_stopAction = 0; - QToolButton *m_clearButton = 0; + QAction *m_startAction = nullptr; + QAction *m_stopAction = nullptr; + QToolButton *m_clearButton = nullptr; // open search - QToolButton *m_searchButton = 0; + QToolButton *m_searchButton = nullptr; // hide and show categories - QToolButton *m_displayFeaturesButton = 0; - QMenu *m_displayFeaturesMenu = 0; + QToolButton *m_displayFeaturesButton = nullptr; + QMenu *m_displayFeaturesMenu = nullptr; // save and load actions - QAction *m_saveQmlTrace = 0; - QAction *m_loadQmlTrace = 0; + QAction *m_saveQmlTrace = nullptr; + QAction *m_loadQmlTrace = nullptr; // elapsed time display - QLabel *m_timeLabel = 0; + QLabel *m_timeLabel = nullptr; QTimer m_recordingTimer; QTime m_recordingElapsedTime; @@ -160,7 +160,7 @@ QmlProfilerTool::QmlProfilerTool() this, &QmlProfilerTool::onLoadSaveFinished); d->m_profilerConnections->setModelManager(d->m_profilerModelManager); - Command *command = 0; + Command *command = nullptr; ActionContainer *menu = ActionManager::actionContainer(M_DEBUG_ANALYZER); ActionContainer *options = ActionManager::createMenu("Analyzer.Menu.QMLOptions"); diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index 31abdb61589..ea6e53406d3 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -266,7 +266,7 @@ void QmlProfilerTraceView::contextMenuEvent(QContextMenuEvent *ev) void QmlProfilerTraceView::showContextMenu(QPoint position) { QMenu menu; - QAction *viewAllAction = 0; + QAction *viewAllAction = nullptr; menu.addActions(QmlProfilerTool::profilerContextMenuActions()); menu.addSeparator(); diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp index adee2f97a95..a18ffa8a8ec 100644 --- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp @@ -51,7 +51,7 @@ QmlProfilerViewManager::QmlProfilerViewManager(QObject *parent, QTC_ASSERT(m_profilerModelManager, return); QTC_ASSERT(m_profilerState, return); - m_traceView = new QmlProfilerTraceView(0, this, m_profilerModelManager); + m_traceView = new QmlProfilerTraceView(nullptr, this, m_profilerModelManager); connect(m_traceView, &QmlProfilerTraceView::gotoSourceLocation, this, &QmlProfilerViewManager::gotoSourceLocation); connect(m_traceView, &QmlProfilerTraceView::typeSelected, @@ -96,7 +96,7 @@ QmlProfilerViewManager::QmlProfilerViewManager(QObject *parent, } perspective->addOperation({m_statisticsView->objectName().toLatin1(), m_statisticsView, anchorDockId, Perspective::AddToTab}); - perspective->addOperation({anchorDockId, 0, {}, Perspective::Raise}); + perspective->addOperation({anchorDockId, nullptr, {}, Perspective::Raise}); Debugger::registerPerspective(Constants::QmlProfilerPerspectiveId, perspective); }