Hi guys,
Have someone tried this?
Hi guys,
Have someone tried this?
What's there to try? QListBox equivalent in Qt4 is QListWidget. The API doesn't differ that much, so it should be easy for you to port it.
The problem here is with QListBoxItem. In 2.2.0, I use my own class inherits from QListBoxItem, and I re-implement its paint. So what's QListBoxItem in 4.4.0?
QListWidgetItem. Please at least take a look at QListWidget docs before asking such questions...
I don't think you got my question or because of my poor English.
If you inherits QListBoxItem, unless you re-implement paint(), you will always get a compilation error. And by using paint(), you could custom the item's view.
Have a look at call history application in Qtopia 2.2.0. For each item, it has two rows to display in different fonts. Show me, how you implement this using QListWidgetItem in Qtopia 4.2.0
The looks of items in Qt4 are controled by an entity called the delegate. If you want to customize how an item gets rendered, you need to subclass QItemDelegate or QAbstractItemDelegate. But if you only need simple customization, it is possible you can do it without a custom delegate. So the basic question is - how do you want your item to look like? I suggest you read the docs about model-view programming: http://doc.trolltech.com/latest/mode...ogramming.html
mellibra (25th October 2007)
Bookmarks