summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2013-12-13 12:07:48 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-13 15:01:06 +0100
commit67b523661037cf807974f256f1146d441d8e7d40 (patch)
tree77eb67719ec2710b9173afa76a298852be622bb3 /src
parent49a7f0b8e544fed6bf7811198d7696af8d7baba9 (diff)
downloadqtquickcontrols-67b523661037cf807974f256f1146d441d8e7d40.tar.gz
qtquickcontrols-67b523661037cf807974f256f1146d441d8e7d40.tar.bz2
qtquickcontrols-67b523661037cf807974f256f1146d441d8e7d40.zip
Set style object on QStyleOptionFrames in QQuickStyleItem
For some controls an explicit QStyleOptionFrame is created. By setting the styleObject the QStyle can recognize that it's a QQuickItem and adjust the rendering. This is for example needed in the oxygen style to get the frame around a menu. Change-Id: I52d2a8b259477b2ff668827334d5073c6934f23c Reviewed-by: Martin Klapetek <mklapetek@kde.org> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/controls/Private/qquickstyleitem.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/controls/Private/qquickstyleitem.cpp b/src/controls/Private/qquickstyleitem.cpp
index 0210e76e..c290bc28 100644
--- a/src/controls/Private/qquickstyleitem.cpp
+++ b/src/controls/Private/qquickstyleitem.cpp
@@ -917,6 +917,7 @@ QSize QQuickStyleItem::sizeFromContents(int width, int height)
frame.state = m_styleoption->state;
frame.lineWidth = qApp->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, m_styleoption, 0);
frame.rect = m_styleoption->rect;
+ frame.styleObject = this;
size = qApp->style()->sizeFromContents(QStyle::CT_LineEdit, &frame, QSize(width, height));
}
break;
@@ -1582,6 +1583,7 @@ void QQuickStyleItem::paint(QPainter *painter)
frame.lineWidth = fw;
frame.midLineWidth = 0;
frame.rect = m_styleoption->rect;
+ frame.styleObject = this;
qApp->style()->drawPrimitive(QStyle::PE_FrameMenu, &frame, painter);
}
}