diff --git a/components/styleitem/qstyleitem.cpp b/components/styleitem/qstyleitem.cpp index 72dd3b9b7e5bb2e4a864402593e161138612bad4..80f24f8c183c8e7d303ba9f7193dd2fc3574411f 100644 --- a/components/styleitem/qstyleitem.cpp +++ b/components/styleitem/qstyleitem.cpp @@ -131,6 +131,13 @@ void QStyleItem::initStyleOption() } break; + case Splitter: { + if (!m_styleoption) { + m_styleoption = new QStyleOption; + } + } + break; + case Item: { if (!m_styleoption) { m_styleoption = new QStyleOptionViewItemV4(); @@ -753,6 +760,9 @@ void QStyleItem::setElementType(const QString &str) m_dummywidget = new QComboBox(); visible = true; m_itemType = ComboBox; + } else if (str == "splitter") { + visible = true; + m_itemType = Splitter; } else if (str == "progressbar") { m_dummywidget = new QProgressBar(); visible = true; @@ -949,6 +959,9 @@ void QStyleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWid case Widget: qApp->style()->drawPrimitive(QStyle::PE_Widget, m_styleoption, painter, widget()); break; + case Splitter: + qApp->style()->drawControl(QStyle::CE_Splitter, m_styleoption, painter, widget()); + break; case ComboBox: qApp->style()->drawComplexControl(QStyle::CC_ComboBox, qstyleoption_cast<QStyleOptionComplex*>(m_styleoption), diff --git a/components/styleitem/qstyleitem.h b/components/styleitem/qstyleitem.h index da56942d94a6938e63703c867c2cb0f2a124c7d5..1b9f9c875ac141a5e8c4ce1a75f7ec8e005e9334 100644 --- a/components/styleitem/qstyleitem.h +++ b/components/styleitem/qstyleitem.h @@ -100,6 +100,7 @@ public: Header, Item, ItemRow, + Splitter, Menu, MenuItem, Widget diff --git a/examples/ItemViewGallery.qml b/examples/ItemViewGallery.qml index 13ed6230e6f0ddbaa77dead3bbb83c3fd95a9d4b..e6077f27c0b59a9678a45b7c02a46ab11fa993e1 100644 --- a/examples/ItemViewGallery.qml +++ b/examples/ItemViewGallery.qml @@ -186,9 +186,9 @@ Rectangle { ListModel { id: delegatemenu - ListElement { text: "Shiny" } - ListElement { text: "Scale" } - ListElement { text: "Editable" } + ListElement { text: "Shiny delegate" } + ListElement { text: "Scale selected" } + ListElement { text: "Editable items" } } Component { @@ -207,8 +207,6 @@ Rectangle { } } - - Component { id: slickRowDelegate Rectangle{