]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemliststyleoption.cpp
Fix selection rect after porting from QFontMetrics::width()
[dolphin.git] / src / kitemviews / kitemliststyleoption.cpp
index 261dfc07b956713c34996af6aaf400c8032ef198..84054aaacc0051c572ecfbaef4c327b6fd92980f 100644 (file)
 
 #include "kitemliststyleoption.h"
 
+
 KItemListStyleOption::KItemListStyleOption() :
-    QStyleOption(QStyleOption::Version, QStyleOption::SO_CustomBase + 1)
+    rect(),
+    font(),
+    fontMetrics(QFont()),
+    palette(),
+    padding(-1),
+    horizontalMargin(-1),
+    verticalMargin(-1),
+    iconSize(-1),
+    extendedSelectionRegion(false),
+    maxTextLines(0),
+    maxTextWidth(0)
 {
 }
 
-KItemListStyleOption::KItemListStyleOption(const KItemListStyleOption& other) :
-    QStyleOption(other)
+KItemListStyleOption::~KItemListStyleOption()
 {
-    margin = other.margin;
-    iconSize = other.iconSize;
-    font = other.font;
 }
 
-KItemListStyleOption::~KItemListStyleOption()
+bool KItemListStyleOption::operator==(const KItemListStyleOption& other) const
+{
+    return rect == other.rect
+            && font == other.font
+            && fontMetrics == other.fontMetrics
+            && palette == other.palette
+            && padding == other.padding
+            && horizontalMargin == other.horizontalMargin
+            && verticalMargin == other.verticalMargin
+            && iconSize == other.iconSize
+            && extendedSelectionRegion == other.extendedSelectionRegion
+            && maxTextLines == other.maxTextLines
+            && maxTextWidth == other.maxTextWidth;
+}
+
+bool KItemListStyleOption::operator!=(const KItemListStyleOption& other) const
 {
+    return !(*this == other);
 }