c++ - (Qt) How to implement editorOpened(index) and editorClosed(index) signals in a view -


i've coded myself corner sort of data abstraction scheme , it's resulted in needing editoropened(qmodelindex) , editorclosed(qmodelindex) signals in views (qtableview exclusively).

the reason being data classes have automatic behavior needs block/disabled during editing, re-enabled afterwards.

at first thought try custom delegates ran problems couple reasons: 1 being seems bit excessive use custom delegate providing same behavior every single item, in other words seems ought done items view itself. second problem being delegates seem const prevents me setting internal handle data object within delegate.

looking @ view methods, found qabstractitemview::edit , qabstractitemview::closeeditor perfect candidates re-implementing opened() , closed() signals, need index/handle specific item being edited, don't think can obtain within methods...

at point have no idea else do. i'd appreciate tips or pointers in right direction! reading

i solved on own...

i found qabstractitemdelegate::editorevent non-const (i must have not been looking closely thought when reading docs before).

i able set internal handle in custom delegate within method, allowed me create slot needed upon closing, , connect closeeditor(qwidget*,qabstractitemdelegate::endedithint) signal it.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -