summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/olistview.cpp6
-rw-r--r--libopie2/opieui/olistview.h11
2 files changed, 17 insertions, 0 deletions
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
@@ -48,12 +48,13 @@ OListView::OListView( QWidget *parent, const char *name )
{
//FIXME: get from global settings and calculate ==> see oglobalsettings.*
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()
{
}
@@ -124,12 +125,17 @@ const QPen& OListView::columnSeparator() const
void OListView::setColumnSeparator( const QPen& p )
{
m_columnSeparator = p;
repaint();
}
+void OListView::expand(QListViewItem *item)
+{
+ ((OListViewItem*)item)->expand();
+}
+
OListViewItem* OListView::childFactory()
{
return new OListViewItem( this );
}
#ifndef QT_NO_DATASTREAM
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
@@ -119,12 +119,18 @@ class OListView: public QListView
/**
* Serialize this object from a @ref QDataStream @a stream
*/
virtual void serializeFrom( QDataStream& s );
#endif
+protected slots:
+ /**
+ * expand the current OListViewItem
+ */
+ void expand(QListViewItem*);
+
private:
QColor m_alternateBackground;
bool m_fullWidth;
QPen m_columnSeparator;
};
@@ -217,12 +223,17 @@ class OListViewItem: public QListViewItem
* serialize this object to or from a @ref QDataStream
* @param s the stream used to serialize this object.
*/
virtual void serializeFrom( QDataStream& s );
#endif
+ /**
+ * expand the the item
+ */
+ virtual void expand(){};
+
private:
bool m_known;
bool m_odd;
};
#ifndef QT_NO_DATASTREAM