PDA

View Full Version : Inheriting QAbstractItemView



morfis
5th February 2013, 19:27
Which methods needs to be reimplemented in class that inherits QAbstractItemView? In documentation I've found that custom View class "only need to implement their own view-specific functionality". I've implemented pure virtual functions with drawing in visualRect(), but there is nothing showed after setting model in my custom View widget.

wysota
5th February 2013, 19:46
All the pure virtual methods and at least paintEvent() need to be reimplemented.

anda_skoa
6th February 2013, 10:49
It might help if you elaborate a bit on why you want to create your own view class.
In a lot of cases this is not required and other solutions can be employed, e.g. custom delegates.

Cheers,
_