#include <QPropertyAnimation>
#include <QStyleOption>
-KItemListWidget::KItemListWidget(QGraphicsItem* parent) :
+KItemListWidgetInformant::KItemListWidgetInformant()
+{
+}
+
+KItemListWidgetInformant::~KItemListWidgetInformant()
+{
+}
+
+KItemListWidget::KItemListWidget(KItemListWidgetInformant* informant, QGraphicsItem* parent) :
QGraphicsWidget(parent, 0),
+ m_informant(informant),
m_index(-1),
m_selected(false),
m_current(false),
return QRectF();
}
+QPixmap KItemListWidget::createDragPixmap(const QStyleOptionGraphicsItem* option,
+ QWidget* widget)
+{
+ QPixmap pixmap(size().toSize());
+ pixmap.fill(Qt::transparent);
+
+ QPainter painter(&pixmap);
+
+ const bool oldAlternateBackground = m_alternateBackground;
+ const bool wasSelected = m_selected;
+ const bool wasHovered = m_hovered;
+
+ setAlternateBackground(false);
+ setSelected(false);
+ setHovered(false);
+
+ paint(&painter, option, widget);
+
+ setAlternateBackground(oldAlternateBackground);
+ setSelected(wasSelected);
+ setHovered(wasHovered);
+
+ return pixmap;
+}
+
void KItemListWidget::dataChanged(const QHash<QByteArray, QVariant>& current,
const QSet<QByteArray>& roles)
{