]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistwidget.cpp
Fix selection rect after porting from QFontMetrics::width()
[dolphin.git] / src / kitemviews / kitemlistwidget.cpp
index e8482216d55937fd8981a0c8304891f86d0a6286..42bf9ebdcbb8397cf5feb23a19c766a9b4a36510 100644 (file)
@@ -1,8 +1,7 @@
 /***************************************************************************
  *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
  *                                                                         *
- *   Based on the Itemviews NG project from Trolltech Labs:                *
- *   http://qt.gitorious.org/qt-labs/itemviews-ng                          *
+ *   Based on the Itemviews NG project from Trolltech Labs                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -39,7 +38,7 @@ KItemListWidgetInformant::~KItemListWidgetInformant()
 }
 
 KItemListWidget::KItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent) :
-    QGraphicsWidget(parent, nullptr),
+    QGraphicsWidget(parent),
     m_informant(informant),
     m_index(-1),
     m_selected(false),
@@ -109,7 +108,7 @@ QHash<QByteArray, QVariant> KItemListWidget::data() const
 
 void KItemListWidget::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
 {
-    Q_UNUSED(option);
+    Q_UNUSED(option)
 
     if (m_alternateBackground) {
         const QColor backgroundColor = m_styleOption.palette.color(QPalette::AlternateBase);
@@ -379,7 +378,6 @@ QPixmap KItemListWidget::createDragPixmap(const QStyleOptionGraphicsItem* option
     const bool wasHovered = m_hovered;
 
     setAlternateBackground(false);
-    setSelected(false);
     setHovered(false);
 
     paint(&painter, option, widget);
@@ -394,63 +392,63 @@ QPixmap KItemListWidget::createDragPixmap(const QStyleOptionGraphicsItem* option
 void KItemListWidget::dataChanged(const QHash<QByteArray, QVariant>& current,
                                   const QSet<QByteArray>& roles)
 {
-    Q_UNUSED(current);
-    Q_UNUSED(roles);
+    Q_UNUSED(current)
+    Q_UNUSED(roles)
 }
 
 void KItemListWidget::visibleRolesChanged(const QList<QByteArray>& current,
                                           const QList<QByteArray>& previous)
 {
-    Q_UNUSED(current);
-    Q_UNUSED(previous);
+    Q_UNUSED(current)
+    Q_UNUSED(previous)
 }
 
 void KItemListWidget::columnWidthChanged(const QByteArray& role,
                                          qreal current,
                                          qreal previous)
 {
-    Q_UNUSED(role);
-    Q_UNUSED(current);
-    Q_UNUSED(previous);
+    Q_UNUSED(role)
+    Q_UNUSED(current)
+    Q_UNUSED(previous)
 }
 
 void KItemListWidget::styleOptionChanged(const KItemListStyleOption& current,
                                          const KItemListStyleOption& previous)
 {
-    Q_UNUSED(current);
-    Q_UNUSED(previous);
+    Q_UNUSED(current)
+    Q_UNUSED(previous)
 }
 
 void KItemListWidget::currentChanged(bool current)
 {
-    Q_UNUSED(current);
+    Q_UNUSED(current)
 }
 
 void KItemListWidget::selectedChanged(bool selected)
 {
-    Q_UNUSED(selected);
+    Q_UNUSED(selected)
 }
 
 void KItemListWidget::hoveredChanged(bool hovered)
 {
-    Q_UNUSED(hovered);
+    Q_UNUSED(hovered)
 }
 
 void KItemListWidget::alternateBackgroundChanged(bool enabled)
 {
-    Q_UNUSED(enabled);
+    Q_UNUSED(enabled)
 }
 
 void KItemListWidget::siblingsInformationChanged(const QBitArray& current, const QBitArray& previous)
 {
-    Q_UNUSED(current);
-    Q_UNUSED(previous);
+    Q_UNUSED(current)
+    Q_UNUSED(previous)
 }
 
 void KItemListWidget::editedRoleChanged(const QByteArray& current, const QByteArray& previous)
 {
-    Q_UNUSED(current);
-    Q_UNUSED(previous);
+    Q_UNUSED(current)
+    Q_UNUSED(previous)
 }
 
 void KItemListWidget::resizeEvent(QGraphicsSceneResizeEvent* event)