Show delegate in treeview all the time regardless of EditTrigger mode
Hello Everyone,
I've written a custom delegate and added it to a standard QTreeView, this delegate represents a push-button, and when its clicked it calls a slot to perform some operations
its working ok, if item editing is enabled, after I double click on the item
My question is how to make the button visible all the time (EVEN if I disable the editing of items), or I select another row, i would like the button to be visible on all the rows all the time, is that possible?
Thanks very much for your help
Re: Show delegate in treeview all the time regardless of EditTrigger mode
Hello again,
I'm able to show the button on all times, I've implemented the 2 virtual functions
Quote:
void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
but the button is not enabled till I double click on it, i.e. till its in the edition mode, how can I over come this, so it will be enabled anytime i click on it?
Thanks very much
Re: Show delegate in treeview all the time regardless of EditTrigger mode
Hello everyone
its Solved
I just had to provide
Code:
tableView.openPersistentEditor(index);
to the items where I want to button to show!
:)