#include <QApplication>
#include <Q3ListView>
class MyListViewItem : public Q3ListViewItem {
public:
MyListViewItem
(Q3ListView
*parent,
const QString &label1
) : Q3ListViewItem
(parent, label1
) {} MyListViewItem
(Q3ListViewItem
*parent,
const QString &label1
) : Q3ListViewItem
(parent, label1
) {} void paintBranches
(QPainter *p,
const QColorGroup
&cg,
int w,
int y,
int h
) { Q3ListViewItem::paintBranches(p, cg, w-7, y, h);
}
};
int
main( int argc, char* argv[] )
{
Q3ListView w;
w.setRootIsDecorated( true );
w.addColumn( "col" );
w.show();
MyListViewItem* item1 = new MyListViewItem( &w, "item1" );
MyListViewItem* item2 = new MyListViewItem( item1, "item2" );
MyListViewItem* item3 = new MyListViewItem( item2, "item3" );
MyListViewItem* item4 = new MyListViewItem( item3, "item4" );
QObject::connect( qApp,
SIGNAL( lastWindowClosed
() ),
qApp,
SLOT( quit
() ) );
return app.exec();
}
#include <QApplication>
#include <Q3ListView>
class MyListViewItem : public Q3ListViewItem {
public:
MyListViewItem(Q3ListView *parent, const QString &label1) : Q3ListViewItem(parent, label1) {}
MyListViewItem(Q3ListViewItem *parent, const QString &label1) : Q3ListViewItem(parent, label1) {}
void paintBranches(QPainter *p, const QColorGroup &cg, int w, int y, int h) {
Q3ListViewItem::paintBranches(p, cg, w-7, y, h);
}
};
int
main( int argc, char* argv[] )
{
QApplication app( argc, argv );
Q3ListView w;
w.setRootIsDecorated( true );
w.addColumn( "col" );
w.show();
MyListViewItem* item1 = new MyListViewItem( &w, "item1" );
MyListViewItem* item2 = new MyListViewItem( item1, "item2" );
MyListViewItem* item3 = new MyListViewItem( item2, "item3" );
MyListViewItem* item4 = new MyListViewItem( item3, "item4" );
QObject::connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks