kmail
Go to the documentation of this file.
13 setAllColumnsShowFocus(
true );
14 setAlternatingRowColors(
true );
15 setSelectionMode( QAbstractItemView::SingleSelection );
16 setRootIsDecorated(
false );
17 setContextMenuPolicy( Qt::CustomContextMenu );
18 connect(
this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(slotContextMenu(QPoint)) );
24 QTreeWidget::resizeEvent(e);
30 QTreeWidget::showEvent(e);
35 void ListView::resizeColums()
37 const int c = columnCount();
42 const int w1 = viewport()->width();
43 const int w2 = w1 / c;
44 const int w3 = w1 - (c-1)*w2;
46 for (
int i=0; i<c-1; ++i ) {
47 setColumnWidth( i, w2 );
49 setColumnWidth( c-1, w3 );
52 void ListView::slotContextMenu(
const QPoint& pos)
54 KMenu *menu =
new KMenu(
this );
55 menu->addAction( i18n(
"Add"),
this, SIGNAL(
addHeader()));
57 menu->addAction( i18n(
"Remove"),
this, SIGNAL(
removeHeader()));
59 menu->exec( viewport()->mapToGlobal( pos ) );
63 #include "configuredialoglistview.moc"
void showEvent(QShowEvent *e)
ListView(QWidget *parent=0)
void resizeEvent(QResizeEvent *e)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:51 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.