diff --git a/private/nativetabbar.cpp b/private/nativetabbar.cpp index fdf97ecdc..390739ff9 100644 --- a/private/nativetabbar.cpp +++ b/private/nativetabbar.cpp @@ -42,7 +42,7 @@ #include "plasma/framesvg.h" #include "plasma/paintutils.h" -#include "private/style.h" +//#include "private/style_p.h" namespace Plasma { diff --git a/widgets/scrollbar.cpp b/widgets/scrollbar.cpp index ee39aa81e..f9178a944 100644 --- a/widgets/scrollbar.cpp +++ b/widgets/scrollbar.cpp @@ -20,24 +20,32 @@ #include "scrollbar.h" -#include +#include namespace Plasma { +class ScrollBarPrivate +{ +public: + Plasma::Style *style; +}; + ScrollBar::ScrollBar(Qt::Orientation orientation, QGraphicsWidget *parent) : QGraphicsProxyWidget(parent), - d(0) + d(new ScrollBarPrivate) { QScrollBar *scrollbar = new QScrollBar(orientation); scrollbar->setAttribute(Qt::WA_NoSystemBackground); setWidget(scrollbar); - Plasma::Style *style = new Plasma::Style(); - scrollbar->setStyle(style); + d->style = new Plasma::Style(); + scrollbar->setStyle(d->style); } ScrollBar::~ScrollBar() { + widget()->setStyle(0); + delete d->style; } void ScrollBar::setRange(int min, int max) diff --git a/widgets/textedit.cpp b/widgets/textedit.cpp index 9145db538..3f8b5bab0 100644 --- a/widgets/textedit.cpp +++ b/widgets/textedit.cpp @@ -27,7 +27,7 @@ #include "theme.h" #include "svg.h" -#include "private/style.h" +#include "private/style_p.h" namespace Plasma { @@ -35,13 +35,7 @@ namespace Plasma class TextEditPrivate { public: - TextEditPrivate() - { - } - - ~TextEditPrivate() - { - } + Plasma::Style *style; }; TextEdit::TextEdit(QGraphicsWidget *parent) @@ -52,13 +46,16 @@ TextEdit::TextEdit(QGraphicsWidget *parent) connect(native, SIGNAL(textChanged()), this, SIGNAL(textChanged())); setWidget(native); native->setAttribute(Qt::WA_NoSystemBackground); - Plasma::Style *style = new Plasma::Style(); - native->verticalScrollBar()->setStyle(style); - native->horizontalScrollBar()->setStyle(style); + d->style = new Plasma::Style(); + native->verticalScrollBar()->setStyle(d->style); + native->horizontalScrollBar()->setStyle(d->style); } TextEdit::~TextEdit() { + nativeWidget()->verticalScrollBar()->setStyle(0); + nativeWidget()->horizontalScrollBar()->setStyle(0); + delete d->style; delete d; } diff --git a/widgets/treeview.cpp b/widgets/treeview.cpp index 2c470e04f..16d1250a0 100644 --- a/widgets/treeview.cpp +++ b/widgets/treeview.cpp @@ -25,7 +25,7 @@ #include -#include "private/style.h" +#include "private/style_p.h" namespace Plasma { @@ -33,13 +33,7 @@ namespace Plasma class TreeViewPrivate { public: - TreeViewPrivate() - { - } - - ~TreeViewPrivate() - { - } + Plasma::Style *style; }; TreeView::TreeView(QGraphicsWidget *parent) @@ -51,13 +45,15 @@ TreeView::TreeView(QGraphicsWidget *parent) native->setAttribute(Qt::WA_NoSystemBackground); native->setFrameStyle(QFrame::NoFrame); - Plasma::Style *style = new Plasma::Style(); - native->verticalScrollBar()->setStyle(style); - native->horizontalScrollBar()->setStyle(style); + d->style = new Plasma::Style(); + native->verticalScrollBar()->setStyle(d->style); + native->horizontalScrollBar()->setStyle(d->style); } TreeView::~TreeView() { + widget()->setStyle(0); + delete d->style; delete d; }