Commit 36469138 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECL_OVERRIDE

parent 48ef312e
......@@ -46,12 +46,12 @@ class SensorBrowserModel : public QAbstractItemModel, private KSGRD::SensorClien
public:
SensorBrowserModel();
~SensorBrowserModel();
virtual int columnCount( const QModelIndex &) const;
virtual QVariant data( const QModelIndex & parent, int role) const;
virtual QVariant headerData ( int section, Qt::Orientation orientation, int role) const;
virtual QModelIndex index ( int row, int column, const QModelIndex & parent) const;
virtual QModelIndex parent ( const QModelIndex & index ) const;
virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
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;
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);
virtual Qt::ItemFlags flags ( const QModelIndex & index ) const;
virtual QMimeData * mimeData ( const QModelIndexList & indexes ) const;
Qt::ItemFlags flags ( const QModelIndex & index ) const Q_DECL_OVERRIDE;
QMimeData * mimeData ( const QModelIndexList & indexes ) const Q_DECL_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:
virtual void answerReceived( int id, const QList<QByteArray>& );
void answerReceived( int id, const QList<QByteArray>& ) Q_DECL_OVERRIDE;
void removeEmptyParentTreeBranches(int hostId, int id, int parentid);
HostInfo* findHostInfoByHostName(const QString &hostName) const;
void removeAllSensorUnderBranch(HostInfo* hostInfo, int parentId);
......@@ -122,7 +122,7 @@ class SensorBrowserTreeWidget : public QTreeView
void updateView();
private:
void retranslateUi();
void changeEvent( QEvent * event );
void changeEvent( QEvent * event ) Q_DECL_OVERRIDE;
KSGRD::SensorManager* mSensorManager;
......
......@@ -70,7 +70,7 @@ class BarGraph : public QWidget
void changeRange( double min, double max );
protected:
virtual void paintEvent( QPaintEvent* );
void paintEvent( QPaintEvent* ) Q_DECL_OVERRIDE;
private:
double minValue;
......
......@@ -40,23 +40,23 @@ class DancingBars : public KSGRD::SensorDisplay
DancingBars( QWidget *parent, const QString &title, SharedSettings *workSheetSettings );
virtual ~DancingBars();
void configureSettings();
void configureSettings() Q_DECL_OVERRIDE;
bool addSensor( const QString &hostName, const QString &name,
const QString &type, const QString &title );
bool removeSensor( uint pos );
const QString &type, const QString &title ) Q_DECL_OVERRIDE;
bool removeSensor( uint pos ) Q_DECL_OVERRIDE;
void updateSamples( const QVector<double> &samples );
virtual void answerReceived( int id, const QList<QByteArray> &answerlist );
void answerReceived( int id, const QList<QByteArray> &answerlist ) Q_DECL_OVERRIDE;
bool restoreSettings( QDomElement& );
bool saveSettings( QDomDocument&, QDomElement& );
bool restoreSettings( QDomElement& ) Q_DECL_OVERRIDE;
bool saveSettings( QDomDocument&, QDomElement& ) Q_DECL_OVERRIDE;
virtual bool hasSettingsDialog() const;
bool hasSettingsDialog() const Q_DECL_OVERRIDE;
public Q_SLOTS:
virtual void applyStyle();
void applyStyle() Q_DECL_OVERRIDE;
private:
uint mBars;
......
......@@ -34,7 +34,7 @@ class DummyDisplay : public KSGRD::SensorDisplay
DummyDisplay( QWidget* parent, SharedSettings *workSheetSettings);
virtual ~DummyDisplay() {}
virtual bool eventFilter( QObject*, QEvent* );
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
};
#endif
......@@ -80,7 +80,7 @@ class FancyPlotterLabel : public QLabel {
resizeEvent(NULL);
update();
}
virtual void resizeEvent( QResizeEvent * ) {
void resizeEvent( QResizeEvent * ) Q_DECL_OVERRIDE {
QFontMetrics fm = fontMetrics();
if(valueText.isEmpty()) {
......
......@@ -66,10 +66,10 @@ class FancyPlotter : public KSGRD::SensorDisplay
FancyPlotter( QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
virtual ~FancyPlotter();
void configureSettings();
void configureSettings() Q_DECL_OVERRIDE;
bool addSensor( const QString &hostName, const QString &name,
const QString &type, const QString &title );
const QString &type, const QString &title ) Q_DECL_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 );
virtual void setTitle( const QString &title );
void setTitle( const QString &title ) Q_DECL_OVERRIDE;
virtual void answerReceived( int id, const QList<QByteArray> &answerlist );
void answerReceived( int id, const QList<QByteArray> &answerlist ) Q_DECL_OVERRIDE;
virtual bool restoreSettings( QDomElement &element );
virtual bool saveSettings( QDomDocument &doc, QDomElement &element );
bool restoreSettings( QDomElement &element ) Q_DECL_OVERRIDE;
bool saveSettings( QDomDocument &doc, QDomElement &element ) Q_DECL_OVERRIDE;
virtual bool hasSettingsDialog() const;
bool hasSettingsDialog() const Q_DECL_OVERRIDE;
void setBeamColor(int i, const QColor &color);
public Q_SLOTS:
virtual void applyStyle();
void applyStyle() Q_DECL_OVERRIDE;
private Q_SLOTS:
void settingsFinished();
void applySettings();
void applySettings() Q_DECL_OVERRIDE;
void plotterAxisScaleChanged();
protected:
/** When we receive a timer tick, draw the beams and request new information to update the beams*/
virtual void timerTick( );
virtual bool eventFilter( QObject*, QEvent* );
void timerTick( ) Q_DECL_OVERRIDE;
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
virtual void reorderBeams(const QList<int> & orderOfBeams);
virtual void resizeEvent( QResizeEvent* );
void resizeEvent( QResizeEvent* ) Q_DECL_OVERRIDE;
void setTooltip();
private:
......
......@@ -307,7 +307,7 @@ ListView::answerReceived(int id, const QList<QByteArray>& answer)
case 19: {
for (int i = 0; i < answer.count(); i++) {
KSGRD::SensorTokenizer records(answer[i], '\t');
for (uint j = 0; j < records.count() && j < mColumnTypes.count(); j++) {
for (int j = 0; j < records.count() && j < mColumnTypes.count(); j++) {
QStandardItem *item = new QStandardItem();
item->setEditable(false);
switch( mColumnTypes[j] ) {
......
......@@ -52,7 +52,7 @@ public:
mAlignment.clear();
}
QVariant data(const QModelIndex &index, int role) const
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE
{
int column = index.column();
......@@ -73,28 +73,28 @@ public:
ListView(QWidget* parent, const QString& title, SharedSettings *workSheetSettings);
~ListView() {}
bool addSensor(const QString& hostName, const QString& sensorName, const QString& sensorType, const QString& sensorDescr);
void answerReceived(int id, const QList<QByteArray>& answerlist);
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;
void updateList();
bool restoreSettings(QDomElement& element);
bool saveSettings(QDomDocument& doc, QDomElement& element);
bool restoreSettings(QDomElement& element) Q_DECL_OVERRIDE;
bool saveSettings(QDomDocument& doc, QDomElement& element) Q_DECL_OVERRIDE;
virtual bool hasSettingsDialog() const
bool hasSettingsDialog() const Q_DECL_OVERRIDE
{
return true;
}
virtual void timerTick()
void timerTick() Q_DECL_OVERRIDE
{
updateList();
}
void configureSettings();
void configureSettings() Q_DECL_OVERRIDE;
public Q_SLOTS:
void applySettings();
void applyStyle();
void applySettings() Q_DECL_OVERRIDE;
void applyStyle() Q_DECL_OVERRIDE;
void showColumnContextMenu(const QPoint &point);
private:
......
......@@ -41,29 +41,29 @@ public:
~LogFile(void);
bool addSensor(const QString& hostName, const QString& sensorName,
const QString& sensorType, const QString& sensorDescr);
void answerReceived(int id, const QList<QByteArray>& answer);
const QString& sensorType, const QString& sensorDescr) Q_DECL_OVERRIDE;
void answerReceived(int id, const QList<QByteArray>& answer) Q_DECL_OVERRIDE;
bool restoreSettings(QDomElement& element);
bool saveSettings(QDomDocument& doc, QDomElement& element);
bool restoreSettings(QDomElement& element) Q_DECL_OVERRIDE;
bool saveSettings(QDomDocument& doc, QDomElement& element) Q_DECL_OVERRIDE;
void updateMonitor(void);
void configureSettings(void);
void configureSettings(void) Q_DECL_OVERRIDE;
virtual void timerTick()
void timerTick() Q_DECL_OVERRIDE
{
updateMonitor();
}
virtual bool hasSettingsDialog() const
bool hasSettingsDialog() const Q_DECL_OVERRIDE
{
return true;
}
public Q_SLOTS:
void applySettings();
void applyStyle();
void applySettings() Q_DECL_OVERRIDE;
void applyStyle() Q_DECL_OVERRIDE;
void settingsAddRule();
void settingsDeleteRule();
......
......@@ -39,20 +39,20 @@ class MultiMeter : public KSGRD::SensorDisplay
}
bool addSensor(const QString& hostName, const QString& sensorName,
const QString& sensorType, const QString& sensorDescr);
void answerReceived(int id, const QList<QByteArray>& answerlist);
bool restoreSettings(QDomElement& element);
bool saveSettings(QDomDocument& doc, QDomElement& element);
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;
virtual bool hasSettingsDialog() const
bool hasSettingsDialog() const Q_DECL_OVERRIDE
{
return true;
}
void configureSettings();
void configureSettings() Q_DECL_OVERRIDE;
public Q_SLOTS:
void applyStyle();
void applyStyle() Q_DECL_OVERRIDE;
private:
void setDigitColor(const QColor&);
......
......@@ -51,24 +51,24 @@ public:
/* Functions for SensorDisplay*/
bool restoreSettings(QDomElement& element);
bool restoreSettings(QDomElement& element) Q_DECL_OVERRIDE;
bool saveSettings(QDomDocument& doc, QDomElement& element);
bool saveSettings(QDomDocument& doc, QDomElement& element) Q_DECL_OVERRIDE;
virtual void timerTick();
void timerTick() Q_DECL_OVERRIDE;
virtual bool addSensor(const QString&, const QString&, const QString&, const QString&);
bool addSensor(const QString&, const QString&, const QString&, const QString&) Q_DECL_OVERRIDE;
virtual void sensorError(int, bool err);
void sensorError(int, bool err) Q_DECL_OVERRIDE;
void configureSettings() { }
void configureSettings() Q_DECL_OVERRIDE { }
virtual bool hasSettingsDialog() const
bool hasSettingsDialog() const Q_DECL_OVERRIDE
{
return false;
}
virtual void answerReceived(int id, const QList<QByteArray>& answer );
void answerReceived(int id, const QList<QByteArray>& answer ) Q_DECL_OVERRIDE;
KSysGuardProcessList* processList()
{
......
......@@ -179,7 +179,7 @@ class SensorDisplay : public QWidget, public SensorClient
/**
Normaly you shouldn't reimplement this methode
*/
virtual void sensorLost( int reqId );
void sensorLost( int reqId ) Q_DECL_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:
virtual bool eventFilter( QObject*, QEvent* );
virtual void changeEvent( QEvent * event );
bool eventFilter( QObject*, QEvent* ) Q_DECL_OVERRIDE;
void changeEvent( QEvent * event ) Q_DECL_OVERRIDE;
void registerSensor( SensorProperties *sp );
void unregisterSensor( uint pos );
......
......@@ -65,21 +65,21 @@ class LogSensorModel : public QAbstractTableModel
{
}
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const
int columnCount( const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE
{
Q_UNUSED( parent );
return 5;
}
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const
int rowCount( const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE
{
Q_UNUSED( parent );
return mSensors.count();
}
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const Q_DECL_OVERRIDE
{
if ( !index.isValid() )
return QVariant();
......@@ -126,7 +126,7 @@ class LogSensorModel : public QAbstractTableModel
return QVariant();
}
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const Q_DECL_OVERRIDE
{
if ( orientation == Qt::Vertical )
return QVariant();
......
......@@ -37,7 +37,7 @@ class LogSensor : public QObject, public KSGRD::SensorClient
explicit LogSensor( QObject *parent );
~LogSensor();
virtual void answerReceived( int id, const QList<QByteArray>&answer );
void answerReceived( int id, const QList<QByteArray>&answer ) Q_DECL_OVERRIDE;
void setHostName( const QString& name );
QString hostName() const;
......@@ -78,7 +78,7 @@ class LogSensor : public QObject, public KSGRD::SensorClient
void changed();
protected:
virtual void timerEvent ( QTimerEvent * event );
void timerEvent ( QTimerEvent * event ) Q_DECL_OVERRIDE;
private:
QString mSensorName;
......@@ -108,7 +108,7 @@ class LogSensorView : public QTreeView
void contextMenuRequest( const QModelIndex &index, const QPoint &pos );
protected:
virtual void contextMenuEvent( QContextMenuEvent *event );
void contextMenuEvent( QContextMenuEvent *event ) Q_DECL_OVERRIDE;
};
class SensorLogger : public KSGRD::SensorDisplay
......@@ -120,24 +120,24 @@ class SensorLogger : public KSGRD::SensorDisplay
~SensorLogger();
bool addSensor( const QString& hostName, const QString& sensorName,
const QString& sensorType, const QString& sensorDescr);
const QString& sensorType, const QString& sensorDescr) Q_DECL_OVERRIDE;
bool editSensor( LogSensor* );
virtual void answerReceived( int, const QList<QByteArray>& );
void answerReceived( int, const QList<QByteArray>& ) Q_DECL_OVERRIDE;
bool restoreSettings( QDomElement& );
bool saveSettings( QDomDocument&, QDomElement& );
bool restoreSettings( QDomElement& ) Q_DECL_OVERRIDE;
bool saveSettings( QDomDocument&, QDomElement& ) Q_DECL_OVERRIDE;
void configureSettings();
void configureSettings() Q_DECL_OVERRIDE;
virtual bool hasSettingsDialog() const
bool hasSettingsDialog() const Q_DECL_OVERRIDE
{
return true;
}
public Q_SLOTS:
void applyStyle();
void applyStyle() Q_DECL_OVERRIDE;
void contextMenuRequest( const QModelIndex &index, const QPoint &pos );
private:
......
......@@ -79,10 +79,10 @@ class SensorModel : public QAbstractTableModel
void moveUpSensor(const QModelIndex &index);
void setHasLabel( bool hasLabel );
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
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;
QList<int> order() const;
QList<int> deleted() const;
void clearDeleted();
......
......@@ -90,12 +90,12 @@ class WorkSheet : public QWidget
protected:
virtual void changeEvent( QEvent * event );
virtual QSize sizeHint() const;
virtual void dragMoveEvent( QDragMoveEvent* );
virtual void dragEnterEvent( QDragEnterEvent* );
void dropEvent( QDropEvent* );
bool event( QEvent* );
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 setUpdateInterval( float interval);
private:
......
......@@ -53,7 +53,7 @@ class KSortFilterProxyModel
protected:
/*! \reimp */
virtual bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const;
bool filterAcceptsRow ( int source_row, const QModelIndex & source_parent ) const Q_DECL_OVERRIDE;
KSortFilterProxyModelPrivate * const d_ptr;
Q_DISABLE_COPY( KSortFilterProxyModel )
......
......@@ -46,10 +46,10 @@ class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient
public:
TopLevel();
virtual void saveProperties( KConfigGroup& );
virtual void readProperties( const KConfigGroup& );
void saveProperties( KConfigGroup& ) Q_DECL_OVERRIDE;
void readProperties( const KConfigGroup& ) Q_DECL_OVERRIDE;
virtual void answerReceived( int id, const QList<QByteArray> & );
void answerReceived( int id, const QList<QByteArray> & ) Q_DECL_OVERRIDE;
void initStatusBar();
void setLocalProcessController(ProcessController * localProcessController);
......@@ -65,9 +65,9 @@ class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient
protected:
virtual bool event( QEvent* );
virtual void timerEvent( QTimerEvent* );
virtual bool queryClose();
bool event( QEvent* ) Q_DECL_OVERRIDE;
void timerEvent( QTimerEvent* ) Q_DECL_OVERRIDE;
bool queryClose() Q_DECL_OVERRIDE;
protected Q_SLOTS:
void connectHost();
......@@ -79,7 +79,7 @@ class TopLevel : public KXmlGuiWindow, public KSGRD::SensorClient
private:
void setSwapInfo( qlonglong, qlonglong, const QString& );
void changeEvent( QEvent * event );
void changeEvent( QEvent * event ) Q_DECL_OVERRIDE;
void retranslateUi();
QDBusMessage mDBusReply;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment