From 61197b9d3d9028a062edb72c1487b214600cceda Mon Sep 17 00:00:00 2001 From: listenerri Date: Tue, 4 Dec 2018 13:31:51 +0800 Subject: [PATCH] fix: build warning Change-Id: I57b1e5a68f699fface1ed542813791013020691e --- frame/item/appitem.h | 12 ++++++------ frame/item/components/appsnapshot.cpp | 1 - plugins/datetime/datetimeplugin.h | 4 ++-- plugins/power/powerplugin.h | 4 ++-- plugins/shutdown/shutdownplugin.h | 4 ++-- plugins/trash/trashplugin.h | 24 ++++++++++++------------ plugins/trash/trashwidget.h | 14 +++++++------- plugins/tray/indicatortray.cpp | 2 +- 8 files changed, 32 insertions(+), 33 deletions(-) diff --git a/frame/item/appitem.h b/frame/item/appitem.h index e4f58b2e1..00cf503b9 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -55,7 +55,7 @@ public: QWidget *appDragWidget(); void setDockInfo(Dock::Position dockPosition, const QRect &dockGeometry); - inline ItemType itemType() const { return App; } + inline ItemType itemType() const Q_DECL_OVERRIDE { return App; } signals: void requestActivateWindow(const WId wid) const; @@ -77,17 +77,17 @@ private: void leaveEvent(QEvent *e) override; void showEvent(QShowEvent *e) override; - void showHoverTips(); - void invokedMenuItem(const QString &itemId, const bool checked); - const QString contextMenu() const; - QWidget *popupTips(); + void showHoverTips() Q_DECL_OVERRIDE; + void invokedMenuItem(const QString &itemId, const bool checked) Q_DECL_OVERRIDE; + const QString contextMenu() const Q_DECL_OVERRIDE; + QWidget *popupTips() Q_DECL_OVERRIDE; void startDrag(); bool hasAttention() const; private slots: void updateWindowInfos(const WindowInfoMap &info); - void refershIcon(); + void refershIcon() Q_DECL_OVERRIDE; void activeChanged(); void showPreview(); void cancelAndHidePreview(); diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index 38438966f..ad874f3b6 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -236,7 +236,6 @@ void AppSnapshot::paintEvent(QPaintEvent *e) if (m_snapshot.isNull()) return; - const QRect r = rect().marginsRemoved(QMargins(8, 8, 8, 8)); const auto ratio = devicePixelRatioF(); // draw attention background diff --git a/plugins/datetime/datetimeplugin.h b/plugins/datetime/datetimeplugin.h index a8b946031..53b598538 100644 --- a/plugins/datetime/datetimeplugin.h +++ b/plugins/datetime/datetimeplugin.h @@ -47,8 +47,8 @@ public: bool pluginIsAllowDisable() override { return true; } bool pluginIsDisable() override; - int itemSortKey(const QString &itemKey); - void setSortKey(const QString &itemKey, const int order); + int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE; + void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE; QWidget *itemWidget(const QString &itemKey) override; QWidget *itemTipsWidget(const QString &itemKey) override; diff --git a/plugins/power/powerplugin.h b/plugins/power/powerplugin.h index a7cf54c79..546082763 100644 --- a/plugins/power/powerplugin.h +++ b/plugins/power/powerplugin.h @@ -55,8 +55,8 @@ public: const QString itemContextMenu(const QString &itemKey) override; void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override; - int itemSortKey(const QString &itemKey); - void setSortKey(const QString &itemKey, const int order); + int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE; + void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE; private: void updateBatteryVisible(); diff --git a/plugins/shutdown/shutdownplugin.h b/plugins/shutdown/shutdownplugin.h index c77453ee5..ec6419245 100644 --- a/plugins/shutdown/shutdownplugin.h +++ b/plugins/shutdown/shutdownplugin.h @@ -52,8 +52,8 @@ public: void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) override; void displayModeChanged(const Dock::DisplayMode displayMode) override; - int itemSortKey(const QString &itemKey); - void setSortKey(const QString &itemKey, const int order); + int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE; + void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE; private: void requestContextMenu(const QString &itemKey); diff --git a/plugins/trash/trashplugin.h b/plugins/trash/trashplugin.h index 7fdff21e7..b3c28a0ef 100644 --- a/plugins/trash/trashplugin.h +++ b/plugins/trash/trashplugin.h @@ -42,20 +42,20 @@ class TrashPlugin : public QObject, PluginsItemInterface public: explicit TrashPlugin(QObject *parent = 0); - const QString pluginName() const; - void init(PluginProxyInterface *proxyInter); + const QString pluginName() const Q_DECL_OVERRIDE; + void init(PluginProxyInterface *proxyInter) Q_DECL_OVERRIDE; - QWidget *itemWidget(const QString &itemKey); - QWidget *itemTipsWidget(const QString &itemKey); - QWidget *itemPopupApplet(const QString &itemKey); - const QString itemCommand(const QString &itemKey); - const QString itemContextMenu(const QString &itemKey); - void refreshIcon(const QString &itemKey); - void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked); + QWidget *itemWidget(const QString &itemKey) Q_DECL_OVERRIDE; + QWidget *itemTipsWidget(const QString &itemKey) Q_DECL_OVERRIDE; + QWidget *itemPopupApplet(const QString &itemKey) Q_DECL_OVERRIDE; + const QString itemCommand(const QString &itemKey) Q_DECL_OVERRIDE; + const QString itemContextMenu(const QString &itemKey) Q_DECL_OVERRIDE; + void refreshIcon(const QString &itemKey) Q_DECL_OVERRIDE; + void invokedMenuItem(const QString &itemKey, const QString &menuId, const bool checked) Q_DECL_OVERRIDE; - int itemSortKey(const QString &itemKey) override; - void setSortKey(const QString &itemKey, const int order) override; - void displayModeChanged(const Dock::DisplayMode displayMode); + int itemSortKey(const QString &itemKey) Q_DECL_OVERRIDE; + void setSortKey(const QString &itemKey, const int order) Q_DECL_OVERRIDE; + void displayModeChanged(const Dock::DisplayMode displayMode) Q_DECL_OVERRIDE; private: void showContextMenu(); diff --git a/plugins/trash/trashwidget.h b/plugins/trash/trashwidget.h index eee0b18ac..c9290b357 100644 --- a/plugins/trash/trashwidget.h +++ b/plugins/trash/trashwidget.h @@ -43,7 +43,7 @@ public: QWidget *popupApplet(); - QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; const QString contextMenu() const; int trashItemCount() const; void invokeMenuItem(const QString &menuId, const bool checked); @@ -53,12 +53,12 @@ signals: void requestContextMenu() const; protected: - void dragEnterEvent(QDragEnterEvent *e) override; - void dragMoveEvent(QDragMoveEvent *e) override; - void dropEvent(QDropEvent *e) override; - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); - void mousePressEvent(QMouseEvent *e); + void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE; + void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; private slots: void removeApp(const QString &appKey); diff --git a/plugins/tray/indicatortray.cpp b/plugins/tray/indicatortray.cpp index b5173fffe..98c75be3c 100644 --- a/plugins/tray/indicatortray.cpp +++ b/plugins/tray/indicatortray.cpp @@ -109,7 +109,7 @@ public: void IndicatorTrayPrivate::init() { - Q_Q(IndicatorTray); + //Q_Q(IndicatorTray); indicatorTrayWidget = new IndicatorTrayWidget(itemKey);