QTree is too complex (API wise) and it still is impossible to alter the header to look like the qlistview headers which were not whole width. (probably a bug).
All 3 view classes seem overdesigned compared to other toolkits, though.
there was quite a bit of code that was introduced for the sake of design patterns. the model view stuff is better than nothing, but it was over engineered and quite painful to use beyond simple table based database views. Ideally the trolls will figure out how to recover the design and make it usable for more generalized use.
What I'd like is for the wrapper classes to be less shit. Eg. You can insert a string at a specific position of a QListWidget using insert( int, QString ) but there's no way to get it out again without doing a dance with QListWidgetItem. With tree views it's worse.
The trouble with that is that you have to search through the docs for the model-view classes - exactly what the wrapper is supposed to avoid. The wrapper should be usable on its own IMHO, and currently it is not. There's also the issue of the non-orthoganal API - you can set the text directly but not get it back.
This place is a blogging platform for KDE contributors. It only hosts a fraction of KDE contributor's blogs. If you are interested in all of them please visit the agregator at Planet KDE.
Comments
Missing a QListView equivalent
QTree is too complex (API wise) and it still is impossible to alter the header to look like the qlistview headers which were not whole width. (probably a bug).
All 3 view classes seem overdesigned compared to other toolkits, though.
yes, well thats one problem with Qt4
there was quite a bit of code that was introduced for the sake of design patterns. the model view stuff is better than nothing, but it was over engineered and quite painful to use beyond simple table based database views. Ideally the trolls will figure out how to recover the design and make it usable for more generalized use.
ListView headers?
I am not sure what you mean, the ListView doesn't have any headers.
yap
* start Qt3 Designer
* insert a "List View" (Tools->Views->ListView)
* see the "Column 1" thing at the top. Thats what I call a header.
And notice how it is not full width. This seems to be impossible to do with Qt4.
not impossible
If you turn off stretching last section you will get what you are looking for.
view->header()->setStretchLastSection(false);
What I'd like...
What I'd like is for the wrapper classes to be less shit. Eg. You can insert a string at a specific position of a QListWidget using insert( int, QString ) but there's no way to get it out again without doing a dance with QListWidgetItem. With tree views it's worse.
Specifics please
From looking at the docs I would think you should be able to do:
listWidget->insertItem(10, "foo");
delete listWidget->takeItem(10);
Are you thinking of something else?
Yeah I'm thinking of
Yeah I'm thinking of something else. I'd like to be able to go:
listWidget->insertItem(10, QString("Foo") );
Then later:
QString s = listWidget->itemText( 10 );
I'd also like a set of corresponding signals as we had in Qt 3.x.
like this:
listWidget->insertItem(10, QString("Foo") );
QString s = listWidget->item(10)->text();
Many of the signals such as the selectionChanged() are now in the QItemSelectionModel
No, not like that
The trouble with that is that you have to search through the docs for the model-view classes - exactly what the wrapper is supposed to avoid. The wrapper should be usable on its own IMHO, and currently it is not. There's also the issue of the non-orthoganal API - you can set the text directly but not get it back.
Pages