summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2018-11-12 13:44:26 +0100
committerMontel Laurent <[email protected]>2018-11-12 13:44:26 +0100
commit6d9a76449b95aae4e153a94ca57fa414fbe7a577 (patch)
tree170f11f08b6a294c6821b3018ec6185186e85a95
parent2551eeeb579ba09969614da39f45491858dc181c (diff)
USe override. Add missing explicit
-rw-r--r--gui/HostConnector.cpp2
-rw-r--r--gui/HostConnector.h2
-rw-r--r--gui/SensorBrowser.h26
-rw-r--r--gui/SensorDisplayLib/BarGraph.h4
-rw-r--r--gui/SensorDisplayLib/DancingBars.h16
-rw-r--r--gui/SensorDisplayLib/DummyDisplay.h4
-rw-r--r--gui/SensorDisplayLib/FancyPlotter.cpp4
-rw-r--r--gui/SensorDisplayLib/FancyPlotter.h26
-rw-r--r--gui/SensorDisplayLib/ListView.h28
-rw-r--r--gui/SensorDisplayLib/LogFile.h22
-rw-r--r--gui/SensorDisplayLib/MultiMeter.h18
-rw-r--r--gui/SensorDisplayLib/MultiMeterSettings.cpp14
-rw-r--r--gui/SensorDisplayLib/MultiMeterSettings.h14
-rw-r--r--gui/SensorDisplayLib/ProcessController.h18
-rw-r--r--gui/SensorDisplayLib/SensorDisplay.h8
-rw-r--r--gui/SensorDisplayLib/SensorLogger.cpp8
-rw-r--r--gui/SensorDisplayLib/SensorLogger.h24
-rw-r--r--gui/SensorDisplayLib/SensorLoggerSettings.cpp4
-rw-r--r--gui/SensorDisplayLib/SensorLoggerSettings.h4
-rw-r--r--gui/SensorDisplayLib/SensorModel.h8
-rw-r--r--gui/WorkSheet.h14
-rw-r--r--gui/ksortfilterproxymodel.cpp3
-rw-r--r--gui/ksortfilterproxymodel.h4
-rw-r--r--gui/ksysguard.h14
24 files changed, 144 insertions, 145 deletions
diff --git a/gui/HostConnector.cpp b/gui/HostConnector.cpp
index 367d6d5..7da28e1 100644
--- a/gui/HostConnector.cpp
+++ b/gui/HostConnector.cpp
@@ -37,7 +37,7 @@
#include "HostConnector.h"
-HostConnector::HostConnector( QWidget *parent, const char *name )
+HostConnector::HostConnector(QWidget *parent, const QString &name )
: QDialog( parent )
{
setObjectName( name );
diff --git a/gui/HostConnector.h b/gui/HostConnector.h
index 637815f..1777788 100644
--- a/gui/HostConnector.h
+++ b/gui/HostConnector.h
@@ -37,7 +37,7 @@ class HostConnector : public QDialog
Q_OBJECT
public:
- explicit HostConnector( QWidget *parent, const char *name = nullptr );
+ explicit HostConnector( QWidget *parent, const QString &name = {} );
~HostConnector();
void setHostNames( const QStringList &list );
diff --git a/gui/SensorBrowser.h b/gui/SensorBrowser.h
index 586846f..e54d3a2 100644
--- a/gui/SensorBrowser.h
+++ b/gui/SensorBrowser.h
@@ -45,13 +45,13 @@ class SensorBrowserModel : public QAbstractItemModel, private KSGRD::SensorClien
Q_OBJECT
public:
SensorBrowserModel();
- ~SensorBrowserModel() Q_DECL_OVERRIDE;
- int columnCount( const QModelIndex &) const Q_DECL_OVERRIDE;
- QVariant data( const QModelIndex & parent, int role) const Q_DECL_OVERRIDE;
- QVariant headerData ( int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
- QModelIndex index ( int row, int column, const QModelIndex & parent) const Q_DECL_OVERRIDE;
- QModelIndex parent ( const QModelIndex & index ) const Q_DECL_OVERRIDE;
- int rowCount ( const QModelIndex & parent = QModelIndex() ) const Q_DECL_OVERRIDE;
+ ~SensorBrowserModel() override;
+ int columnCount( const QModelIndex &) const override;
+ QVariant data( const QModelIndex & parent, int role) const override;
+ QVariant headerData ( int section, Qt::Orientation orientation, int role) const override;
+ QModelIndex index ( int row, int column, const QModelIndex & parent) const override;
+ QModelIndex parent ( const QModelIndex & index ) const override;
+ int rowCount ( const QModelIndex & parent = QModelIndex() ) const override;
QStringList listSensors( const QString &hostName ) const; ///Returns a list of sensors names. E.g. (cpu/0, mem/free, mem/cache, etc)
@@ -68,8 +68,8 @@ class SensorBrowserModel : public QAbstractItemModel, private KSGRD::SensorClien
void disconnectHost(uint id);
void disconnectHost(const HostInfo *hostInfo);
void disconnectHost(const QString &hostname);
- Qt::ItemFlags flags ( const QModelIndex & index ) const Q_DECL_OVERRIDE;
- QMimeData * mimeData ( const QModelIndexList & indexes ) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags ( const QModelIndex & index ) const override;
+ QMimeData * mimeData ( const QModelIndexList & indexes ) const override;
void retranslate(); /// Retranslate the model
Q_SIGNALS:
void sensorsAddedToHost(const QModelIndex &index );
@@ -85,7 +85,7 @@ class SensorBrowserModel : public QAbstractItemModel, private KSGRD::SensorClien
void hostRemoved(const QString &hostName);
private:
- void answerReceived( int id, const QList<QByteArray>& ) Q_DECL_OVERRIDE;
+ void answerReceived( int id, const QList<QByteArray>& ) override;
void removeEmptyParentTreeBranches(int hostId, int id, int parentid);
HostInfo* findHostInfoByHostName(const QString &hostName) const;
void removeAllSensorUnderBranch(HostInfo* hostInfo, int parentId);
@@ -105,7 +105,7 @@ class SensorBrowserTreeWidget : public QTreeView
public:
SensorBrowserTreeWidget( QWidget* parent, KSGRD::SensorManager* sm );
- ~SensorBrowserTreeWidget();
+ ~SensorBrowserTreeWidget() override;
QStringList listHosts() const
{ return mSensorBrowserModel.listHosts(); }
@@ -122,7 +122,7 @@ class SensorBrowserTreeWidget : public QTreeView
void updateView();
private:
void retranslateUi();
- void changeEvent( QEvent * event ) Q_DECL_OVERRIDE;
+ void changeEvent( QEvent * event ) override;
KSGRD::SensorManager* mSensorManager;
@@ -139,7 +139,7 @@ class SensorBrowserWidget : public QWidget
{
Q_OBJECT
public:
- SensorBrowserWidget( QWidget* parent, KSGRD::SensorManager* sm );
+ explicit SensorBrowserWidget( QWidget* parent, KSGRD::SensorManager* sm );
~SensorBrowserWidget();
QStringList listHosts() const
{ return m_treeWidget->listHosts(); }
diff --git a/gui/SensorDisplayLib/BarGraph.h b/gui/SensorDisplayLib/BarGraph.h
index aa205eb..f216c16 100644
--- a/gui/SensorDisplayLib/BarGraph.h
+++ b/gui/SensorDisplayLib/BarGraph.h
@@ -34,7 +34,7 @@ class BarGraph : public QWidget
public:
explicit BarGraph( QWidget *parent );
- ~BarGraph() Q_DECL_OVERRIDE;
+ ~BarGraph() override;
bool addBar( const QString &footer );
bool removeBar( uint idx );
@@ -70,7 +70,7 @@ class BarGraph : public QWidget
void changeRange( double min, double max );
protected:
- void paintEvent( QPaintEvent* ) Q_DECL_OVERRIDE;
+ void paintEvent( QPaintEvent* ) override;
private:
double minValue;
diff --git a/gui/SensorDisplayLib/DancingBars.h b/gui/SensorDisplayLib/DancingBars.h
index 4ae06a4..6762834 100644
--- a/gui/SensorDisplayLib/DancingBars.h
+++ b/gui/SensorDisplayLib/DancingBars.h
@@ -40,23 +40,23 @@ class DancingBars : public KSGRD::SensorDisplay
DancingBars( QWidget *parent, const QString &title, SharedSettings *workSheetSettings );
virtual ~DancingBars();
- void configureSettings() Q_DECL_OVERRIDE;
+ void configureSettings() override;
bool addSensor( const QString &hostName, const QString &name,
- const QString &type, const QString &title ) Q_DECL_OVERRIDE;
- bool removeSensor( uint pos ) Q_DECL_OVERRIDE;
+ const QString &type, const QString &title ) override;
+ bool removeSensor( uint pos ) override;
void updateSamples( const QVector<double> &samples );
- void answerReceived( int id, const QList<QByteArray> &answerlist ) Q_DECL_OVERRIDE;
+ void answerReceived( int id, const QList<QByteArray> &answerlist ) override;
- bool restoreSettings( QDomElement& ) Q_DECL_OVERRIDE;
- bool saveSettings( QDomDocument&, QDomElement& ) Q_DECL_OVERRIDE;
+ bool restoreSettings( QDomElement& ) override;
+ bool saveSettings( QDomDocument&, QDomElement& ) override;
- bool hasSettingsDialog() const Q_DECL_OVERRIDE;
+ bool hasSettingsDialog() const override;
public Q_SLOTS:
- void applyStyle() Q_DECL_OVERRIDE;
+ void applyStyle() override;
private:
int mBars;
diff --git a/gui/SensorDisplayLib/DummyDisplay.h b/gui/SensorDisplayLib/DummyDisplay.h
index 7c61a36..c7521f3 100644
--- a/gui/SensorDisplayLib/DummyDisplay.h
+++ b/gui/SensorDisplayLib/DummyDisplay.h
@@ -32,9 +32,9 @@ class DummyDisplay : public KSGRD::SensorDisplay
public:
DummyDisplay( QWidget* parent, SharedSettings *workSheetSettings);
- ~DummyDisplay() Q_DECL_OVERRIDE {}
+ ~DummyDisplay() override {}
- bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
+ bool eventFilter( QObject*, QEvent* ) override;
};
#endif
diff --git a/gui/SensorDisplayLib/FancyPlotter.cpp b/gui/SensorDisplayLib/FancyPlotter.cpp
index 22be7bf..a6b1708 100644
--- a/gui/SensorDisplayLib/FancyPlotter.cpp
+++ b/gui/SensorDisplayLib/FancyPlotter.cpp
@@ -60,7 +60,7 @@ class FancyPlotterLabel : public QLabel {
textMargin = 0;
setLayoutDirection(Qt::LeftToRight); //We do this because we organise the strings ourselves.. is this going to muck it up though for RTL languages?
}
- ~FancyPlotterLabel() Q_DECL_OVERRIDE {
+ ~FancyPlotterLabel() override {
}
void setLabel(const QString &name, const QColor &color) {
labelName = name;
@@ -80,7 +80,7 @@ class FancyPlotterLabel : public QLabel {
resizeEvent(nullptr);
update();
}
- void resizeEvent( QResizeEvent * ) Q_DECL_OVERRIDE {
+ void resizeEvent( QResizeEvent * ) override {
QFontMetrics fm = fontMetrics();
if(valueText.isEmpty()) {
diff --git a/gui/SensorDisplayLib/FancyPlotter.h b/gui/SensorDisplayLib/FancyPlotter.h
index c32b5f2..28940ef 100644
--- a/gui/SensorDisplayLib/FancyPlotter.h
+++ b/gui/SensorDisplayLib/FancyPlotter.h
@@ -64,12 +64,12 @@ class FancyPlotter : public KSGRD::SensorDisplay
public:
FancyPlotter( QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
- ~FancyPlotter() Q_DECL_OVERRIDE;
+ ~FancyPlotter() override;
- void configureSettings() Q_DECL_OVERRIDE;
+ void configureSettings() override;
bool addSensor( const QString &hostName, const QString &name,
- const QString &type, const QString &title ) Q_DECL_OVERRIDE;
+ const QString &type, const QString &title ) override;
bool addSensor( const QString &hostName, const QString &name,
const QString &type, const QString &title,
const QColor &color, const QString &regexpName = QString(),
@@ -77,29 +77,29 @@ class FancyPlotter : public KSGRD::SensorDisplay
bool removeBeam( uint beamId );
- void setTitle( const QString &title ) Q_DECL_OVERRIDE;
+ void setTitle( const QString &title ) override;
- void answerReceived( int id, const QList<QByteArray> &answerlist ) Q_DECL_OVERRIDE;
+ void answerReceived( int id, const QList<QByteArray> &answerlist ) override;
- bool restoreSettings( QDomElement &element ) Q_DECL_OVERRIDE;
- bool saveSettings( QDomDocument &doc, QDomElement &element ) Q_DECL_OVERRIDE;
+ bool restoreSettings( QDomElement &element ) override;
+ bool saveSettings( QDomDocument &doc, QDomElement &element ) override;
- bool hasSettingsDialog() const Q_DECL_OVERRIDE;
+ bool hasSettingsDialog() const override;
void setBeamColor(int i, const QColor &color);
public Q_SLOTS:
- void applyStyle() Q_DECL_OVERRIDE;
+ void applyStyle() override;
private Q_SLOTS:
void settingsFinished();
- void applySettings() Q_DECL_OVERRIDE;
+ void applySettings() override;
void plotterAxisScaleChanged();
protected:
/** When we receive a timer tick, draw the beams and request new information to update the beams*/
- void timerTick( ) Q_DECL_OVERRIDE;
- bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
+ void timerTick( ) override;
+ bool eventFilter( QObject*, QEvent* ) override;
virtual void reorderBeams(const QList<int> & orderOfBeams);
- void resizeEvent( QResizeEvent* ) Q_DECL_OVERRIDE;
+ void resizeEvent( QResizeEvent* ) override;
void setTooltip();
private:
diff --git a/gui/SensorDisplayLib/ListView.h b/gui/SensorDisplayLib/ListView.h
index f88e906..9642d0a 100644
--- a/gui/SensorDisplayLib/ListView.h
+++ b/gui/SensorDisplayLib/ListView.h
@@ -33,11 +33,11 @@ class QTreeView;
class ListViewModel : public QStandardItemModel {
public:
- ListViewModel(QObject * parent = 0 ) : QStandardItemModel(parent)
+ explicit ListViewModel(QObject * parent = nullptr ) : QStandardItemModel(parent)
{
}
- ListViewModel(int rows, int columns, QObject * parent = 0) : QStandardItemModel(rows, columns, parent)
+ ListViewModel(int rows, int columns, QObject * parent = nullptr) : QStandardItemModel(rows, columns, parent)
{
}
@@ -52,7 +52,7 @@ public:
mAlignment.clear();
}
- QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE
+ QVariant data(const QModelIndex &index, int role) const override
{
int column = index.column();
@@ -70,31 +70,31 @@ class ListView : public KSGRD::SensorDisplay
{
Q_OBJECT
public:
- ListView(QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
- ~ListView() {}
+ explicit ListView(QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
+ ~ListView() override {}
- bool addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, const QString& sensorDescr) Q_DECL_OVERRIDE;
- void answerReceived(int id, const QList<QByteArray>& answerlist) Q_DECL_OVERRIDE;
+ bool addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, const QString& sensorDescr) override;
+ void answerReceived(int id, const QList<QByteArray>& answerlist) override;
void updateList();
- bool restoreSettings(QDomElement& element) Q_DECL_OVERRIDE;
- bool saveSettings(QDomDocument& doc, QDomElement& element) Q_DECL_OVERRIDE;
+ bool restoreSettings(QDomElement& element) override;
+ bool saveSettings(QDomDocument& doc, QDomElement& element) override;
- bool hasSettingsDialog() const Q_DECL_OVERRIDE
+ bool hasSettingsDialog() const override
{
return true;
}
- void timerTick() Q_DECL_OVERRIDE
+ void timerTick() override
{
updateList();
}
- void configureSettings() Q_DECL_OVERRIDE;
+ void configureSettings() override;
public Q_SLOTS:
- void applySettings() Q_DECL_OVERRIDE;
- void applyStyle() Q_DECL_OVERRIDE;
+ void applySettings() override;
+ void applyStyle() override;
void showColumnContextMenu(const QPoint &point);
private:
diff --git a/gui/SensorDisplayLib/LogFile.h b/gui/SensorDisplayLib/LogFile.h
index 3940374..d238732 100644
--- a/gui/SensorDisplayLib/LogFile.h
+++ b/gui/SensorDisplayLib/LogFile.h
@@ -36,33 +36,33 @@ class LogFile : public KSGRD::SensorDisplay
{
Q_OBJECT
public:
- LogFile(QWidget *parent, const QString& title, SharedSettings *workSheetSettings);
- ~LogFile() Q_DECL_OVERRIDE;
+ explicit LogFile(QWidget *parent, const QString& title, SharedSettings *workSheetSettings);
+ ~LogFile() override;
bool addSensor(const QString& hostName, const QString& sensorName,
- const QString& sensorType, const QString& sensorDescr) Q_DECL_OVERRIDE;
- void answerReceived(int id, const QList<QByteArray>& answer) Q_DECL_OVERRIDE;
+ const QString& sensorType, const QString& sensorDescr) override;
+ void answerReceived(int id, const QList<QByteArray>& answer) override;
- bool restoreSettings(QDomElement& element) Q_DECL_OVERRIDE;
- bool saveSettings(QDomDocument& doc, QDomElement& element) Q_DECL_OVERRIDE;
+ bool restoreSettings(QDomElement& element) override;
+ bool saveSettings(QDomDocument& doc, QDomElement& element) override;
void updateMonitor(void);
- void configureSettings(void) Q_DECL_OVERRIDE;
+ void configureSettings(void) override;
- void timerTick() Q_DECL_OVERRIDE
+ void timerTick() override
{
updateMonitor();
}
- bool hasSettingsDialog() const Q_DECL_OVERRIDE
+ bool hasSettingsDialog() const override
{
return true;
}
public Q_SLOTS:
- void applySettings() Q_DECL_OVERRIDE;
- void applyStyle() Q_DECL_OVERRIDE;
+ void applySettings() override;
+ void applyStyle() override;
void settingsAddRule();
void settingsDeleteRule();
diff --git a/gui/SensorDisplayLib/MultiMeter.h b/gui/SensorDisplayLib/MultiMeter.h
index d762d05..2ba742e 100644
--- a/gui/SensorDisplayLib/MultiMeter.h
+++ b/gui/SensorDisplayLib/MultiMeter.h
@@ -33,26 +33,26 @@ class MultiMeter : public KSGRD::SensorDisplay
Q_OBJECT
public:
- MultiMeter(QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
- ~MultiMeter() Q_DECL_OVERRIDE
+ explicit MultiMeter(QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
+ ~MultiMeter() override
{
}
bool addSensor(const QString& hostName, const QString& sensorName,
- const QString& sensorType, const QString& sensorDescr) Q_DECL_OVERRIDE;
- void answerReceived(int id, const QList<QByteArray>& answerlist) Q_DECL_OVERRIDE;
- bool restoreSettings(QDomElement& element) Q_DECL_OVERRIDE;
- bool saveSettings(QDomDocument& doc, QDomElement& element) Q_DECL_OVERRIDE;
+ const QString& sensorType, const QString& sensorDescr) override;
+ void answerReceived(int id, const QList<QByteArray>& answerlist) override;
+ bool restoreSettings(QDomElement& element) override;
+ bool saveSettings(QDomDocument& doc, QDomElement& element) override;
- bool hasSettingsDialog() const Q_DECL_OVERRIDE
+ bool hasSettingsDialog() const override
{
return true;
}
- void configureSettings() Q_DECL_OVERRIDE;
+ void configureSettings() override;
public Q_SLOTS:
- void applyStyle() Q_DECL_OVERRIDE;
+ void applyStyle() override;
private:
void setDigitColor(const QColor&);
diff --git a/gui/SensorDisplayLib/MultiMeterSettings.cpp b/gui/SensorDisplayLib/MultiMeterSettings.cpp
index 4bf2f36..d3edacd 100644
--- a/gui/SensorDisplayLib/MultiMeterSettings.cpp
+++ b/gui/SensorDisplayLib/MultiMeterSettings.cpp
@@ -53,37 +53,37 @@ MultiMeterSettings::~MultiMeterSettings()
delete m_settingsWidget;
}
-QString MultiMeterSettings::title()
+QString MultiMeterSettings::title() const
{
return m_settingsWidget->m_title->text();
}
-bool MultiMeterSettings::showUnit()
+bool MultiMeterSettings::showUnit() const
{
return m_settingsWidget->m_showUnit->isChecked();
}
-bool MultiMeterSettings::lowerLimitActive()
+bool MultiMeterSettings::lowerLimitActive() const
{
return m_settingsWidget->m_lowerLimitActive->isChecked();
}
-bool MultiMeterSettings::upperLimitActive()
+bool MultiMeterSettings::upperLimitActive() const
{
return m_settingsWidget->m_upperLimitActive->isChecked();
}
-double MultiMeterSettings::lowerLimit()
+double MultiMeterSettings::lowerLimit() const
{
return m_settingsWidget->m_lowerLimit->text().toDouble();
}
-double MultiMeterSettings::upperLimit()
+double MultiMeterSettings::upperLimit() const
{
return m_settingsWidget->m_upperLimit->text().toDouble();
}
-QColor MultiMeterSettings::normalDigitColor()
+QColor MultiMeterSettings::normalDigitColor() const
{
return m_settingsWidget->m_normalDigitColor->color();
}
diff --git a/gui/SensorDisplayLib/MultiMeterSettings.h b/gui/SensorDisplayLib/MultiMeterSettings.h
index 702a519..53d07c3 100644
--- a/gui/SensorDisplayLib/MultiMeterSettings.h
+++ b/gui/SensorDisplayLib/MultiMeterSettings.h
@@ -36,13 +36,13 @@ class MultiMeterSettings : public QDialog
explicit MultiMeterSettings( QWidget *parent=nullptr, const QString &name=QString() );
~MultiMeterSettings();
- QString title();
- bool showUnit();
- bool lowerLimitActive();
- bool upperLimitActive();
- double lowerLimit();
- double upperLimit();
- QColor normalDigitColor();
+ QString title() const;
+ bool showUnit() const;
+ bool lowerLimitActive() const;
+ bool upperLimitActive() const;
+ double lowerLimit() const;
+ double upperLimit() const;
+ QColor normalDigitColor() const;
QColor alarmDigitColor();
QColor meterBackgroundColor();
diff --git a/gui/SensorDisplayLib/ProcessController.h b/gui/SensorDisplayLib/ProcessController.h
index 9f42253..0f925a4 100644
--- a/gui/SensorDisplayLib/ProcessController.h
+++ b/gui/SensorDisplayLib/ProcessController.h
@@ -47,28 +47,28 @@ class ProcessController : public KSGRD::SensorDisplay
public:
ProcessController(QWidget* parent, SharedSettings *workSheetSettings);
- ~ProcessController() Q_DECL_OVERRIDE { }
+ ~ProcessController() override { }
/* Functions for SensorDisplay*/
- bool restoreSettings(QDomElement& element) Q_DECL_OVERRIDE;
+ bool restoreSettings(QDomElement& element) override;
- bool saveSettings(QDomDocument& doc, QDomElement& element) Q_DECL_OVERRIDE;
+ bool saveSettings(QDomDocument& doc, QDomElement& element) override;
- void timerTick() Q_DECL_OVERRIDE;
+ void timerTick() override;
- bool addSensor(const QString&, const QString&, const QString&, const QString&) Q_DECL_OVERRIDE;
+ bool addSensor(const QString&, const QString&, const QString&, const QString&) override;
- void sensorError(int, bool err) Q_DECL_OVERRIDE;
+ void sensorError(int, bool err) override;
- void configureSettings() Q_DECL_OVERRIDE { }
+ void configureSettings() override { }
- bool hasSettingsDialog() const Q_DECL_OVERRIDE
+ bool hasSettingsDialog() const override
{
return false;
}
- void answerReceived(int id, const QList<QByteArray>& answer ) Q_DECL_OVERRIDE;
+ void answerReceived(int id, const QList<QByteArray>& answer ) override;
KSysGuardProcessList* processList()
{
diff --git a/gui/SensorDisplayLib/SensorDisplay.h b/gui/SensorDisplayLib/SensorDisplay.h
index cdd0716..7a33f8c 100644
--- a/gui/SensorDisplayLib/SensorDisplay.h
+++ b/gui/SensorDisplayLib/SensorDisplay.h
@@ -67,7 +67,7 @@ class SensorDisplay : public QWidget, public SensorClient
/**
Destructor.
*/
- ~SensorDisplay() Q_DECL_OVERRIDE;
+ ~SensorDisplay() override;
/**
Sets the title of the display. If you override, please call this
@@ -179,7 +179,7 @@ class SensorDisplay : public QWidget, public SensorClient
/**
Normaly you shouldn't reimplement this methode
*/
- void sensorLost( int reqId ) Q_DECL_OVERRIDE;
+ void sensorLost( int reqId ) override;
/**
* Sets the object where the delete events will be sent to.
@@ -221,8 +221,8 @@ class SensorDisplay : public QWidget, public SensorClient
void translatedTitleChanged(const QString&);
protected:
- bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
- void changeEvent( QEvent * event ) Q_DECL_OVERRIDE;
+ bool eventFilter( QObject*, QEvent* ) override;
+ void changeEvent( QEvent * event ) override;
void registerSensor( SensorProperties *sp );
void unregisterSensor( uint pos );
diff --git a/gui/SensorDisplayLib/SensorLogger.cpp b/gui/SensorDisplayLib/SensorLogger.cpp
index 754e252..4eebb81 100644
--- a/gui/SensorDisplayLib/SensorLogger.cpp
+++ b/gui/SensorDisplayLib/SensorLogger.cpp
@@ -65,21 +65,21 @@ class LogSensorModel : public QAbstractTableModel
{
}
- int columnCount( const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE
+ int columnCount( const QModelIndex &parent = QModelIndex() ) const override
{
Q_UNUSED( parent );
return 5;
}
- int rowCount( const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE
+ int rowCount( const QModelIndex &parent = QModelIndex() ) const override
{
Q_UNUSED( parent );
return mSensors.count();
}
- QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const Q_DECL_OVERRIDE
+ QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override
{
if ( !index.isValid() )
return QVariant();
@@ -122,7 +122,7 @@ class LogSensorModel : public QAbstractTableModel
return QVariant();
}
- QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const Q_DECL_OVERRIDE
+ QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override
{
if ( orientation == Qt::Vertical )
return QVariant();
diff --git a/gui/SensorDisplayLib/SensorLogger.h b/gui/SensorDisplayLib/SensorLogger.h
index 863e932..62a65fb 100644
--- a/gui/SensorDisplayLib/SensorLogger.h
+++ b/gui/SensorDisplayLib/SensorLogger.h
@@ -35,9 +35,9 @@ class LogSensor : public QObject, public KSGRD::SensorClient
public:
explicit LogSensor( QObject *parent );
- ~LogSensor() Q_DECL_OVERRIDE;
+ ~LogSensor() override;
- void answerReceived( int id, const QList<QByteArray>&answer ) Q_DECL_OVERRIDE;
+ void answerReceived( int id, const QList<QByteArray>&answer ) override;
void setHostName( const QString& name );
QString hostName() const;
@@ -78,7 +78,7 @@ class LogSensor : public QObject, public KSGRD::SensorClient
void changed();
protected:
- void timerEvent ( QTimerEvent * event ) Q_DECL_OVERRIDE;
+ void timerEvent ( QTimerEvent * event ) override;
private:
QString mSensorName;
@@ -108,7 +108,7 @@ class LogSensorView : public QTreeView
void contextMenuRequest( const QModelIndex &index, const QPoint &pos );
protected:
- void contextMenuEvent( QContextMenuEvent *event ) Q_DECL_OVERRIDE;
+ void contextMenuEvent( QContextMenuEvent *event ) override;
};
class SensorLogger : public KSGRD::SensorDisplay
@@ -117,27 +117,27 @@ class SensorLogger : public KSGRD::SensorDisplay
public:
SensorLogger( QWidget *parent, const QString& title, SharedSettings *workSheetSettings );
- ~SensorLogger();
+ ~SensorLogger() override;
bool addSensor( const QString& hostName, const QString& sensorName,
- const QString& sensorType, const QString& sensorDescr) Q_DECL_OVERRIDE;
+ const QString& sensorType, const QString& sensorDescr) override;
bool editSensor( LogSensor* );
- void answerReceived( int, const QList<QByteArray>& ) Q_DECL_OVERRIDE;
+ void answerReceived( int, const QList<QByteArray>& ) override;
- bool restoreSettings( QDomElement& ) Q_DECL_OVERRIDE;
- bool saveSettings( QDomDocument&, QDomElement& ) Q_DECL_OVERRIDE;
+ bool restoreSettings( QDomElement& ) override;
+ bool saveSettings( QDomDocument&, QDomElement& ) override;
- void configureSettings() Q_DECL_OVERRIDE;
+ void configureSettings() override;
- bool hasSettingsDialog() const Q_DECL_OVERRIDE
+ bool hasSettingsDialog() const override
{
return true;
}
public Q_SLOTS:
- void applyStyle() Q_DECL_OVERRIDE;
+ void applyStyle() override;
void contextMenuRequest( const QModelIndex &index, const QPoint &pos );
private:
diff --git a/gui/SensorDisplayLib/SensorLoggerSettings.cpp b/gui/SensorDisplayLib/SensorLoggerSettings.cpp
index 210c364..f57df75 100644
--- a/gui/SensorDisplayLib/SensorLoggerSettings.cpp
+++ b/gui/SensorDisplayLib/SensorLoggerSettings.cpp
@@ -22,7 +22,7 @@
#include <KLocalizedString>
-SensorLoggerSettings::SensorLoggerSettings( QWidget *parent, const char *name )
+SensorLoggerSettings::SensorLoggerSettings( QWidget *parent, const QString &name )
: QDialog( parent )
{
setObjectName( name );
@@ -47,7 +47,7 @@ SensorLoggerSettings::~SensorLoggerSettings()
delete m_settingsWidget;
}
-QString SensorLoggerSettings::title()
+QString SensorLoggerSettings::title() const
{
return m_settingsWidget->m_title->text();
}
diff --git a/gui/SensorDisplayLib/SensorLoggerSettings.h b/gui/SensorDisplayLib/SensorLoggerSettings.h
index 3cd3b37..7f86b75 100644
--- a/gui/SensorDisplayLib/SensorLoggerSettings.h
+++ b/gui/SensorDisplayLib/SensorLoggerSettings.h
@@ -33,10 +33,10 @@ class SensorLoggerSettings : public QDialog
public:
- explicit SensorLoggerSettings( QWidget *parent=nullptr, const char *name=nullptr );
+ explicit SensorLoggerSettings(QWidget *parent=nullptr, const QString &name = {} );
~SensorLoggerSettings();
- QString title();
+ QString title() const;
QColor foregroundColor();
QColor backgroundColor();
QColor alarmColor();
diff --git a/gui/SensorDisplayLib/SensorModel.h b/gui/SensorDisplayLib/SensorModel.h
index 50f4d9b..cf66e0b 100644
--- a/gui/SensorDisplayLib/SensorModel.h
+++ b/gui/SensorDisplayLib/SensorModel.h
@@ -79,10 +79,10 @@ class SensorModel : public QAbstractTableModel
void moveUpSensor(const QModelIndex &index);
void setHasLabel( bool hasLabel );
- int columnCount( const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE;
- int rowCount( const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE;
- QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const Q_DECL_OVERRIDE;
- QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const Q_DECL_OVERRIDE;
+ int columnCount( const QModelIndex &parent = QModelIndex() ) const override;
+ int rowCount( const QModelIndex &parent = QModelIndex() ) const override;
+ QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override;
+ QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
QList<int> order() const;
QList<int> deleted() const;
void clearDeleted();
diff --git a/gui/WorkSheet.h b/gui/WorkSheet.h
index cdde77d..83dcd20 100644
--- a/gui/WorkSheet.h
+++ b/gui/WorkSheet.h
@@ -50,7 +50,7 @@ class WorkSheet : public QWidget
public:
explicit WorkSheet( QWidget* parent);
WorkSheet( int rows, int columns, float interval, QWidget* parent);
- ~WorkSheet() Q_DECL_OVERRIDE;
+ ~WorkSheet() override;
bool load( const QString &fileName );
bool save( const QString &fileName );
@@ -90,12 +90,12 @@ class WorkSheet : public QWidget
protected:
- void changeEvent( QEvent * event ) Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- void dragMoveEvent( QDragMoveEvent* ) Q_DECL_OVERRIDE;
- void dragEnterEvent( QDragEnterEvent* ) Q_DECL_OVERRIDE;
- void dropEvent( QDropEvent* ) Q_DECL_OVERRIDE;
- bool event( QEvent* ) Q_DECL_OVERRIDE;
+ void changeEvent( QEvent * event ) override;
+ QSize sizeHint() const override;
+ void dragMoveEvent( QDragMoveEvent* ) override;
+ void dragEnterEvent( QDragEnterEvent* ) override;
+ void dropEvent( QDropEvent* ) override;
+ bool event( QEvent* ) override;
void setUpdateInterval( float interval);
private:
diff --git a/gui/ksortfilterproxymodel.cpp b/gui/ksortfilterproxymodel.cpp
index 170ef17..609241a 100644
--- a/gui/ksortfilterproxymodel.cpp
+++ b/gui/ksortfilterproxymodel.cpp
@@ -27,11 +27,10 @@
class KSortFilterProxyModelPrivate {
public:
KSortFilterProxyModelPrivate() {
- showAllChildren = false;
}
~KSortFilterProxyModelPrivate() {}
- bool showAllChildren;
+ bool showAllChildren = false;
};
KSortFilterProxyModel::KSortFilterProxyModel(QObject * parent)
diff --git a/gui/ksortfilterproxymodel.h b/gui/ksortfilterproxymodel.h
index dfa7d6c..e3dac20 100644
--- a/gui/ksortfilterproxymodel.h
+++ b/gui/ksortfilterproxymodel.h
@@ -42,7 +42,7 @@ class KSortFilterProxyModel
/*! Constructs a sorting filter model with the given parent. */
explicit KSortFilterProxyModel(QObject * parent = nullptr);
/*! Destroys this sorting filter model. */
- ~KSortFilterProxyModel() Q_DECL_OVERRIDE;
+ ~KSortFilterProxyModel() override;
/*! Whether to show the children of a matching parent.
* This is false by default. */
@@ -53,7 +53,7 @@ class KSortFilterProxyModel
protected:
/*! \reimp */
- bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const Q_DECL_OVERRIDE;
+ bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const override;
KSortFilterProxyModelPrivate * const d_ptr;
Q_DISABLE_COPY( KSortFilterProxyModel )
diff --git a/gui/ksysguard.h b/gui/ksysguard.h
index 40c44d8..a6f3b21 100644
--- a/gui/ksysguard.h
+++ b/gui/ksysguard.h
@@ -46,10 +46,10 @@ class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient
public:
TopLevel();
- void saveProperties( KConfigGroup& ) Q_DECL_OVERRIDE;
- void readProperties( const KConfigGroup& ) Q_DECL_OVERRIDE;
+ void saveProperties( KConfigGroup& ) override;
+ void readProperties( const KConfigGroup& ) override;
- void answerReceived( int id, const QList<QByteArray> & ) Q_DECL_OVERRIDE;
+ void answerReceived( int id, const QList<QByteArray> & ) override;
void initStatusBar();
void setLocalProcessController(ProcessController * localProcessController);
@@ -65,9 +65,9 @@ class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient
protected:
- bool event( QEvent* ) Q_DECL_OVERRIDE;
- void timerEvent( QTimerEvent* ) Q_DECL_OVERRIDE;
- bool queryClose() Q_DECL_OVERRIDE;
+ bool event( QEvent* ) override;
+ void timerEvent( QTimerEvent* ) override;
+ bool queryClose() override;
protected Q_SLOTS:
void connectHost();
@@ -80,7 +80,7 @@ class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient
private:
void setSwapInfo( qlonglong, qlonglong, const QString& );
- void changeEvent( QEvent * event ) Q_DECL_OVERRIDE;
+ void changeEvent( QEvent * event ) override;
void retranslateUi();
QDBusMessage mDBusReply;