# HG changeset patch # User nemo # Date 1242570345 0 # Node ID 6e0fcbcc3f60730725816564e5fc2091751c58d3 # Parent 0faa147c47df29ada02ada62f7c19a9ce9ef9e69 Custom controls implementing paintEvent play poorly with stars, especially SquareLabel Setting PaintOnScreen seems safe with current layout diff -r 0faa147c47df -r 6e0fcbcc3f60 QTfrontend/SquareLabel.cpp --- a/QTfrontend/SquareLabel.cpp Sun May 17 13:04:58 2009 +0000 +++ b/QTfrontend/SquareLabel.cpp Sun May 17 14:25:45 2009 +0000 @@ -23,7 +23,7 @@ SquareLabel::SquareLabel(QWidget * parent) : QWidget(parent) { - + setAttribute(Qt::WA_PaintOnScreen, true); } void SquareLabel::paintEvent(QPaintEvent * event) diff -r 0faa147c47df -r 6e0fcbcc3f60 QTfrontend/igbox.cpp --- a/QTfrontend/igbox.cpp Sun May 17 13:04:58 2009 +0000 +++ b/QTfrontend/igbox.cpp Sun May 17 14:25:45 2009 +0000 @@ -25,6 +25,8 @@ IconedGroupBox::IconedGroupBox(QWidget * parent) { +// Has issues with border-radius on children +// setAttribute(Qt::WA_PaintOnScreen, true); titleLeftPadding = 82; contentTopPadding = 22; } diff -r 0faa147c47df -r 6e0fcbcc3f60 QTfrontend/itemNum.cpp --- a/QTfrontend/itemNum.cpp Sun May 17 13:04:58 2009 +0000 +++ b/QTfrontend/itemNum.cpp Sun May 17 14:25:45 2009 +0000 @@ -25,6 +25,7 @@ QFrame(parent), m_im(im), infinityState(false), nonInteractive(false), minItems(min), maxItems(max), numItems(min+2 >= max ? min : min+2) { + setAttribute(Qt::WA_PaintOnScreen, true); } ItemNum::~ItemNum() diff -r 0faa147c47df -r 6e0fcbcc3f60 QTfrontend/main.cpp --- a/QTfrontend/main.cpp Sun May 17 13:04:58 2009 +0000 +++ b/QTfrontend/main.cpp Sun May 17 14:25:45 2009 +0000 @@ -133,8 +133,12 @@ "background-color: #040200;" "padding: 6px;" "}" - - "IconedGroupBox, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" +/* Experimenting with PaintOnScreen and border-radius on IconedGroupBox children didn't work out well + "IconedGroupBox QComboBox, IconedGroupBox QPushButton, IconedGroupBox QLineEdit, " + "IconedGroupBox QSpinBox {" + "border-radius: 0;" + "}" */ + "IconedGroupBox, IconedGroupBox *, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" "background-color: #130f2c;" "}" @@ -271,6 +275,9 @@ ":disabled{" "color: #a0a0a0;" "}" + "SquareLabel, ItemNum {" + "background-color: #000000;" + "}" ) ); diff -r 0faa147c47df -r 6e0fcbcc3f60 QTfrontend/pages.cpp --- a/QTfrontend/pages.cpp Sun May 17 13:04:58 2009 +0000 +++ b/QTfrontend/pages.cpp Sun May 17 14:25:45 2009 +0000 @@ -208,6 +208,8 @@ FortPreview = new SquareLabel(GBoxFort); FortPreview->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); FortPreview->setPixmap(QPixmap()); + // perhaps due to handling its own paintevents, SquareLabel doesn't play nice with the stars + //FortPreview->setAttribute(Qt::WA_PaintOnScreen, true); GBFLayout->addWidget(FortPreview, 1, 0); vbox3->addWidget(GBoxFort); @@ -331,6 +333,7 @@ gbTBLayout->setSpacing(0); { teamsBox = new IconedGroupBox(this); + //teamsBox->setAttribute(Qt::WA_PaintOnScreen, true); teamsBox->setIcon(QIcon(":/res/teamicon.png")); teamsBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); teamsBox->setTitle(QGroupBox::tr("Teams"));