summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/styles/qstyle.cpp')
-rw-r--r--src/gui/styles/qstyle.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index 3fab682..c0fdc83 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -325,9 +325,10 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C
QStyle::QStyle()
: QObject(*new QStylePrivate)
{
+ Q_D(QStyle);
+ d->proxyStyle = this;
}
-
/*!
\internal
@@ -336,6 +337,8 @@ QStyle::QStyle()
QStyle::QStyle(QStylePrivate &dd)
: QObject(dd)
{
+ Q_D(QStyle);
+ d->proxyStyle = this;
}
/*!
@@ -2444,4 +2447,33 @@ QDebug operator<<(QDebug debug, QStyle::State state)
}
#endif
+/*!
+ \since 4.6
+
+ \fn const QStyle * proxy() const
+
+ This function returns the current proxy for this style.
+ By default most styles will return themselves. However
+ when a proxy style is in use, it will allow the style to
+ call back into its proxy.
+
+ \sa setProxyStyle
+*/
+const QStyle * QStyle::proxy() const
+{
+ Q_D(const QStyle);
+ return d->proxyStyle;
+}
+
+/* \internal
+
+ This function sets the base style that style calls will be
+ redirected to. Note that ownership is not transferred.
+*/
+void QStyle::setProxy(QStyle *style)
+{
+ Q_D(QStyle);
+ d->proxyStyle = style;
+}
+
QT_END_NAMESPACE