Re: [Interest] QTreeWidget displays blank widget

2018-08-28 Thread Nicolas Krieger
It does not work neither. But I have finally found the solution; use "setBackgroundRole(QPalette::Window)" in the widget that will be displayed in the TreeWidget. The default value is QPalette::NoRole. That's all ! There is nothing else to do. On 8/10/2018 1:41 PM, coroberti . wrote: Hi, Tr

Re: [Interest] QTreeWidget displays blank widget

2018-08-10 Thread coroberti .
Hi, Try for your widgets to call setAutoFillBackground(true); Kind regards, Robert On Thu, Aug 9, 2018 at 5:58 PM, Nicolas Krieger wrote: > Hello > > I would like to display colored widgets in a QTreeWidget. > > Screenshots of what I really have are in attached files. > > My wigdet is colored

Re: [Interest] QTreeWidget displays blank widget

2018-08-10 Thread Nicolas Krieger
I've tried with QFrame, and it does not work either. I've tried with QStyledItemDelegate and only writing the "paint" method : void TestDelegate::paint(QPainter*painter,constQStyleOptionViewItem&option,constQModelIndex&index)const { SimpleWidget*pWidget=newSimpleWidget; pWidget->render(painte

Re: [Interest] QTreeWidget displays blank widget

2018-08-10 Thread Tony Rietwyk
Hi Nicolas, Try using a QFrame for SimpleWidget - you may be able to get rid of widget_2. I'm surprised that the nested QWidget worked, as QWidget doesn't normally draw a background. Hope that helps, Tony ___ Interest mailing list Interest@qt-pr

Re: [Interest] QTreeWidget displays blank widget

2018-08-10 Thread Nicolas Krieger
I have finally managed to do what I wanted in using styleSheets. Not really beautiful. If a have a widget containing all other widgets, for which I defined a styleSheet, the color will be displayed only for the children (see last example). The "solution" is to have a child widget that conta

Re: [Interest] QTreeWidget displays blank widget

2018-08-09 Thread Murphy, Sean
> Yes, I used QTreeWidget ::setCellWidget(int row, int column, QWidget *widget). > I have already used QStyledItemDelegate, but setCellWidget is far easiest for > what I want to do. > I don't really understand why QPushbutton are correctly displayed and not > other widgets. > But if only delegate

Re: [Interest] QTreeWidget displays blank widget

2018-08-09 Thread Nicolas Krieger
Yes, I used QTreeWidget ::setCellWidget(int row, int column, QWidget *widget). I have already used QStyledItemDelegate, but setCellWidget is far easiest for what I want to do. I don't really understand why QPushbutton are correctly displayed and not other widgets. But if only delegate is t

Re: [Interest] QTreeWidget displays blank widget

2018-08-09 Thread Murphy, Sean
> I would like to display colored widgets in a QTreeWidget. > Screenshots of what I really have are in attached files. > My wigdet is colored, but when in the QTreeWidget, it is all white. How can I > resolve it? Are you adding your widget to the QTreeWidget via QTreeWidget ::setCellWidget(int

[Interest] QTreeWidget displays blank widget

2018-08-09 Thread Nicolas Krieger
Hello I would like to display colored widgets in a QTreeWidget. Screenshots of what I really have are in attached files. My wigdet is colored, but when in the QTreeWidget, it is all white. How can I resolve it? -- *Nicolas Krieger* ___ Interest mai