summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-03-05 14:45:41 +0000
committerJose Fonseca <jfonseca@vmware.com>2016-03-05 16:58:20 +0000
commit010f9960823f44f0e5d5bc17d4f29a6e3b5aa162 (patch)
tree8ad5a43a6e34287944a3db76dcdcf6c4877ab730 /gui
parent41539b601ff78aeb01d9577514a8f90bab0cb821 (diff)
gui: clang-modernize.
Diffstat (limited to 'gui')
-rw-r--r--gui/androiddevicedialog.cpp16
-rw-r--r--gui/androiddevicedialog.h2
-rw-r--r--gui/androidfiledialog.cpp8
-rw-r--r--gui/androidfiledialog.h2
-rw-r--r--gui/androidretracer.h2
-rw-r--r--gui/apicalldelegate.h4
-rw-r--r--gui/apitracecall.cpp23
-rw-r--r--gui/apitracecall.h50
-rw-r--r--gui/apitracefilter.h2
-rw-r--r--gui/apitracemodel.h24
-rw-r--r--gui/argumentseditor.h2
-rw-r--r--gui/calldurationgraph.h16
-rw-r--r--gui/glsledit.cpp6
-rw-r--r--gui/glsledit.h6
-rw-r--r--gui/graphing/frameaxiswidget.h2
-rw-r--r--gui/graphing/graphaxiswidget.h6
-rw-r--r--gui/graphing/graphlabelwidget.h2
-rw-r--r--gui/graphing/graphview.h10
-rw-r--r--gui/graphing/graphwidget.h2
-rw-r--r--gui/graphing/heatmapverticalaxiswidget.h4
-rw-r--r--gui/graphing/heatmapview.h8
-rw-r--r--gui/graphing/histogramview.h12
-rw-r--r--gui/graphing/timeaxiswidget.h2
-rw-r--r--gui/imageviewer.h4
-rw-r--r--gui/jumpwidget.h4
-rw-r--r--gui/leaktracethread.h2
-rw-r--r--gui/mainwindow.h2
-rw-r--r--gui/pixelwidget.h20
-rw-r--r--gui/profiledialog.cpp12
-rw-r--r--gui/profileheatmap.h44
-rw-r--r--gui/profiletablemodel.cpp13
-rw-r--r--gui/profiletablemodel.h10
-rw-r--r--gui/retracer.cpp10
-rw-r--r--gui/retracer.h2
-rw-r--r--gui/saverthread.cpp28
-rw-r--r--gui/saverthread.h2
-rw-r--r--gui/searchwidget.h4
-rw-r--r--gui/settingsdialog.h2
-rw-r--r--gui/tracedialog.h2
39 files changed, 185 insertions, 187 deletions
diff --git a/gui/androiddevicedialog.cpp b/gui/androiddevicedialog.cpp
index 8c524fc2..63bd51ef 100644
--- a/gui/androiddevicedialog.cpp
+++ b/gui/androiddevicedialog.cpp
@@ -133,7 +133,7 @@ public:
return model;
}
- void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
{
QStyleOptionViewItemV4 opt = option;
initStyleOption(&opt, index);
@@ -211,7 +211,7 @@ public:
painter->restore();
}
- QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
{
QStyleOptionViewItemV4 opt = option;
initStyleOption(&opt, index);
@@ -232,12 +232,12 @@ class AndroidDeviceModel : public QAbstractItemModel
public:
AndroidDeviceModel();
QModelIndex index(int row, int column,
- const QModelIndex &parent = QModelIndex()) const;
- QModelIndex parent(const QModelIndex &child) const;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- int columnCount(const QModelIndex &parent = QModelIndex()) const;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- Qt::ItemFlags flags(const QModelIndex &index) const;
+ const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
AndroidDeviceInfo device(QModelIndex index);
void setDevices(const QVector<AndroidDeviceInfo> &devices);
diff --git a/gui/androiddevicedialog.h b/gui/androiddevicedialog.h
index 0b994c6a..fc774c28 100644
--- a/gui/androiddevicedialog.h
+++ b/gui/androiddevicedialog.h
@@ -47,7 +47,7 @@ public:
~AndroidDeviceDialog();
AndroidDeviceInfo device();
- void accept();
+ void accept() override;
bool saveDeviceSelection();
private slots:
diff --git a/gui/androidfiledialog.cpp b/gui/androidfiledialog.cpp
index e3c1479a..26be5889 100644
--- a/gui/androidfiledialog.cpp
+++ b/gui/androidfiledialog.cpp
@@ -67,7 +67,7 @@ public:
endResetModel();
}
- virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
+ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
{
if (!index.isValid() || index.row() >= m_fileList.size())
return QVariant();
@@ -113,7 +113,7 @@ public:
return ret;
}
virtual QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const {
+ int role = Qt::DisplayRole) const override {
if (orientation != Qt::Horizontal || role != Qt::DisplayRole)
return QVariant();
@@ -129,12 +129,12 @@ public:
return ret;
}
- virtual int columnCount(const QModelIndex &parent = QModelIndex()) const
+ virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override
{
return 2;
}
- virtual int rowCount(const QModelIndex &parent = QModelIndex()) const
+ virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override
{
if (parent.isValid())
return 0;
diff --git a/gui/androidfiledialog.h b/gui/androidfiledialog.h
index ac626ef0..fe15d436 100644
--- a/gui/androidfiledialog.h
+++ b/gui/androidfiledialog.h
@@ -30,7 +30,7 @@ public:
static QString getSaveFileName(QWidget *parent = 0, const QString &caption = QString(), const QString &path = QString(), const QString &filter = QString());
private slots:
- virtual void accept();
+ virtual void accept() override;
void upFolder();
void itemActivated(QModelIndex index);
void setDir(const QString &dir);
diff --git a/gui/androidretracer.h b/gui/androidretracer.h
index f2c758e5..53cbe816 100644
--- a/gui/androidretracer.h
+++ b/gui/androidretracer.h
@@ -18,7 +18,7 @@ signals:
void statusMessage(const QString &message);
protected:
- void run();
+ void run() override;
private slots:
bool setup(QString *error);
diff --git a/gui/apicalldelegate.h b/gui/apicalldelegate.h
index c4379586..3521eda1 100644
--- a/gui/apicalldelegate.h
+++ b/gui/apicalldelegate.h
@@ -10,9 +10,9 @@ public:
ApiCallDelegate(QWidget *parent = 0);
void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index) const;
+ const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option,
- const QModelIndex &index) const;
+ const QModelIndex &index) const override;
private:
QIcon m_stateEmblem;
diff --git a/gui/apitracecall.cpp b/gui/apitracecall.cpp
index 8ae03d0e..0f5f4bb9 100644
--- a/gui/apitracecall.cpp
+++ b/gui/apitracecall.cpp
@@ -57,8 +57,8 @@ plainTextToHTML(const QString & plain, bool multiLine, bool forceNoQuote = false
int col = 0;
bool quote = false;
QString rich;
- for (int i = 0; i < plain.length(); ++i) {
- if (plain[i] == QLatin1Char('\n')){
+ for (auto & ch : plain) {
+ if (ch == QLatin1Char('\n')){
if (multiLine) {
rich += QLatin1String("<br>\n");
} else {
@@ -67,7 +67,7 @@ plainTextToHTML(const QString & plain, bool multiLine, bool forceNoQuote = false
col = 0;
quote = true;
} else {
- if (plain[i] == QLatin1Char('\t')){
+ if (ch == QLatin1Char('\t')){
if (multiLine) {
rich += QChar(0x00a0U);
++col;
@@ -79,17 +79,17 @@ plainTextToHTML(const QString & plain, bool multiLine, bool forceNoQuote = false
rich += QLatin1String("\\t");
}
quote = true;
- } else if (plain[i].isSpace()) {
+ } else if (ch.isSpace()) {
rich += QChar(0x00a0U);
quote = true;
- } else if (plain[i] == QLatin1Char('<')) {
+ } else if (ch == QLatin1Char('<')) {
rich += QLatin1String("&lt;");
- } else if (plain[i] == QLatin1Char('>')) {
+ } else if (ch == QLatin1Char('>')) {
rich += QLatin1String("&gt;");
- } else if (plain[i] == QLatin1Char('&')) {
+ } else if (ch == QLatin1Char('&')) {
rich += QLatin1String("&amp;");
} else {
- rich += plain[i];
+ rich += ch;
}
++col;
}
@@ -423,9 +423,9 @@ void ApiArray::init(const trace::Array *arr)
return;
m_array.reserve(arr->values.size());
- for (int i = 0; i < arr->values.size(); ++i) {
+ for (auto & value : arr->values) {
VariantVisitor vis;
- arr->values[i]->visit(vis);
+ value->visit(vis);
m_array.append(vis.variant());
}
@@ -705,8 +705,7 @@ ApiTraceCall::loadData(TraceLoader *loader,
m_flags = call->flags;
if (call->backtrace != NULL) {
QString qbacktrace;
- for (int i = 0; i < call->backtrace->size(); i++) {
- const trace::StackFrame * frame = (*call->backtrace)[i];
+ for (auto frame : *call->backtrace) {
if (frame->module != NULL) {
qbacktrace += QString("%1 ").arg(frame->module);
}
diff --git a/gui/apitracecall.h b/gui/apitracecall.h
index 7ff03400..e4db6ae5 100644
--- a/gui/apitracecall.h
+++ b/gui/apitracecall.h
@@ -16,21 +16,21 @@ class TraceLoader;
class VariantVisitor : public trace::Visitor
{
public:
- virtual void visit(trace::Null *);
- virtual void visit(trace::Bool *node);
- virtual void visit(trace::SInt *node);
- virtual void visit(trace::UInt *node);
- virtual void visit(trace::Float *node);
- virtual void visit(trace::Double *node);
- virtual void visit(trace::String *node);
- virtual void visit(trace::WString *node);
- virtual void visit(trace::Enum *e);
- virtual void visit(trace::Bitmask *bitmask);
- virtual void visit(trace::Struct *str);
- virtual void visit(trace::Array *array);
- virtual void visit(trace::Blob *blob);
- virtual void visit(trace::Pointer *ptr);
- virtual void visit(trace::Repr *ptr);
+ virtual void visit(trace::Null *) override;
+ virtual void visit(trace::Bool *node) override;
+ virtual void visit(trace::SInt *node) override;
+ virtual void visit(trace::UInt *node) override;
+ virtual void visit(trace::Float *node) override;
+ virtual void visit(trace::Double *node) override;
+ virtual void visit(trace::String *node) override;
+ virtual void visit(trace::WString *node) override;
+ virtual void visit(trace::Enum *e) override;
+ virtual void visit(trace::Bitmask *bitmask) override;
+ virtual void visit(trace::Struct *str) override;
+ virtual void visit(trace::Array *array) override;
+ virtual void visit(trace::Blob *blob) override;
+ virtual void visit(trace::Pointer *ptr) override;
+ virtual void visit(trace::Repr *ptr) override;
QVariant variant() const
{
@@ -253,12 +253,12 @@ public:
ApiTraceFrame *parentFrame()const;
void setParentFrame(ApiTraceFrame *frame);
- int callIndex(ApiTraceCall *call) const;
+ int callIndex(ApiTraceCall *call) const override;
ApiTraceEvent *parentEvent() const;
ApiTraceCall *parentCall() const;
QVector<ApiTraceCall*> children() const;
- ApiTraceEvent *eventAtRow(int row) const;
+ ApiTraceEvent *eventAtRow(int row) const override;
void addChild(ApiTraceCall *call);
void finishedAddingChildren();
@@ -280,15 +280,15 @@ public:
QString toHtml() const;
QString searchText() const;
- QStaticText staticText() const;
- int numChildren() const;
+ QStaticText staticText() const override;
+ int numChildren() const override;
bool hasBinaryData() const;
int binaryDataIndex() const;
QString backtrace() const;
void setBacktrace(QString backtrace);
- void missingThumbnail();
+ void missingThumbnail() override;
private:
void loadData(TraceLoader *loader,
@@ -328,13 +328,13 @@ public:
ApiTrace *parentTrace() const;
void setNumChildren(int num);
- int numChildren() const;
+ int numChildren() const override;
int numChildrenToLoad() const;
int numTotalCalls() const;
- QStaticText staticText() const;
+ QStaticText staticText() const override;
- ApiTraceEvent *eventAtRow(int row) const;
- int callIndex(ApiTraceCall *call) const;
+ ApiTraceEvent *eventAtRow(int row) const override;
+ int callIndex(ApiTraceCall *call) const override;
ApiTraceCall *callWithIndex(int index) const;
QVector<ApiTraceCall*> calls() const;
void setCalls(const QVector<ApiTraceCall*> &topLevelCalls,
@@ -356,7 +356,7 @@ public:
void setLastCallIndex(unsigned index);
unsigned lastCallIndex() const;
- void missingThumbnail();
+ void missingThumbnail() override;
private:
ApiTrace *m_parentTrace;
diff --git a/gui/apitracefilter.h b/gui/apitracefilter.h
index b9cd75d5..250a2738 100644
--- a/gui/apitracefilter.h
+++ b/gui/apitracefilter.h
@@ -32,7 +32,7 @@ public:
QModelIndex indexForCall(ApiTraceCall *call) const;
protected:
- bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
+ bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
private:
QRegExp m_regexp;
diff --git a/gui/apitracemodel.h b/gui/apitracemodel.h
index 76876c20..36aaae70 100644
--- a/gui/apitracemodel.h
+++ b/gui/apitracemodel.h
@@ -30,23 +30,23 @@ public:
public:
/* QAbstractItemModel { */
- QVariant data(const QModelIndex &index, int role) const;
- Qt::ItemFlags flags(const QModelIndex &index) const;
+ QVariant data(const QModelIndex &index, int role) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const;
+ int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column,
- const QModelIndex &parent = QModelIndex()) const;
- bool hasChildren(const QModelIndex &parent) const;
- QModelIndex parent(const QModelIndex &index) const;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ const QModelIndex &parent = QModelIndex()) const override;
+ bool hasChildren(const QModelIndex &parent) const override;
+ QModelIndex parent(const QModelIndex &index) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
bool insertRows(int position, int rows,
- const QModelIndex &parent = QModelIndex());
+ const QModelIndex &parent = QModelIndex()) override;
bool removeRows(int position, int rows,
- const QModelIndex &parent = QModelIndex());
- virtual bool canFetchMore(const QModelIndex & parent) const;
- virtual void fetchMore(const QModelIndex &parent);
+ const QModelIndex &parent = QModelIndex()) override;
+ virtual bool canFetchMore(const QModelIndex & parent) const override;
+ virtual void fetchMore(const QModelIndex &parent) override;
/* } QAbstractItemModel; */
private slots:
diff --git a/gui/argumentseditor.h b/gui/argumentseditor.h
index 148b3ff6..1a949173 100644
--- a/gui/argumentseditor.h
+++ b/gui/argumentseditor.h
@@ -154,7 +154,7 @@ public:
~ArgumentsEditor();
- virtual void accept();
+ virtual void accept() override;
void setCall(ApiTraceCall *call);
ApiTraceCall *call() const;
diff --git a/gui/calldurationgraph.h b/gui/calldurationgraph.h
index be6fe45e..7a314554 100644
--- a/gui/calldurationgraph.h
+++ b/gui/calldurationgraph.h
@@ -27,7 +27,7 @@ public:
protected:
/* Transform from time-based horizontal selection to call no based. */
- virtual SelectionState transformSelectionIn(SelectionState state)
+ virtual SelectionState transformSelectionIn(SelectionState state) override
{
if (!m_profile || state.type != SelectionState::Horizontal) {
return state;
@@ -59,7 +59,7 @@ protected:
return state;
}
- virtual SelectionState transformSelectionOut(SelectionState state)
+ virtual SelectionState transformSelectionOut(SelectionState state) override
{
if (!m_profile || state.type != SelectionState::Horizontal) {
return state;
@@ -89,12 +89,12 @@ public:
{
}
- virtual qint64 size() const
+ virtual qint64 size() const override
{
return m_profile ? m_profile->calls.size() : 0;
}
- virtual bool selected(qint64 index) const
+ virtual bool selected(qint64 index) const override
{
if (m_selectionState) {
if (m_selectionState->type == SelectionState::Horizontal) {
@@ -109,12 +109,12 @@ public:
return false;
}
- virtual void setSelectionState(SelectionState* state)
+ virtual void setSelectionState(SelectionState* state) override
{
m_selectionState = state;
}
- virtual qint64 value(qint64 index) const
+ virtual qint64 value(qint64 index) const override
{
if (m_gpu) {
return m_profile->calls[index].gpuDuration;
@@ -123,7 +123,7 @@ public:
}
}
- virtual void itemDoubleClicked(qint64 index) const
+ virtual void itemDoubleClicked(qint64 index) const override
{
if (!m_profile) {
return;
@@ -137,7 +137,7 @@ public:
Profiling::jumpToCall(call.no);
}
- virtual QString itemTooltip(qint64 index) const
+ virtual QString itemTooltip(qint64 index) const override
{
if (!m_profile) {
return QString();
diff --git a/gui/glsledit.cpp b/gui/glsledit.cpp
index 8cd7f022..79f4a16b 100644
--- a/gui/glsledit.cpp
+++ b/gui/glsledit.cpp
@@ -45,7 +45,7 @@ public:
void mark(const QString &str, Qt::CaseSensitivity caseSensitivity);
protected:
- void highlightBlock(const QString &text);
+ void highlightBlock(const QString &text) override;
private:
QSet<QString> m_keywords;
@@ -400,8 +400,8 @@ public:
QPixmap rightArrowIcon;
QPixmap downArrowIcon;
protected:
- void mousePressEvent(QMouseEvent *event);
- void paintEvent(QPaintEvent *event);
+ void mousePressEvent(QMouseEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
};
SidebarWidget::SidebarWidget(GLSLEdit *editor)
diff --git a/gui/glsledit.h b/gui/glsledit.h
index 1fc452a1..584f2282 100644
--- a/gui/glsledit.h
+++ b/gui/glsledit.h
@@ -92,9 +92,9 @@ public slots:
void indent();
protected:
- virtual void resizeEvent(QResizeEvent *e);
- virtual void wheelEvent(QWheelEvent *e);
- virtual void contextMenuEvent(QContextMenuEvent *e);
+ virtual void resizeEvent(QResizeEvent *e) override;
+ virtual void wheelEvent(QWheelEvent *e) override;
+ virtual void contextMenuEvent(QContextMenuEvent *e) override;
private slots:
diff --git a/gui/graphing/frameaxiswidget.h b/gui/graphing/frameaxiswidget.h
index 4b2c4cbb..ed42b652 100644
--- a/gui/graphing/frameaxiswidget.h
+++ b/gui/graphing/frameaxiswidget.h
@@ -24,7 +24,7 @@ public:
void setDataProvider(FrameDataProvider* data);
- virtual void paintEvent(QPaintEvent *e);
+ virtual void paintEvent(QPaintEvent *e) override;
protected:
FrameDataProvider* m_data;
diff --git a/gui/graphing/graphaxiswidget.h b/gui/graphing/graphaxiswidget.h
index a8d1c01a..5e5f85cd 100644
--- a/gui/graphing/graphaxiswidget.h
+++ b/gui/graphing/graphaxiswidget.h
@@ -35,9 +35,9 @@ public:
void setOrientation(Orientation v);
- virtual void mouseMoveEvent(QMouseEvent *e);
- virtual void mousePressEvent(QMouseEvent *e);
- virtual void mouseReleaseEvent(QMouseEvent *e);
+ virtual void mouseMoveEvent(QMouseEvent *e) override;
+ virtual void mousePressEvent(QMouseEvent *e) override;
+ virtual void mouseReleaseEvent(QMouseEvent *e) override;
public slots:
/* The minimum and maximum values of this axis */
diff --git a/gui/graphing/graphlabelwidget.h b/gui/graphing/graphlabelwidget.h
index 050dc40d..00783557 100644
--- a/gui/graphing/graphlabelwidget.h
+++ b/gui/graphing/graphlabelwidget.h
@@ -25,7 +25,7 @@ public:
m_flags = flags;
}
- virtual void paintEvent(QPaintEvent *)
+ virtual void paintEvent(QPaintEvent *) override
{
QPainter painter(this);
painter.setPen(Qt::black);
diff --git a/gui/graphing/graphview.h b/gui/graphing/graphview.h
index 94328b69..03848bf9 100644
--- a/gui/graphing/graphview.h
+++ b/gui/graphing/graphview.h
@@ -20,12 +20,12 @@ public:
virtual void update();
- virtual void resizeEvent(QResizeEvent *);
+ virtual void resizeEvent(QResizeEvent *) override;
- virtual void wheelEvent(QWheelEvent *e);
- virtual void mouseMoveEvent(QMouseEvent *e);
- virtual void mousePressEvent(QMouseEvent *e);
- virtual void mouseDoubleClickEvent(QMouseEvent *e);
+ virtual void wheelEvent(QWheelEvent *e) override;
+ virtual void mouseMoveEvent(QMouseEvent *e) override;
+ virtual void mousePressEvent(QMouseEvent *e) override;
+ virtual void mouseDoubleClickEvent(QMouseEvent *e) override;
virtual void setSelectionState(SelectionState* state);
diff --git a/gui/graphing/graphwidget.h b/gui/graphing/graphwidget.h
index 17cb4651..9d3c7d6d 100644
--- a/gui/graphing/graphwidget.h
+++ b/gui/graphing/graphwidget.h
@@ -35,7 +35,7 @@ public:
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy policy);
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy policy);
- virtual void resizeEvent(QResizeEvent *e);
+ virtual void resizeEvent(QResizeEvent *e) override;
protected:
/* Used if a selection would be shared between graphs with different axis */
diff --git a/gui/graphing/heatmapverticalaxiswidget.h b/gui/graphing/heatmapverticalaxiswidget.h
index 9a21c25b..5e42574b 100644
--- a/gui/graphing/heatmapverticalaxiswidget.h
+++ b/gui/graphing/heatmapverticalaxiswidget.h
@@ -12,8 +12,8 @@ public:
void setDataProvider(HeatmapDataProvider* data);
- virtual void mouseDoubleClickEvent(QMouseEvent *e);
- virtual void paintEvent(QPaintEvent *);
+ virtual void mouseDoubleClickEvent(QMouseEvent *e) override;
+ virtual void paintEvent(QPaintEvent *) override;
protected:
int m_rowHeight;
diff --git a/gui/graphing/heatmapview.h b/gui/graphing/heatmapview.h
index 86d8848d..350fd8bb 100644
--- a/gui/graphing/heatmapview.h
+++ b/gui/graphing/heatmapview.h
@@ -103,12 +103,12 @@ public:
HeatmapView(QWidget* parent);
void setDataProvider(HeatmapDataProvider* data);
- void setSelectionState(SelectionState* state);
+ void setSelectionState(SelectionState* state) override;
- virtual void mouseMoveEvent(QMouseEvent *e);
- virtual void mouseDoubleClickEvent(QMouseEvent *e);
+ virtual void mouseMoveEvent(QMouseEvent *e) override;
+ virtual void mouseDoubleClickEvent(QMouseEvent *e) override;
- virtual void paintEvent(QPaintEvent *e);
+ virtual void paintEvent(QPaintEvent *e) override;
virtual void paintRow(QPainter& painter, HeatmapRowIterator* itr);
diff --git a/gui/graphing/histogramview.h b/gui/graphing/histogramview.h
index ae89f7b1..14c9740e 100644
--- a/gui/graphing/histogramview.h
+++ b/gui/graphing/histogramview.h
@@ -13,18 +13,18 @@ public:
HistogramView(QWidget* parent);
void setDataProvider(GraphDataProvider* data);
- void setSelectionState(SelectionState* state);
+ void setSelectionState(SelectionState* state) override;
/* Gradient colours for selected and unselected items */
void setSelectedGradient(const QLinearGradient& gradient);
void setUnelectedGradient(const QLinearGradient& gradient);
- virtual void mouseMoveEvent(QMouseEvent *e);
- virtual void mouseDoubleClickEvent(QMouseEvent *e);
+ virtual void mouseMoveEvent(QMouseEvent *e) override;
+ virtual void mouseDoubleClickEvent(QMouseEvent *e) override;
- virtual void update();
- virtual void resizeEvent(QResizeEvent *e);
- virtual void paintEvent(QPaintEvent *e);
+ virtual void update() override;
+ virtual void resizeEvent(QResizeEvent *e) override;
+ virtual void paintEvent(QPaintEvent *e) override;
protected:
qint64 itemAtPosition(QPoint pos);
diff --git a/gui/graphing/timeaxiswidget.h b/gui/graphing/timeaxiswidget.h
index 7f79a399..a0d58cb6 100644
--- a/gui/graphing/timeaxiswidget.h
+++ b/gui/graphing/timeaxiswidget.h
@@ -9,5 +9,5 @@ class TimeAxisWidget : public GraphAxisWidget {
public:
TimeAxisWidget(QWidget* parent = 0);
- virtual void paintEvent(QPaintEvent *e);
+ virtual void paintEvent(QPaintEvent *e) override;
};
diff --git a/gui/imageviewer.h b/gui/imageviewer.h
index 7cb2eb52..d5d83a43 100644
--- a/gui/imageviewer.h
+++ b/gui/imageviewer.h
@@ -19,10 +19,10 @@ public:
void setData(const QByteArray &data);
- QSize sizeHint() const;
+ QSize sizeHint() const override;
protected:
- void resizeEvent(QResizeEvent *event);
+ void resizeEvent(QResizeEvent *event) override;
private slots:
void slotUpdate();
diff --git a/gui/jumpwidget.h b/gui/jumpwidget.h
index 8fec83f4..183a8954 100644
--- a/gui/jumpwidget.h
+++ b/gui/jumpwidget.h
@@ -20,8 +20,8 @@ private slots:
void slotCancel();
protected:
- virtual bool eventFilter(QObject *object, QEvent* event);
- virtual void showEvent(QShowEvent *event);
+ virtual bool eventFilter(QObject *object, QEvent* event) override;
+ virtual void showEvent(QShowEvent *event) override;
private:
Ui_JumpWidget m_ui;
diff --git a/gui/leaktracethread.h b/gui/leaktracethread.h
index cbc16ea0..cb21290b 100644
--- a/gui/leaktracethread.h
+++ b/gui/leaktracethread.h
@@ -23,7 +23,7 @@ class LeakTraceThread: public QThread{
protected:
- virtual void run();
+ virtual void run() override;
private:
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 8740ab76..0378d2c0 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -135,7 +135,7 @@ private:
void addSurfaces(const QList<Surface> &images, const char *label);
protected:
- virtual void closeEvent(QCloseEvent * event);
+ virtual void closeEvent(QCloseEvent * event) override;
private:
Ui_MainWindow m_ui;
diff --git a/gui/pixelwidget.h b/gui/pixelwidget.h
index 6d92a84e..f2ee3ae3 100644
--- a/gui/pixelwidget.h
+++ b/gui/pixelwidget.h
@@ -66,17 +66,17 @@ signals:
void gridGeometry(const QRect &rect);
public:
- void timerEvent(QTimerEvent *event);
- void paintEvent(QPaintEvent *event);
- void keyPressEvent(QKeyEvent *event);
- void keyReleaseEvent(QKeyEvent *event);
- void resizeEvent(QResizeEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- void mousePressEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- void contextMenuEvent(QContextMenuEvent *event);
+ void timerEvent(QTimerEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void keyReleaseEvent(QKeyEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void contextMenuEvent(QContextMenuEvent *event) override;
- QSize sizeHint() const;
+ QSize sizeHint() const override;
public slots:
void setZoom(int zoom);
diff --git a/gui/profiledialog.cpp b/gui/profiledialog.cpp
index 9d80d3f3..4f16c58d 100644
--- a/gui/profiledialog.cpp
+++ b/gui/profiledialog.cpp
@@ -26,15 +26,15 @@ public:
m_profile = profile;
}
- unsigned size() const {
+ unsigned size() const override {
return m_profile->frames.size();
}
- qint64 frameStart(unsigned index) const {
+ qint64 frameStart(unsigned index) const override {
return m_profile->frames[index].calls.begin;
}
- qint64 frameEnd(unsigned index) const {
+ qint64 frameEnd(unsigned index) const override {
return m_profile->frames[index].calls.end;
}
@@ -50,15 +50,15 @@ public:
m_profile = profile;
}
- unsigned size() const {
+ unsigned size() const override {
return m_profile->frames.size();
}
- qint64 frameStart(unsigned index) const {
+ qint64 frameStart(unsigned index) const override {
return m_profile->frames[index].cpuStart;
}
- qint64 frameEnd(unsigned index) const {
+ qint64 frameEnd(unsigned index) const override {
return m_profile->frames[index].cpuStart + m_profile->frames[index].cpuDuration;
}
diff --git a/gui/profileheatmap.h b/gui/profileheatmap.h
index 548917bd..e4c47350 100644
--- a/gui/profileheatmap.h
+++ b/gui/profileheatmap.h
@@ -26,7 +26,7 @@ public:
m_timeWidth = m_timeEnd - m_timeStart;
}
- virtual bool next()
+ virtual bool next() override
{
unsigned maxIndex = m_program == -1 ? m_profile->calls.size() : m_profile->programs[m_program].calls.size();
@@ -150,32 +150,32 @@ public:
return true;
}
- virtual bool isGpu() const
+ virtual bool isGpu() const override
{
return m_useGpu;
}
- virtual float heat() const
+ virtual float heat() const override
{
return m_heat;
}
- virtual float selectedHeat() const
+ virtual float selectedHeat() const override
{
return m_programHeat;
}
- virtual int step() const
+ virtual int step() const override
{
return m_step;
}
- virtual int width() const
+ virtual int width() const override
{
return m_stepWidth;
}
- virtual QString label() const
+ virtual QString label() const override
{
return m_label;
}
@@ -260,22 +260,22 @@ public:
sortRows();
}
- virtual qint64 start() const
+ virtual qint64 start() const override
{
return m_profile->frames.front().cpuStart;
}
- virtual qint64 end() const
+ virtual qint64 end() const override
{
return m_profile->frames.back().cpuStart + m_profile->frames.back().cpuDuration;
}
- virtual unsigned dataRows() const
+ virtual unsigned dataRows() const override
{
return m_rowPrograms.size();
}
- virtual QString dataLabel(unsigned row) const
+ virtual QString dataLabel(unsigned row) const override
{
if (row >= m_rowPrograms.size()) {
return QString();
@@ -284,7 +284,7 @@ public:
}
}
- virtual qint64 dataRowAt(unsigned row) const
+ virtual qint64 dataRowAt(unsigned row) const override
{
if (row >= m_rowPrograms.size()) {
return 0;
@@ -293,7 +293,7 @@ public:
}
}
- virtual HeatmapRowIterator* dataRowIterator(int row, qint64 start, qint64 end, int steps) const
+ virtual HeatmapRowIterator* dataRowIterator(int row, qint64 start, qint64 end, int steps) const override
{
ProfileHeatmapRowIterator* itr = new ProfileHeatmapRowIterator(m_profile, start, end, steps, true, m_rowPrograms[row]);
@@ -308,17 +308,17 @@ public:
return itr;
}
- virtual unsigned headerRows() const
+ virtual unsigned headerRows() const override
{
return 2;
}
- virtual qint64 headerRowAt(unsigned row) const
+ virtual qint64 headerRowAt(unsigned row) const override
{
return row;
}
- virtual QString headerLabel(unsigned row) const
+ virtual QString headerLabel(unsigned row) const override
{
if (row == 0) {
return "CPU";
@@ -329,7 +329,7 @@ public:
}
}
- virtual HeatmapRowIterator* headerRowIterator(int row, qint64 start, qint64 end, int steps) const
+ virtual HeatmapRowIterator* headerRowIterator(int row, qint64 start, qint64 end, int steps) const override
{
ProfileHeatmapRowIterator* itr = new ProfileHeatmapRowIterator(m_profile, start, end, steps, row != 0);
@@ -344,7 +344,7 @@ public:
return itr;
}
- virtual qint64 dataItemAt(unsigned row, qint64 time) const
+ virtual qint64 dataItemAt(unsigned row, qint64 time) const override
{
if (row >= m_rowPrograms.size()) {
return -1;
@@ -363,7 +363,7 @@ public:
return *item;
}
- virtual qint64 headerItemAt(unsigned row, qint64 time) const
+ virtual qint64 headerItemAt(unsigned row, qint64 time) const override
{
if (row >= m_rowPrograms.size()) {
return -1;
@@ -394,7 +394,7 @@ public:
return -1;
}
- virtual void itemDoubleClicked(qint64 index) const
+ virtual void itemDoubleClicked(qint64 index) const override
{
if (index < 0 || index >= m_profile->calls.size()) {
return;
@@ -404,7 +404,7 @@ public:
Profiling::jumpToCall(call.no);
}
- virtual QString itemTooltip(qint64 index) const
+ virtual QString itemTooltip(qint64 index) const override
{
if (index >= m_profile->calls.size()) {
return QString();
@@ -428,7 +428,7 @@ public:
return text;
}
- virtual void setSelectionState(SelectionState* state)
+ virtual void setSelectionState(SelectionState* state) override
{
m_selectionState = state;
}
diff --git a/gui/profiletablemodel.cpp b/gui/profiletablemodel.cpp
index 11a0d0c1..0ca1b594 100644
--- a/gui/profiletablemodel.cpp
+++ b/gui/profiletablemodel.cpp
@@ -93,8 +93,7 @@ void ProfileTableModel::updateModel()
m_timeMax = m_profile->frames.back().cpuStart + m_profile->frames.back().cpuDuration;
}
- for (QList<ProfileTableRow>::iterator itr = m_rowData.begin(); itr != m_rowData.end(); ++itr) {
- ProfileTableRow& row = *itr;
+ for (auto & row : m_rowData) {
row.uses = 0;
row.pixels = 0;
@@ -109,8 +108,8 @@ void ProfileTableModel::updateModel()
ProfileTableRow* row = NULL;
const Program& program = *itr;
- for (std::vector<unsigned>::const_iterator jtr = program.calls.begin(); jtr != program.calls.end(); ++jtr) {
- const Call& call = m_profile->calls[*jtr];
+ for (const auto & callNo : program.calls) {
+ const Call& call = m_profile->calls[callNo];
if (call.cpuStart > m_timeMax) {
break;
@@ -195,9 +194,9 @@ int ProfileTableModel::getRowIndex(unsigned program) const
* Get the row data for a shader program
*/
ProfileTableRow* ProfileTableModel::getRow(unsigned program) {
- for (QList<ProfileTableRow>::iterator itr = m_rowData.begin(); itr != m_rowData.end(); ++itr) {
- if (itr->program == program)
- return &*itr;
+ for (auto & row : m_rowData) {
+ if (row.program == program)
+ return &row;
}
m_rowData.append(ProfileTableRow(program));
diff --git a/gui/profiletablemodel.h b/gui/profiletablemodel.h
index e2288b42..c062982b 100644
--- a/gui/profiletablemodel.h
+++ b/gui/profiletablemodel.h
@@ -45,13 +45,13 @@ public:
unsigned getProgram(const QModelIndex & index) const;
const trace::Profile::Call* getJumpCall(const QModelIndex & index) const;
- virtual int rowCount(const QModelIndex & parent) const;
- virtual int columnCount(const QModelIndex & parent) const;
+ virtual int rowCount(const QModelIndex & parent) const override;
+ virtual int columnCount(const QModelIndex & parent) const override;
- virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+ virtual QVariant data(const QModelIndex &index, int role) const override;
+ virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
- virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
+ virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
private:
void updateModel();
diff --git a/gui/retracer.cpp b/gui/retracer.cpp
index 02f01454..8e8543c6 100644
--- a/gui/retracer.cpp
+++ b/gui/retracer.cpp
@@ -40,13 +40,13 @@ class BlockingIODevice : public QIODevice
* system. */
public:
BlockingIODevice(QProcess * io);
- bool isSequential() const;
- bool atEnd() const;
- bool waitForReadyRead(int msecs = -1);
+ bool isSequential() const override;
+ bool atEnd() const override;
+ bool waitForReadyRead(int msecs = -1) override;
protected:
- qint64 readData(char * data, qint64 maxSize);
- qint64 writeData(const char * data, qint64 maxSize);
+ qint64 readData(char * data, qint64 maxSize) override;
+ qint64 writeData(const char * data, qint64 maxSize) override;
private:
QProcess *m_device;
diff --git a/gui/retracer.h b/gui/retracer.h
index bd395e2c..08fb7a8a 100644
--- a/gui/retracer.h
+++ b/gui/retracer.h
@@ -68,7 +68,7 @@ signals:
void retraceErrors(const QList<ApiTraceError> &errors);
protected:
- virtual void run();
+ virtual void run() override;
private:
QString m_fileName;
diff --git a/gui/saverthread.cpp b/gui/saverthread.cpp
index e9e5a3fa..879ce90a 100644
--- a/gui/saverthread.cpp
+++ b/gui/saverthread.cpp
@@ -210,41 +210,41 @@ public:
: m_variant(variant),
m_editedValue(0)
{}
- virtual void visit(trace::Null *val)
+ virtual void visit(trace::Null *val) override
{
m_editedValue = val;
}
- virtual void visit(trace::Bool *node)
+ virtual void visit(trace::Bool *node) override
{
// Q_ASSERT(m_variant.userType() == QVariant::Bool);
bool var = m_variant.toBool();
m_editedValue = new trace::Bool(var);
}
- virtual void visit(trace::SInt *node)
+ virtual void visit(trace::SInt *node) override
{
// Q_ASSERT(m_variant.userType() == QVariant::Int);
m_editedValue = new trace::SInt(m_variant.toInt());
}
- virtual void visit(trace::UInt *node)
+ virtual void visit(trace::UInt *node) override
{
// Q_ASSERT(m_variant.userType() == QVariant::UInt);
m_editedValue = new trace::SInt(m_variant.toUInt());
}
- virtual void visit(trace::Float *node)
+ virtual void visit(trace::Float *node) override
{
m_editedValue = new trace::Float(m_variant.toFloat());
}
- virtual void visit(trace::Double *node)
+ virtual void visit(trace::Double *node) override
{
m_editedValue = new trace::Double(m_variant.toDouble());
}
- virtual void visit(trace::String *node)
+ virtual void visit(trace::String *node) override
{
QString str = m_variant.toString();
char *newString = new char[str.length() + 1];
@@ -253,7 +253,7 @@ public:
m_editedValue = new trace::String(newString);
}
- virtual void visit(trace::WString *node)
+ virtual void visit(trace::WString *node) override
{
QString str = m_variant.toString();
size_t len = str.length();
@@ -263,22 +263,22 @@ public:
m_editedValue = new trace::WString(newString);
}
- virtual void visit(trace::Enum *e)
+ virtual void visit(trace::Enum *e) override
{
m_editedValue = e;
}
- virtual void visit(trace::Bitmask *bitmask)
+ virtual void visit(trace::Bitmask *bitmask) override
{
m_editedValue = bitmask;
}
- virtual void visit(trace::Struct *str)
+ virtual void visit(trace::Struct *str) override
{
m_editedValue = str;
}
- virtual void visit(trace::Array *array)
+ virtual void visit(trace::Array *array) override
{
ApiArray apiArray = m_variant.value<ApiArray>();
QVector<QVariant> vals = apiArray.values();
@@ -299,12 +299,12 @@ public:
m_editedValue = newArray;
}
- virtual void visit(trace::Blob *blob)
+ virtual void visit(trace::Blob *blob) override
{
m_editedValue = blob;
}
- virtual void visit(trace::Pointer *ptr)
+ virtual void visit(trace::Pointer *ptr) override
{
m_editedValue = ptr;
}
diff --git a/gui/saverthread.h b/gui/saverthread.h
index f53296e1..f104996d 100644
--- a/gui/saverthread.h
+++ b/gui/saverthread.h
@@ -23,7 +23,7 @@ signals:
void traceSaved();
protected:
- virtual void run();
+ virtual void run() override;
private:
QString m_readFileName;
diff --git a/gui/searchwidget.h b/gui/searchwidget.h
index 6415ef28..58f4e9d8 100644
--- a/gui/searchwidget.h
+++ b/gui/searchwidget.h
@@ -24,8 +24,8 @@ private slots:
void slotCancel();
protected:
- virtual bool eventFilter(QObject *object, QEvent* event);
- virtual void showEvent(QShowEvent *event);
+ virtual bool eventFilter(QObject *object, QEvent* event) override;
+ virtual void showEvent(QShowEvent *event) override;
private:
Qt::CaseSensitivity caseSensitivity() const;
diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h
index aa2db34f..3aeecbbd 100644
--- a/gui/settingsdialog.h
+++ b/gui/settingsdialog.h
@@ -12,7 +12,7 @@ class SettingsDialog : public QDialog, public Ui_Settings
Q_OBJECT
public:
SettingsDialog(QWidget *parent = 0);
- void accept();
+ void accept() override;
void setFilterModel(ApiTraceFilter *filter);
diff --git a/gui/tracedialog.h b/gui/tracedialog.h
index cf45833d..a71e28a5 100644
--- a/gui/tracedialog.h
+++ b/gui/tracedialog.h
@@ -9,7 +9,7 @@ class TraceDialog : public QDialog, public Ui_TraceDialog
public:
TraceDialog(QWidget *parent = 0);
- void accept();
+ void accept() override;
QString api() const;
QString applicationPath() const;