Skip to content

Commit

Permalink
Use override
Browse files Browse the repository at this point in the history
Adds C++11 override to overridden virtual functions and removes virtual
from those functions as it is not required.
  • Loading branch information
luis-pereira committed Dec 1, 2020
1 parent eaabbb0 commit 9c436cb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion panel/lxqtpanellayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ItemMoveAnimation : public QVariantAnimation
setDuration(ANIMATION_DURATION);
}

void updateCurrentValue(const QVariant &current)
void updateCurrentValue(const QVariant &current) override
{
mItem->setGeometry(current.toRect());
}
Expand Down
4 changes: 2 additions & 2 deletions plugin-kbindicator/kbindicator-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class LXQtKbIndicatorPlugin: public QObject, public ILXQtPanelPluginLibrary
Q_PLUGIN_METADATA(IID "lxqt.org/Panel/PluginInterface/3.0")
Q_INTERFACES(ILXQtPanelPluginLibrary)
public:
virtual ~LXQtKbIndicatorPlugin()
~LXQtKbIndicatorPlugin() override
{}

virtual ILXQtPanelPlugin *instance(const ILXQtPanelPluginStartupInfo &startupInfo) const
ILXQtPanelPlugin *instance(const ILXQtPanelPluginStartupInfo &startupInfo) const override
{
// Currently only X11 supported
if (!QX11Info::connection()) {
Expand Down
4 changes: 2 additions & 2 deletions plugin-kbindicator/src/x11/kbdlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class X11Kbd: public QAbstractNativeEventFilter
return true;
}

virtual ~X11Kbd()
~X11Kbd() override
{
xkb_state_unref(m_state);
xkb_keymap_unref(m_keymap);
Expand All @@ -97,7 +97,7 @@ class X11Kbd: public QAbstractNativeEventFilter
bool isEnabled() const
{ return true; }

virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *)
bool nativeEventFilter(const QByteArray &eventType, void *message, long *) override
{
if (eventType != "xcb_generic_event_t")
return false;
Expand Down
4 changes: 2 additions & 2 deletions plugin-mainmenu/actionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace
{
public:
using QProxyStyle::QProxyStyle;
virtual int styleHint(StyleHint hint, const QStyleOption * option = nullptr, const QWidget * widget = nullptr, QStyleHintReturn * returnData = nullptr) const override
int styleHint(StyleHint hint, const QStyleOption * option = nullptr, const QWidget * widget = nullptr, QStyleHintReturn * returnData = nullptr) const override
{
if(hint == QStyle::SH_ItemView_ActivateItemOnSingleClick)
return 1;
Expand All @@ -101,7 +101,7 @@ namespace
mMaxItemWidth = max;
}

virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override
{
QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
//the XdgCachedMenuAction/XdgAction does load the icon upon showing its menu
Expand Down
2 changes: 1 addition & 1 deletion plugin-statusnotifier/statusnotifierbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace
using DBusMenuImporter::DBusMenuImporter;

protected:
virtual QIcon iconForName(const QString & name) override
QIcon iconForName(const QString & name) override
{
return XdgIcon::fromTheme(name);
}
Expand Down

0 comments on commit 9c436cb

Please sign in to comment.