Your delegate can paint whatever you want, no need to change the view
Cheers,
_
Your delegate can paint whatever you want, no need to change the view
Cheers,
_
^NyAw^ (6th March 2015)
Hi,
My Delegate shows what I want and I have editors like QComboBox working well. The problem now is that I don't know how to show my own editor.
What I have done is to create a QWidget inherited class that contains some checkBoxes (created using QtDesigner). On "createEditor" method I create a object of this class an return it as editor. I can see(on debugger) that the editor is initialized well but it is not displayed. So the problem now is to display the widget that I created on QtDesigner.
Thanks,
Òscar Llarch i Galán
What have you checked already?
That the constructor of the editor widget is called?
That the showEvent() method of the widget is called?
Cheers,
_
Hi,
Searching in the forum I found this http://www.qtcentre.org/threads/5420...ditor+delegate that explains that the problem is because the size of my widget is grater than the available space.
My widget is greater than the cell space and I want to show the widget like a popup widget that overlays the cell. It's something like the attached imageCustom Delegate.png
Thanks,
Òscar Llarch i Galán
It's very unusual to do something like that. Usually you'd use a combobox to show such a large list. Are those options mutually exclusive or not?
Hi,
The options are to select the Outputs of an acquisition card. The user can select wich Outputs to be active on each case.
For example, on case 0 the user could select to enable the out0 and out1 and on case 1 enable out1, so the outs are not exclusive.
Thanks,
Last edited by ^NyAw^; 16th March 2015 at 09:59.
Òscar Llarch i Galán
You can follow the same rule that QComboBox follows -- make your editor open a popup window which lists the outputs to be selected. Alternatively just use a combo box with a model with checkable entries.
Hi,
I have been inspectiong QComboBox code but I'm not able to understand why its able to show the list of items.You can follow the same rule that QComboBox follows -- make your editor open a popup window which lists the outputs to be selected
This is what I'm trying with no luck.Alternatively just use a combo box with a model with checkable entries.
Thanks,
Òscar Llarch i Galán
When you click it, it shows another widget which happens to be a QListView showing a model of its items.
Just set a custom model on the combobox.This is what I'm trying with no luck.
^NyAw^ (17th March 2015)
Bookmarks