Hello to all, sorry my english =)
My problem is that:
I set a background to my QTreeWidget,
I populate my tree with QTreeWidgetItems and i want to see the background trought the items.
Try with setStyleSheet of the TreeWidget:item : nothing how can i do?
TreeWidget:
Qt Code:
  1. void qtg_QTreeWidget::paintEvent(QPaintEvent *event)
  2. {
  3.  
  4.  
  5. QPainter painter(viewport());
  6. QImage image("./background.png");
  7. QRect rect(x(),y(),image.height (),image.width());
  8. qDebug () <<"paint" << x() << y() << image.height () <<image.width();
  9. painter.drawImage(rect, image);
  10. painter.end();
  11. QTreeWidget::paintEvent(event);
  12. };
To copy to clipboard, switch view to plain text mode 
TreeWidgetItem
Qt Code:
  1. gui_laucher::gui_laucher(QWidget *parent)
  2. : QWidget(parent)
  3. {
  4. setupTray();
  5. int y= m_tray->geometry().y() ;
  6. int x= m_tray->geometry().x() ;
  7. setGeometry(x+3,y+3,300,320);
  8. setAttribute(Qt::WA_TranslucentBackground);
  9. QStringList labels;
  10. labels << tr("Software");
  11.  
  12. m_treeWidget = new qtg_QTreeWidget(this);
  13. setStyleSheet("QTreeView::item {background-color :rgba(255,255,255,0%);}");
  14. xmlparser();
  15. }
To copy to clipboard, switch view to plain text mode 

I also try this:
Qt Code:
  1. qtg_QTreeWidgetItem::qtg_QTreeWidgetItem(QTreeWidgetItem *parent) :
  2. {
  3. m_pProcessPath="nopath";
  4. m_pStringParameters="noparams";
  5.  
  6. setBackground(0,QBrush(Qt::transparent));
  7. }
To copy to clipboard, switch view to plain text mode 

I never can see the picture trought the item =(