From 50e4e1e8876372bf9dbb0c32acc93c65434738d5 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Sat, 28 Jun 2003 14:11:46 +0000 Subject: support OListViewItem specific overload of expand to give those the chance to compute stuff "just in time" - this is also known as lazy computation patch by tille --- diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp index 8f290d3..ec503dd 100644 --- a/libopie2/opieui/olistview.cpp +++ b/libopie2/opieui/olistview.cpp @@ -51,6 +51,7 @@ OListView::OListView( QWidget *parent, const char *name ) m_alternateBackground = QColor( 238, 246, 255 ); m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); m_fullWidth = true; + connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); } OListView::~OListView() @@ -127,6 +128,11 @@ void OListView::setColumnSeparator( const QPen& p ) repaint(); } +void OListView::expand(QListViewItem *item) +{ + ((OListViewItem*)item)->expand(); +} + OListViewItem* OListView::childFactory() { return new OListViewItem( this ); diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h index 109e309..a00b43a 100644 --- a/libopie2/opieui/olistview.h +++ b/libopie2/opieui/olistview.h @@ -122,6 +122,12 @@ class OListView: public QListView virtual void serializeFrom( QDataStream& s ); #endif +protected slots: + /** + * expand the current OListViewItem + */ + void expand(QListViewItem*); + private: QColor m_alternateBackground; bool m_fullWidth; @@ -220,6 +226,11 @@ class OListViewItem: public QListViewItem virtual void serializeFrom( QDataStream& s ); #endif + /** + * expand the the item + */ + virtual void expand(){}; + private: bool m_known; bool m_odd; -- cgit v0.9.0.2