You shouldn't call QAbstractItemView::setDirtyRegion() inside paintEvent() because it schedules an update so you've got an infinite loop there. And QAbstractItemView::paintEvent() doesn't paint anything for you...

About the indexAt() crash, could you run the application via debugger and get a backtrace so that we know where the call comes from, please?

PS. What kind of view are you going to implement? Is it really something which cannot be achieved by customizing already existing views?