modernize: Prefer default member init over ctor init
[quassel.git] / src / qtui / chatline.h
index 8fde09d..1fdedd5 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2013 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -34,11 +34,11 @@ public:
         const qreal &width,
         const qreal &timestampWidth, const qreal &senderWidth, const qreal &contentsWidth,
         const QPointF &senderPos, const QPointF &contentsPos,
-        QGraphicsItem *parent = 0);
+        QGraphicsItem *parent = nullptr);
 
-    virtual ~ChatLine();
+    ~ChatLine() override;
 
-    virtual inline QRectF boundingRect() const { return QRectF(0, 0, _width, _height); }
+    inline QRectF boundingRect() const override { return QRectF(0, 0, _width, _height); }
 
     inline QModelIndex index() const { return model()->index(row(), 0); }
     inline MsgId msgId() const { return index().data(MessageModel::MsgIdRole).value<MsgId>(); }
@@ -49,7 +49,7 @@ public:
 
     inline const QAbstractItemModel *model() const { return _model; }
     inline ChatScene *chatScene() const { return qobject_cast<ChatScene *>(scene()); }
-    inline ChatView *chatView() const { return chatScene() ? chatScene()->chatView() : 0; }
+    inline ChatView *chatView() const { return chatScene() ? chatScene()->chatView() : nullptr; }
 
     inline qreal width() const { return _width; }
     inline qreal height() const { return _height; }
@@ -60,9 +60,9 @@ public:
     inline ChatItem *senderItem() { return &_senderItem; }
     inline ContentsChatItem *contentsItem() { return &_contentsItem; }
 
-    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
     enum { Type = ChatScene::ChatLineType };
-    virtual inline int type() const { return Type; }
+    inline int type() const override { return Type; }
 
     // pos is relative to the parent ChatLine
     void setFirstColumn(const qreal &timestampWidth, const qreal &senderWidth, const QPointF &senderPos);
@@ -77,15 +77,15 @@ public:
     void clearCache();
 
 protected:
-    virtual bool sceneEvent(QEvent *event);
+    bool sceneEvent(QEvent *event) override;
 
     // These need to be relayed to the appropriate ChatItem
-    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
-    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
-    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-    virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
-    virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
-    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
+    void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+    void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
+    void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
+    void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
+    void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
 
     ChatItem *mouseEventTargetItem(const QPointF &pos);