diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index b10b627c7..fc7c39a95 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -36,6 +36,10 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent) m_itemScene(new QGraphicsScene(this)), m_draging(false), + + m_smallIcon(QPixmap()), + m_largeIcon(QPixmap()), + m_horizontalIndicator(QPixmap(":/indicator/resources/indicator.png")), m_verticalIndicator(QPixmap(":/indicator/resources/indicator_ver.png")), m_activeHorizontalIndicator(QPixmap(":/indicator/resources/indicator_active.png")), @@ -251,8 +255,11 @@ void AppItem::paintEvent(QPaintEvent *e) // icon const QPixmap pixmap = DockDisplayMode == Efficient ? m_smallIcon : m_largeIcon; + if (pixmap.isNull()) + return; + // icon pos - QPointF iconPos = itemRect.center() - QRectF(pixmap.rect()).center(); + const QPointF iconPos = itemRect.center() - QRectF(pixmap.rect()).center(); // draw ligher/normal icon if (!m_hover) diff --git a/plugins/network/item/wireditem.h b/plugins/network/item/wireditem.h index 50f1823cc..23524f523 100644 --- a/plugins/network/item/wireditem.h +++ b/plugins/network/item/wireditem.h @@ -14,18 +14,18 @@ class WiredItem : public DeviceItem public: explicit WiredItem(const QUuid &deviceUuid); - NetworkDevice::NetworkType type() const; - NetworkDevice::NetworkState state() const; - QWidget *itemPopup(); + NetworkDevice::NetworkType type() const override; + NetworkDevice::NetworkState state() const override; + QWidget *itemPopup() override; const QString itemCommand() const override; protected: - void paintEvent(QPaintEvent *e); - void resizeEvent(QResizeEvent *e); - void mousePressEvent(QMouseEvent *e); + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; private slots: - void refreshIcon(); + void refreshIcon() override; void reloadIcon(); void activeConnectionChanged(const QUuid &uuid); void deviceStateChanged(const NetworkDevice &device);