How to create editorWidget when delegate is constructed?
-
no editor widgets are set up when the delegate is constructed. We only construct an editor widget when it is needed.
here ,it says so.
So what if I want an editorWidget as soon as a delegate is created?
-
@jsulm
What I mean is, in this QSpinBox Delegate example,when we click on particular block in the table , the QSpinBox gets created and as soon as we select some other index, it vanishes.
Is there a way to create a QSpinBox along with the Delegate where as soon as the table appears the spinBox appears too, without us clicking or attempting to edit it ? It should work as it works in the example linked above. -
Hi,
Do you mean that you want the spin box to be shown permanently ?
-
You can try with openPersistentEditor. Note that you will hit a performance penalty if your model has a big number of rows.
-
You can try with openPersistentEditor. Note that you will hit a performance penalty if your model has a big number of rows.
-
That is implemented in the delegate createEditor function.