Skip to content

Commit 6482cf3

Browse files
luis-pereiraagaida
authored andcommitted
Port towards C++11 override
1 parent 491e21d commit 6482cf3

20 files changed

+70
-70
lines changed

configdialog/lxqtconfigdialog.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class LXQT_API ConfigDialog : public QDialog
4848
public:
4949
explicit ConfigDialog(const QString& title, Settings* settings, QWidget* parent = nullptr);
5050

51-
~ConfigDialog();
51+
~ConfigDialog() override;
5252

5353
/*!
5454
* Sets buttons in button bar
@@ -101,8 +101,8 @@ class LXQT_API ConfigDialog : public QDialog
101101

102102
protected:
103103
Settings* mSettings;
104-
virtual bool event(QEvent * event) override;
105-
virtual void closeEvent(QCloseEvent* event) override;
104+
bool event(QEvent * event) override;
105+
void closeEvent(QCloseEvent* event) override;
106106

107107
private:
108108
Q_DISABLE_COPY(ConfigDialog)

configdialog/lxqtpageselectwidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class PageSelectWidgetItemDelegate: public QStyledItemDelegate
3939
{
4040
public:
4141
explicit PageSelectWidgetItemDelegate(PageSelectWidget *parent = nullptr);
42-
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
42+
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
4343

4444
private:
4545
PageSelectWidget* mView;

configdialog/lxqtpageselectwidget.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class LXQT_API PageSelectWidget : public QListWidget
4040
Q_OBJECT
4141
public:
4242
explicit PageSelectWidget(QWidget *parent = nullptr);
43-
virtual ~PageSelectWidget();
43+
~PageSelectWidget() override;
4444
int maxTextWidth() const;
4545
bool event(QEvent * event) override;
4646

lxqtapplication.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class LXQT_API Application : public QApplication
5959
* \param handleQuitSignals flag if signals SIGINT, SIGTERM, SIGHUP should be handled internaly (\sa quit() application)
6060
*/
6161
Application(int &argc, char **argv, bool handleQuitSignals);
62-
virtual ~Application() {}
62+
~Application() override {}
6363
/*! Install UNIX signal handler for signals defined in \param signalList
6464
* Upon receiving of any of this signals the \sa unixSignal signal is emitted
6565
*/

lxqtbacklight.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Q_OBJECT
3131

3232
public:
3333
Backlight(QObject *parent = nullptr);
34-
~Backlight();
34+
~Backlight() override;
3535

3636
bool isBacklightAvailable();
3737
bool isBacklightOff();

lxqtbacklight/linux_backend/linuxbackend.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ Q_OBJECT
3131

3232
public:
3333
LinuxBackend(QObject *parent = nullptr);
34-
~LinuxBackend();
34+
~LinuxBackend() override;
3535

36-
bool isBacklightAvailable();
37-
bool isBacklightOff();
38-
void setBacklight(int value);
39-
int getBacklight();
40-
int getMaxBacklight();
36+
bool isBacklightAvailable() override;
37+
bool isBacklightOff() override;
38+
void setBacklight(int value) override;
39+
int getBacklight() override;
40+
int getMaxBacklight() override;
4141

4242
signals:
4343
void backlightChanged(int value);

lxqtgridlayout.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace
8484
setDuration(150);
8585
}
8686

87-
void updateCurrentValue(const QVariant &current)
87+
void updateCurrentValue(const QVariant &current) override
8888
{
8989
mItem->setGeometry(current.toRect());
9090
}

lxqtgridlayout.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,16 @@ class LXQT_API GridLayout: public QLayout
7979
/**
8080
Destroys the grid layout. The layout's widgets aren't destroyed.
8181
**/
82-
~GridLayout();
82+
~GridLayout() override;
8383

84-
void addItem(QLayoutItem *item);
85-
QLayoutItem *itemAt(int index) const;
86-
QLayoutItem *takeAt(int index);
87-
int count() const;
88-
void invalidate();
84+
void addItem(QLayoutItem *item) override;
85+
QLayoutItem *itemAt(int index) const override;
86+
QLayoutItem *takeAt(int index) override;
87+
int count() const override;
88+
void invalidate() override;
8989

90-
QSize sizeHint() const;
91-
void setGeometry(const QRect &geometry);
90+
QSize sizeHint() const override;
91+
void setGeometry(const QRect &geometry) override;
9292
QRect occupiedGeometry() const;
9393

9494

lxqthtmldelegate.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ class LXQT_API HtmlDelegate : public QStyledItemDelegate
4242

4343
public:
4444
explicit HtmlDelegate(const QSize iconSize, QObject* parent = nullptr);
45-
virtual ~HtmlDelegate();
45+
~HtmlDelegate() override;
4646

47-
virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
47+
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
4848

49-
virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
49+
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override;
5050

5151
private:
5252
QSize mIconSize;

lxqtnotification.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class LXQT_API Notification : public QObject
4848
* \param summary Summary text briefly describing the notification (required by the spec)
4949
*/
5050
Notification(const QString& summary = QString(), QObject* parent = nullptr);
51-
~Notification();
51+
~Notification() override;
5252

5353
enum CloseReason
5454
{

lxqtnotification_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class NotificationPrivate : public QObject
3636
Q_OBJECT
3737
public:
3838
NotificationPrivate(const QString& summary, Notification* parent);
39-
~NotificationPrivate();
39+
~NotificationPrivate() override;
4040

4141
void update();
4242
void close();

lxqtplugininfo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class LXQT_API PluginInfo: public XdgDesktopFile
6666
explicit PluginInfo();
6767

6868
//! Reimplemented from XdgDesktopFile.
69-
virtual bool load(const QString& fileName);
69+
bool load(const QString& fileName) override;
7070

7171

7272
//! Reimplemented from XdgDesktopFile.

lxqtpower/lxqtpower.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class LXQT_API Power : public QObject
6969
explicit Power(QObject *parent = nullptr);
7070

7171
/// Destroys the object.
72-
virtual ~Power();
72+
~Power() override;
7373

7474
/// Returns true if the Power can perform action.
7575
bool canAction(Action action) const;

lxqtpower/lxqtpowerproviders.h

+22-22
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class PowerProvider: public QObject
4949
};
5050

5151
explicit PowerProvider(QObject *parent = nullptr);
52-
virtual ~PowerProvider();
52+
~PowerProvider() override;
5353

5454
/*! Returns true if the Power can perform action.
5555
This is a pure virtual function, and must be reimplemented in subclasses. */
@@ -67,11 +67,11 @@ class UPowerProvider: public PowerProvider
6767
Q_OBJECT
6868
public:
6969
UPowerProvider(QObject *parent = nullptr);
70-
~UPowerProvider();
71-
bool canAction(Power::Action action) const;
70+
~UPowerProvider() override;
71+
bool canAction(Power::Action action) const override;
7272

7373
public slots:
74-
bool doAction(Power::Action action);
74+
bool doAction(Power::Action action) override;
7575
};
7676

7777

@@ -80,11 +80,11 @@ class ConsoleKitProvider: public PowerProvider
8080
Q_OBJECT
8181
public:
8282
ConsoleKitProvider(QObject *parent = nullptr);
83-
~ConsoleKitProvider();
84-
bool canAction(Power::Action action) const;
83+
~ConsoleKitProvider() override;
84+
bool canAction(Power::Action action) const override;
8585

8686
public slots:
87-
bool doAction(Power::Action action);
87+
bool doAction(Power::Action action) override;
8888
};
8989

9090

@@ -93,11 +93,11 @@ class SystemdProvider: public PowerProvider
9393
Q_OBJECT
9494
public:
9595
SystemdProvider(QObject *parent = nullptr);
96-
~SystemdProvider();
97-
bool canAction(Power::Action action) const;
96+
~SystemdProvider() override;
97+
bool canAction(Power::Action action) const override;
9898

9999
public slots:
100-
bool doAction(Power::Action action);
100+
bool doAction(Power::Action action) override;
101101
};
102102

103103

@@ -106,23 +106,23 @@ class LXQtProvider: public PowerProvider
106106
Q_OBJECT
107107
public:
108108
LXQtProvider(QObject *parent = nullptr);
109-
~LXQtProvider();
110-
bool canAction(Power::Action action) const;
109+
~LXQtProvider() override;
110+
bool canAction(Power::Action action) const override;
111111

112112
public slots:
113-
bool doAction(Power::Action action);
113+
bool doAction(Power::Action action) override;
114114
};
115115

116116
class LxSessionProvider: public PowerProvider
117117
{
118118
Q_OBJECT
119119
public:
120120
LxSessionProvider(QObject *parent = nullptr);
121-
~LxSessionProvider();
122-
bool canAction(Power::Action action) const;
121+
~LxSessionProvider() override;
122+
bool canAction(Power::Action action) const override;
123123

124124
public slots:
125-
bool doAction(Power::Action action);
125+
bool doAction(Power::Action action) override;
126126
private:
127127
Q_PID pid;
128128
};
@@ -132,11 +132,11 @@ class HalProvider: public PowerProvider
132132
Q_OBJECT
133133
public:
134134
HalProvider(QObject *parent = nullptr);
135-
~HalProvider();
136-
bool canAction(Power::Action action) const;
135+
~HalProvider() override;
136+
bool canAction(Power::Action action) const override;
137137

138138
public slots:
139-
bool doAction(Power::Action action);
139+
bool doAction(Power::Action action) override;
140140
};
141141

142142

@@ -145,11 +145,11 @@ class CustomProvider: public PowerProvider
145145
Q_OBJECT
146146
public:
147147
CustomProvider(QObject *parent = nullptr);
148-
~CustomProvider();
149-
bool canAction(Power::Action action) const;
148+
~CustomProvider() override;
149+
bool canAction(Power::Action action) const override;
150150

151151
public slots:
152-
bool doAction(Power::Action action);
152+
bool doAction(Power::Action action) override;
153153

154154
private:
155155
Settings mSettings;

lxqtpowermanager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class LXQT_API MessageBox: public QMessageBox
7777

7878

7979
protected:
80-
virtual void resizeEvent(QResizeEvent* event)
80+
void resizeEvent(QResizeEvent* event) override
8181
{
8282
Q_UNUSED(event)
8383
const QRect screen = QApplication::desktop()->screenGeometry();

lxqtpowermanager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class LXQT_API PowerManager : public QObject
4444

4545
public:
4646
PowerManager(QObject * parent, bool skipWarning = false);
47-
~PowerManager();
47+
~PowerManager() override;
4848
QList<QAction*> availableActions();
4949

5050
public slots:

lxqtrotatedwidget.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ class LXQT_API RotatedWidget: public QWidget
6161

6262
void adjustContentSize();
6363

64-
virtual QSize minimumSizeHint() const;
65-
virtual QSize sizeHint() const;
64+
QSize minimumSizeHint() const override;
65+
QSize sizeHint() const override;
6666

6767
QSize adjustedSize(QSize) const;
6868
QPoint adjustedPoint(QPoint) const;
@@ -92,20 +92,20 @@ class LXQT_API RotatedWidget: public QWidget
9292
void setTransferLeaveEvent(bool value) { mTransferLeaveEvent = value; }
9393

9494
protected:
95-
virtual void paintEvent(QPaintEvent *);
95+
void paintEvent(QPaintEvent *) override;
9696

9797
// Transition event handlers
98-
virtual void mousePressEvent(QMouseEvent *);
99-
virtual void mouseReleaseEvent(QMouseEvent *);
100-
virtual void mouseDoubleClickEvent(QMouseEvent *);
101-
virtual void mouseMoveEvent(QMouseEvent *);
98+
void mousePressEvent(QMouseEvent *) override;
99+
void mouseReleaseEvent(QMouseEvent *) override;
100+
void mouseDoubleClickEvent(QMouseEvent *) override;
101+
void mouseMoveEvent(QMouseEvent *) override;
102102
#ifndef QT_NO_WHEELEVENT
103-
virtual void wheelEvent(QWheelEvent *);
103+
void wheelEvent(QWheelEvent *) override;
104104
#endif
105-
virtual void enterEvent(QEvent *);
106-
virtual void leaveEvent(QEvent *);
105+
void enterEvent(QEvent *) override;
106+
void leaveEvent(QEvent *) override;
107107

108-
virtual void resizeEvent(QResizeEvent *);
108+
void resizeEvent(QResizeEvent *) override;
109109

110110
private:
111111
QWidget *mContent;

lxqtscreensaver.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class LXQT_API ScreenSaver : public QObject
4747

4848
public:
4949
ScreenSaver(QObject * parent=nullptr);
50-
~ScreenSaver();
50+
~ScreenSaver() override;
5151

5252
QList<QAction*> availableActions();
5353

lxqtsettings.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class LXQT_API Settings : public QSettings
6363
explicit Settings(const QSettings* parentSettings, const QString& subGroup, QObject* parent=nullptr);
6464
explicit Settings(const QSettings& parentSettings, const QString& subGroup, QObject* parent=nullptr);
6565
Settings(const QString &fileName, QSettings::Format format, QObject *parent = nullptr);
66-
~Settings();
66+
~Settings() override;
6767

6868
static const GlobalSettings *globalSettings();
6969

@@ -91,7 +91,7 @@ class LXQT_API Settings : public QSettings
9191
void settingsChangedByApp();
9292

9393
protected:
94-
bool event(QEvent *event);
94+
bool event(QEvent *event) override;
9595

9696
protected slots:
9797
/*! Called when the config file is changed */
@@ -196,7 +196,7 @@ class GlobalSettings: public Settings
196196
Q_OBJECT
197197
public:
198198
GlobalSettings();
199-
~GlobalSettings();
199+
~GlobalSettings() override;
200200

201201
signals:
202202
/// Signal emitted when the icon theme has changed.
@@ -206,7 +206,7 @@ class GlobalSettings: public Settings
206206
void lxqtThemeChanged();
207207

208208
protected slots:
209-
void fileChanged();
209+
void fileChanged() override;
210210

211211
private:
212212
GlobalSettingsPrivate* const d_ptr;

lxqtsingleapplication.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class LXQT_API SingleApplication : public Application {
111111
* \sa StartOptions.
112112
*/
113113
SingleApplication(int &argc, char **argv, StartOptions options = ExitOnDBusFailure);
114-
virtual ~SingleApplication();
114+
~SingleApplication() override;
115115

116116
/*!
117117
* \brief Sets the activation window.

0 commit comments

Comments
 (0)