how can i dynamically switch between use ItemDelegate and not use ItemDelegate ?



  • how can i dynamically switch between use ItemDelegate and not use ItemDelegate ?
    when IconMode, i want to use ItemDeletgate.
    while ListMode, i don't want to use ItemDelegate.

    i tried, when ListMode, setItemDelegate(NULL), but then paint nothing...
    and i also tried in the inherited QAbstractItemDelegate class's paint, sizeHint. write return if Not IconMode.but also failed with nothing paint.


  • Lifetime Qt Champion

    Hi,

    Either set/remove the delegate when you change the mode or write a delegate that you will configure to act as pass-trough when you change the mode.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.