catinred
catinred

Reputation: 329

Customize List View Item in Nokia Qt App

I am writing a simple file browser app with Nokia Qt4.7 on Symbian^3 platform. I can display the directory/file list in the listview widget using QFileSystemModel. But I want to customize the list view item. And I am using QItemDelegate to do the trick overriding sizHint and paint functions. I want to display a checkbox in the end of every item (ListMode) or in the right down corder of the icon(IconMode). How can I do it? Thanks.

Upvotes: 0

Views: 337

Answers (2)

Abhijith
Abhijith

Reputation: 2632

You can also do this using QML . Styling rows is much easier in QML. To be more specific your Model will still be c++ . Only the list can be in QML.

Upvotes: 0

Barbaris
Barbaris

Reputation: 1266

I'd suggest you to reimplement QItemDelegate::paint function and use QStylePainter and use QStylePainter::drawControl to render checkbox element. Depending on the mode you can vary your painting.

Upvotes: 2

Related Questions