Diffstat (limited to 'noncore/net/wellenreiter/cornucopia/olistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/olistview.cpp | 14 |
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 | |||
@@ -120,12 +120,17 @@ const QPen& OListView::columnSeparator() const | |||
120 | void OListView::setColumnSeparator( const QPen& p ) | 120 | void OListView::setColumnSeparator( const QPen& p ) |
121 | { | 121 | { |
122 | m_columnSeparator = p; | 122 | m_columnSeparator = p; |
123 | repaint(); | 123 | repaint(); |
124 | } | 124 | } |
125 | 125 | ||
126 | OListViewItem* OListView::childFactory() | ||
127 | { | ||
128 | return new OListViewItem( this ); | ||
129 | } | ||
130 | |||
126 | #ifndef QT_NO_DATASTREAM | 131 | #ifndef QT_NO_DATASTREAM |
127 | void OListView::serializeTo( QDataStream& s ) const | 132 | void OListView::serializeTo( QDataStream& s ) const |
128 | { | 133 | { |
129 | #warning Caution... the binary format is still under construction... | 134 | #warning Caution... the binary format is still under construction... |
130 | qDebug( "storing OListView..." ); | 135 | qDebug( "storing OListView..." ); |
131 | 136 | ||
@@ -177,13 +182,13 @@ void OListView::serializeFrom( QDataStream& s ) | |||
177 | int items; | 182 | int items; |
178 | s >> items; | 183 | s >> items; |
179 | qDebug( "read number of items = %d", items ); | 184 | qDebug( "read number of items = %d", items ); |
180 | 185 | ||
181 | for ( int i = 0; i < items; ++i ) | 186 | for ( int i = 0; i < items; ++i ) |
182 | { | 187 | { |
183 | OListViewItem* item = new OListViewItem( this ); | 188 | OListViewItem* item = childFactory(); |
184 | s >> *item; | 189 | s >> *item; |
185 | } | 190 | } |
186 | 191 | ||
187 | qDebug( "OListView loaded." ); | 192 | qDebug( "OListView loaded." ); |
188 | 193 | ||
189 | } | 194 | } |
@@ -334,12 +339,17 @@ void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, in | |||
334 | 339 | ||
335 | const QPen& pen = static_cast<OListView*>( listView() )->columnSeparator(); | 340 | const QPen& pen = static_cast<OListView*>( listView() )->columnSeparator(); |
336 | p->setPen( pen ); | 341 | p->setPen( pen ); |
337 | p->drawLine( width-1, 0, width-1, height() ); | 342 | p->drawLine( width-1, 0, width-1, height() ); |
338 | } | 343 | } |
339 | 344 | ||
345 | OListViewItem* OListViewItem::childFactory() | ||
346 | { | ||
347 | return new OListViewItem( this ); | ||
348 | } | ||
349 | |||
340 | #ifndef QT_NO_DATASTREAM | 350 | #ifndef QT_NO_DATASTREAM |
341 | void OListViewItem::serializeTo( QDataStream& s ) const | 351 | void OListViewItem::serializeTo( QDataStream& s ) const |
342 | { | 352 | { |
343 | #warning Caution... the binary format is still under construction... | 353 | #warning Caution... the binary format is still under construction... |
344 | qDebug( "storing OListViewItem..." ); | 354 | qDebug( "storing OListViewItem..." ); |
345 | 355 | ||
@@ -385,13 +395,13 @@ void OListViewItem::serializeFrom( QDataStream& s ) | |||
385 | int items; | 395 | int items; |
386 | s >> items; | 396 | s >> items; |
387 | qDebug( "read number of items = %d", items ); | 397 | qDebug( "read number of items = %d", items ); |
388 | 398 | ||
389 | for ( int i = 0; i < items; ++i ) | 399 | for ( int i = 0; i < items; ++i ) |
390 | { | 400 | { |
391 | OListViewItem* item = new OListViewItem( this ); | 401 | OListViewItem* item = childFactory(); |
392 | s >> (*item); | 402 | s >> (*item); |
393 | } | 403 | } |
394 | 404 | ||
395 | qDebug( "OListViewItem loaded." ); | 405 | qDebug( "OListViewItem loaded." ); |
396 | } | 406 | } |
397 | 407 | ||