Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 9th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Qt Stylesheet mystery
  2. this->ApplyStyleSheet(":/qss/default.qss");
  3.        
  4. QWidget#myWidget {
  5.     background: transparent;
  6.     background-image: url(:/images/bg_img.png);
  7.     background-repeat: repeat-x;
  8. }
  9.        
  10. QMyDerivedClass#myWidget {
  11.     background: transparent;
  12.     background-image: url(:/images/bg_img.png);
  13.     background-repeat: repeat-x;
  14. }
  15.        
  16. void CustomWidget::paintEvent (QPaintEvent *)
  17. {
  18.     QStyleOption opt;
  19.     opt.init (this);
  20.     QPainter p (this);
  21.     style ()->drawPrimitive (QStyle::PE_Widget, &opt, &p, this);
  22. }