From 8347d4e0bd922e3088ef2d08a47e08bdeff1ab4e Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 7 Sep 2012 11:58:34 +0200 Subject: Doc: Use QStyledItemDelegate and frameless spinboxes in spinbox delegate example Task-number: QTBUG-18847 Change-Id: I5347a1028b6f45a60e43fb75f6d362efecb6880b Reviewed-by: Qt Doc Bot Reviewed-by: Marius Bugge Monsen Reviewed-by: Geir Vattekar --- examples/widgets/itemviews/spinboxdelegate/delegate.cpp | 3 ++- examples/widgets/itemviews/spinboxdelegate/delegate.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'examples/widgets/itemviews/spinboxdelegate') diff --git a/examples/widgets/itemviews/spinboxdelegate/delegate.cpp b/examples/widgets/itemviews/spinboxdelegate/delegate.cpp index 2967b6ae38..974ec265fb 100644 --- a/examples/widgets/itemviews/spinboxdelegate/delegate.cpp +++ b/examples/widgets/itemviews/spinboxdelegate/delegate.cpp @@ -52,7 +52,7 @@ //! [0] SpinBoxDelegate::SpinBoxDelegate(QObject *parent) - : QItemDelegate(parent) + : QStyledItemDelegate(parent) { } //! [0] @@ -63,6 +63,7 @@ QWidget *SpinBoxDelegate::createEditor(QWidget *parent, const QModelIndex &/* index */) const { QSpinBox *editor = new QSpinBox(parent); + editor->setFrame(false); editor->setMinimum(0); editor->setMaximum(100); diff --git a/examples/widgets/itemviews/spinboxdelegate/delegate.h b/examples/widgets/itemviews/spinboxdelegate/delegate.h index 19d647043d..56c21962b4 100644 --- a/examples/widgets/itemviews/spinboxdelegate/delegate.h +++ b/examples/widgets/itemviews/spinboxdelegate/delegate.h @@ -41,14 +41,14 @@ #ifndef DELEGATE_H #define DELEGATE_H -#include +#include #include #include #include #include //! [0] -class SpinBoxDelegate : public QItemDelegate +class SpinBoxDelegate : public QStyledItemDelegate { Q_OBJECT -- cgit v1.2.3