mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Correctly paint the states
The state handling is a pain to do manually, but I can't really use the style painter because if I do that it would paint the string of the model (and that's something I don't wanna do) so I clear the text, draw the control, then I paint the stuff that I really need. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2f9e859615
commit
7bc11f3044
1 changed files with 4 additions and 4 deletions
|
@ -520,12 +520,12 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
||||||
fontBigger.setPointSize(fontBigger.pointSize() + 1);
|
fontBigger.setPointSize(fontBigger.pointSize() + 1);
|
||||||
fontBigger.setBold(true);
|
fontBigger.setBold(true);
|
||||||
|
|
||||||
|
initStyleOption(&opt, index);
|
||||||
|
opt.text = QString();
|
||||||
|
qApp->style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, NULL);
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->setRenderHint(QPainter::Antialiasing);
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
if( ( option.state & QStyle::State_Selected ) || ( option.state & QStyle::State_MouseOver ) )
|
|
||||||
bg = option.palette.highlight();
|
|
||||||
else
|
|
||||||
bg = option.palette.window();
|
|
||||||
painter->setPen(QPen(Qt::NoPen));
|
painter->setPen(QPen(Qt::NoPen));
|
||||||
painter->setBrush(bg);
|
painter->setBrush(bg);
|
||||||
painter->drawRect(option.rect);
|
painter->drawRect(option.rect);
|
||||||
|
|
Loading…
Add table
Reference in a new issue