Index: kdefx/kstyle.cpp
===================================================================
--- kdefx/kstyle.cpp	(revisión: 658384)
+++ kdefx/kstyle.cpp	(copia de trabajo)
@@ -199,6 +199,8 @@ KStyle::KStyle() : clickedLabel(0)
     setWidgetLayoutProp(WT_Window, Window::ButtonWidth, 16);
     setWidgetLayoutProp(WT_Window, Window::ButtonSpace, 2);
     setWidgetLayoutProp(WT_Window, Window::ButtonToTextSpace, 3);
+
+    setWidgetLayoutProp(WT_Category, Category::ContentsMargin, 5);
 }
 
 KStyle::~KStyle()
@@ -432,6 +434,35 @@ void KStyle::drawKStylePrimitive(WidgetT
             break;
         }
 
+        case WT_Category:
+        {
+            if (KStyle::TextOption *textOpt = extractOption<KStyle::TextOption*>(kOpt))
+            {
+                QFont painterFont = p->font();
+                painterFont.setWeight(QFont::Bold);
+                QFontMetrics metrics(painterFont);
+                p->setFont(painterFont);
+
+                QPainterPath path;
+                path.addRect(opt->rect.left(),
+                             opt->rect.bottom() - 2,
+                             opt->rect.width(),
+                             2);
+
+                QLinearGradient gradient(opt->rect.topLeft(),
+                                        opt->rect.bottomRight());
+                gradient.setColorAt(0, Qt::black);
+                gradient.setColorAt(1, Qt::white);
+
+                p->setBrush(gradient);
+                p->fillPath(path, gradient);
+
+                p->drawText(opt->rect, textOpt->hAlign, textOpt->text);
+            }
+
+            break;
+        }
+
         default:
             break;
     }
@@ -820,7 +851,7 @@ void KStyle::drawPrimitive(PrimitiveElem
     QCommonStyle::drawPrimitive(elem, option, painter, widget);
 }
 
-void KStyle::drawControl(ControlElement element, const QStyleOption* option, QPainter* p, const QWidget* widget) const
+void KStyle::drawControl(QStyle::ControlElement element, const QStyleOption* option, QPainter* p, const QWidget* widget) const
 {
     //Extract the stuff we need out of the option
     State flags = option->state;
@@ -1910,6 +1941,32 @@ void KStyle::drawControl(ControlElement 
     QCommonStyle::drawControl(element, option, p, widget);
 }
 
+void KStyle::drawControl (KStyle::ControlElement elem, const QStyleOption* option, QPainter* p, const QWidget* widget) const
+{
+    //Extract the stuff we need out of the option
+    State flags = option->state;
+    QRect      r     = option->rect;
+    QPalette   pal   = option->palette;
+
+    switch(elem)
+    {
+        case CE_Category:
+        {
+            if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton*>(option))
+            {
+                TextOption textOpt;
+                textOpt.hAlign = Qt::AlignLeft;
+                textOpt.text = button->text;
+
+                drawKStylePrimitive(WT_Category, Category::Title, option, r, pal, flags, p, widget, &textOpt);
+            }
+            return;
+        }
+
+        default:
+            break;
+    }
+}
 
 int KStyle::styleHint (StyleHint hint, const QStyleOption* option, const QWidget* widget, QStyleHintReturn* returnData) const
 {
@@ -3545,11 +3602,17 @@ QSize KStyle::sizeFromContents(ContentsT
                 return expandDim(QSize(w, h), WT_Header, Header::ContentsMargin, option, widget);
             }
         }
+
+        /*case KStyle::CT_Category:
+        {
+            return expandDim(QSize(option->rect.width(), option->rect.height()), WT_Category, Category::ContentsMargin, option, widget);
+        }*/
+
         default:
             break;
     }
 
-    return QCommonStyle::sizeFromContents(type, option, contentsSize, widget);
+    return QCommonStyle::sizeFromContents((QStyle::ContentsType) type, option, contentsSize, widget);
 }
 
 bool KStyle::eventFilter(QObject *obj, QEvent *ev)
Index: kdefx/kstyle.h
===================================================================
--- kdefx/kstyle.h	(revisión: 658384)
+++ kdefx/kstyle.h	(copia de trabajo)
@@ -38,6 +38,7 @@
 #include <kdefx_export.h>
 
 #include <QtGui/QCommonStyle>
+#include <QtGui/QStyleOption>
 #include <QtGui/QColorGroup>
 #include <QtGui/QStyleFactoryInterface>
 
@@ -88,6 +89,11 @@ public:
     KStyle();
     ~KStyle();
 
+
+    enum ControlElement {
+        CE_Category = 0xf0000001
+    };
+
 protected:
     /** @name Helper Methods
     * These are methods helping with QRect handling, for example.
@@ -396,10 +402,10 @@ protected:
         WT_ToolButton,      ///< @sa ToolButton
         WT_ToolBoxTab,      ///< @sa ToolBoxTab
         WT_Window,          ///< @sa Window
+        WT_Category,        ///< @sa Category
         WT_Limit = 0xFFFF ///< For enum extensibility
     };
 
-                
     /**
      These constants describe how to access various fields of a margin property.
      For example, to set an additional top margin of 2 pixels, use
@@ -1422,6 +1428,30 @@ protected:
             ButtonHelp      ///< context help button, passes TitleButtonOption
         };
     };
+
+    /**
+     * @brief Describes categories in KListView.
+     *
+     * @sa WT_Category
+     */
+    struct Category
+    {
+        /**
+         * @sa setWidgetLayoutProp()
+         */
+        enum LayoutProps
+        {
+            ContentsMargin ///< space between the text and the margin
+        };
+
+        /**
+         * @sa drawKStylePrimitive()
+         */
+        enum Primitive
+        {
+            Title,       ///< category title
+        };
+    };
 //@}
 
     ///Interface for the style to configure various metrics that KStyle has customizable.
@@ -1533,7 +1563,8 @@ public:
  * the implementation from QCommonStyle.
  */
 //@{
-    void drawControl      (ControlElement   elem, const QStyleOption* opt, QPainter* p, const QWidget* w) const;
+    void drawControl      (QStyle::ControlElement   elem, const QStyleOption* opt, QPainter* p, const QWidget* w) const;
+    void drawControl      (KStyle::ControlElement   elem, const QStyleOption* opt, QPainter* p, const QWidget* w) const;
     void drawPrimitive    (PrimitiveElement elem, const QStyleOption* opt, QPainter* p, const QWidget* w) const;
     int  pixelMetric      (PixelMetric    metric, const QStyleOption* opt = 0, const QWidget* w = 0) const;
     QRect subElementRect  (SubElement    subRect, const QStyleOption* opt, const QWidget* w) const;
Index: kstyles/plastik/plastik.cpp
===================================================================
--- kstyles/plastik/plastik.cpp	(revisión: 658384)
+++ kstyles/plastik/plastik.cpp	(copia de trabajo)
@@ -256,7 +256,6 @@ void PlastikStyle::drawKStylePrimitive(W
 
     switch (widgetType)
     {
-
         case WT_PushButton:
         {
             switch (primitive)
@@ -1607,6 +1606,26 @@ void PlastikStyle::drawKStylePrimitive(W
         }
         break;
 
+        case WT_Category:
+        {
+            if (KStyle::TextOption *textOpt = extractOption<KStyle::TextOption*>(kOpt))
+            {
+                QFont painterFont = p->font();
+                painterFont.setWeight(QFont::Bold);
+                QFontMetrics metrics(painterFont);
+                p->setFont(painterFont);
+
+                QLinearGradient gradient(r.topLeft(),
+                                         r.bottomRight());
+                gradient.setColorAt(0, Qt::white);
+                gradient.setColorAt(1, Qt::black);
+
+                p->fillRect(r, gradient);
+
+                p->drawText(opt->rect, textOpt->hAlign, textOpt->text);
+            }
+            return;
+        }
     }
 
 
