Hi

I am successfully displaying QPixmaps in a widget (QTextEdit) UNTIL I set some html ("rich text") that has a background colour. after that no more images can be displayed.

the code I am using, which would be over kil in an environment tahat worked, but is incufficient in one that doesn't, is

Qt Code:
  1. QPixmap* p_pic = NULL;
  2. p_pic = backgroundImages[ screenMsgType ];
  3. // if ther *is* an image to display ...
  4. // -----
  5. assert(NULL != p_pic);
  6. // ----
  7. if (!p_pic->isNull( ))
  8. {
  9.  
  10. :
  11. :
  12.  
  13. QPalette pal = wTextTABtoCustomer->palette();
  14. QPixmap pm = *p_pic;
  15. QColor col(0,0,0);
  16. QBrush bru(col, pm );
  17. pal.setBrush( QColorGroup::Background , bru );
  18. pal.setBrush( QColorGroup::Base , bru );
  19. pal.setBrush( QColorGroup::Button , bru );
  20. wTextTABtoCustomer->setPalette( pal );
  21.  
  22. wTextTABtoCustomer->viewport()->update() ;
  23. wTextTABtoCustomer->updateContents( );
  24. wTextTABtoCustomer->update();
  25. wTextTABtoCustomer->repaint( );
  26.  
  27. wTextTABtoCustomer->setPaletteBackgroundPixmap( *p_pic );
  28.  
  29. wTextTABtoCustomer->repaint( );
  30. wTextTABtoCustomer->updateContents( );
  31. wTextTABtoCustomer->update();
To copy to clipboard, switch view to plain text mode 

I have looked through the previous posts detailing Palette problems and bugs, but noone has mentioned inablility to set images after using "rich text"

all kinds of variations of the above have been tried, including storing a useable Palette frome the start of the program, setting that. still no go.

If anyone has ever set a background image in a widget after haveing the background colour set by html, I would love to hear how you did it

thanks in advance

cheers

G