diff options
author | Daniel Borgmann <ext-daniel.borgmann@nokia.com> | 2010-11-22 13:58:05 +0200 |
---|---|---|
committer | Stanislav Ionascu <stanislav.ionascu@nokia.com> | 2011-01-20 15:38:16 +0200 |
commit | 7d68f0ee4dc362990f919d33e6902f345a1f43fc (patch) | |
tree | c53a42ae04f2cb4893481724a1dc7d36640b950e | |
parent | 8f6500ffaad221754436b320617a8e31b5a2aa23 (diff) |
Changes: Add title-style-property to MContainerStyle.
RevBy: Adrian Yanes, Miguel Gomez, Stanislav Ionascu
Details:
Merge-Request: 964
ChangedBy: Stanislav Ionascu
Details: Set title style name, once the title label is created and when the style is changed.
Also fixed q_ptr being NULL in the private class.
-rw-r--r-- | src/views/mcontainerview.cpp | 9 | ||||
-rw-r--r-- | src/views/style/mcontainerstyle.h | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/views/mcontainerview.cpp b/src/views/mcontainerview.cpp index dd0bcd21..8772a959 100644 --- a/src/views/mcontainerview.cpp +++ b/src/views/mcontainerview.cpp @@ -89,6 +89,8 @@ void MContainerViewPrivate::init() void MContainerViewPrivate::createHeader() { + Q_Q(MContainerView); + if (!header) { header = new MContainerHeader(); @@ -103,6 +105,7 @@ void MContainerViewPrivate::createHeader() text = new MLabel(); title->setObjectName("MContainerTitle"); + title->setStyleName(q->style()->titleStyleName()); text->setAlignment(Qt::AlignVCenter | Qt::AlignRight); headerLayout->addItem(title); @@ -190,6 +193,7 @@ MContainerView::MContainerView(MContainer *controller) : MWidgetView(*new MContainerViewPrivate, controller) { Q_D(MContainerView); + d->q_ptr = this; d->controller = controller; // setup main infrastructure @@ -202,6 +206,7 @@ MContainerView::MContainerView(MContainerViewPrivate &dd, MContainer *controller MWidgetView(dd, controller) { Q_D(MContainerView); + d->q_ptr = this; d->controller = controller; d->init(); @@ -235,6 +240,10 @@ void MContainerView::applyStyle() MWidgetView::applyStyle(); + if (d->title) { + d->title->setStyleName(style()->titleStyleName()); + } + // get background from style d->background = style()->backgroundImage(); } diff --git a/src/views/style/mcontainerstyle.h b/src/views/style/mcontainerstyle.h index 07a00f98..ba897582 100644 --- a/src/views/style/mcontainerstyle.h +++ b/src/views/style/mcontainerstyle.h @@ -29,9 +29,10 @@ class M_VIEWS_EXPORT MContainerStyle : public MWidgetStyle Q_OBJECT M_STYLE(MContainerStyle) - M_STYLE_ATTRIBUTE(QSize, iconSize, IconSize) - M_STYLE_ATTRIBUTE(int, internalMargins, InternalMargins) + M_STYLE_ATTRIBUTE(QSize, iconSize, IconSize) + M_STYLE_ATTRIBUTE(int, internalMargins, InternalMargins) M_STYLE_ATTRIBUTE(int, internalItemSpacing, InternalItemSpacing) + M_STYLE_ATTRIBUTE(QString, titleStyleName, TitleStyleName) }; class M_VIEWS_EXPORT MContainerStyleContainer : public MWidgetStyleContainer |