My aim is to create something like contact app, where I can list contacts and choose it to see information about person. I figure out that one of the possible solution is to use QListView + QStyledItemDelegate / QAbstractItemDelegate. The information about it is very difficult so I don't understand it clearly;
(Contact should look something like https://www.sketchappsources.com/free-source/4395-ios-contacts-screen-app-sketch-freebie-resource.html)
So how should I use QAbstractItemDelegate ( I heard that I must reimplement paintEvent )?
I suggest you to start with a data model.
QStandardItemModelclass for beginning and populate it withQStandardItemclass instances. It would allow you to set icon, text, font, background, size and other properties for items. Refer to https://doc.qt.io/qt-5/qstandarditemmodel.html#detailsQListViewusingsetModelQListView'sclickedsignal.To render items in more complex way you should
QStyledItemDelegateclass and it'spaintandsizeHintmethods. In thepaintmethod you should implement rendering and yoursizeHintmethod should return a valid size for items. Refer to https://doc.qt.io/qt-5/qabstractitemdelegate.html#detailsdatamethod ofQModelIndexreference that is passed topaintmethod. Use different roles to get appropriate data. Refer to https://doc.qt.io/qt-5/qt.html#ItemDataRole-enumQListViewbysetItemDelegate.Model should be set to QListView and item clicks are handled in same way.