PDA

View Full Version : QItemDelegate Issue



ayanda83
13th April 2015, 11:38
Hello again, I have a problem displaying a QPushButton in a QListView. I defined the the Delegate class and its works but I am getting undesirable results. I am aiming for the look in this pic11078. The squares in the pic are a mock-up representation of a QPushButton. In my implementation the QListView does display the QPushButton but it first loads like this 11079 and only when you double click on a QListView row does the QPushButton appear, like here 11080.

anda_skoa
13th April 2015, 12:42
So what you want is a list of buttons?
How many buttons will you have? I.e. how large is your model?

Cheers,
_

ayanda83
13th April 2015, 13:44
I need at most 10 buttons

yeye_olive
13th April 2015, 13:49
Please post your code.

anda_skoa
13th April 2015, 16:18
I need at most 10 buttons

Then I would suggest dynamically creating buttons in code, having them inside a QVBoxLayout of a widget that is set as the content of a QScrollArea.

Cheers,
_