QListView: how to adding column text?
In Q3ListView, setColumnText() is used to set the name of each column. But this is removed in QListView. Is there a way to set up it?
Also, is there a way to set the height of text bar for each column in Q3ListView? All the letters "g" and "q" are but at bottom. how about in QListView?
thank you,
Re: QListView: how to adding column text?
As the QListView docs say:
Quote:
This view does not display horizontal or vertical headers; to display a list of items with a horizontal header, use
QTreeView instead.
The default column and row heading would typically be provided by the underlying model in Qt4/Qt5 and displayed in the default QHeaderView. You can replace the default QHeaderView or the data underlying it if you wish.
If you use the QTreeWidget subclass then the internal model's headers are accessed with QTreeWidget::setHeaderLabel().
Re: QListView: how to adding column text?
As ChrisW67 said use a QTreeWidget or QTreeView.
It is the equivalent of Qt3's QListView.
Qt4 and Qt5's QListView is more like Qt3's QListBox
Cheers,
_