summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/cornucopia/olistview.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/cornucopia/olistview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/cornucopia/olistview.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.cpp b/noncore/net/wellenreiter/cornucopia/olistview.cpp
index f2d3730..c292eb9 100644
--- a/noncore/net/wellenreiter/cornucopia/olistview.cpp
+++ b/noncore/net/wellenreiter/cornucopia/olistview.cpp
@@ -122,8 +122,13 @@ void OListView::setColumnSeparator( const QPen& p )
m_columnSeparator = p;
repaint();
}
+OListViewItem* OListView::childFactory()
+{
+ return new OListViewItem( this );
+}
+
#ifndef QT_NO_DATASTREAM
void OListView::serializeTo( QDataStream& s ) const
{
#warning Caution... the binary format is still under construction...
@@ -179,9 +184,9 @@ void OListView::serializeFrom( QDataStream& s )
qDebug( "read number of items = %d", items );
for ( int i = 0; i < items; ++i )
{
- OListViewItem* item = new OListViewItem( this );
+ OListViewItem* item = childFactory();
s >> *item;
}
qDebug( "OListView loaded." );
@@ -336,8 +341,13 @@ void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in
p->setPen( pen );
p->drawLine( width-1, 0, width-1, height() );
}
+OListViewItem* OListViewItem::childFactory()
+{
+ return new OListViewItem( this );
+}
+
#ifndef QT_NO_DATASTREAM
void OListViewItem::serializeTo( QDataStream& s ) const
{
#warning Caution... the binary format is still under construction...
@@ -387,9 +397,9 @@ void OListViewItem::serializeFrom( QDataStream& s )
qDebug( "read number of items = %d", items );
for ( int i = 0; i < items; ++i )
{
- OListViewItem* item = new OListViewItem( this );
+ OListViewItem* item = childFactory();
s >> (*item);
}
qDebug( "OListViewItem loaded." );