fix signal/slot usage

CCMAIL: darktears31@gmail.com

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=798097
This commit is contained in:
Pino Toscano 2008-04-17 13:12:25 +00:00
parent cee1f3d1cb
commit 3d9a4ad7e1
2 changed files with 7 additions and 5 deletions

View File

@ -54,14 +54,15 @@ public:
* for example by resizing the dialogue.
*/
Plasma::PanelSvg *background;
Plasma::Dialog *q;
void themeUpdated(Dialog * dialog)
void themeUpdated()
{
const int topHeight = background->marginSize(Plasma::TopMargin);
const int leftWidth = background->marginSize(Plasma::LeftMargin);
const int rightWidth = background->marginSize(Plasma::RightMargin);
const int bottomHeight = background->marginSize(Plasma::BottomMargin);
dialog->setContentsMargins(leftWidth, topHeight, rightWidth, bottomHeight);
q->setContentsMargins(leftWidth, topHeight, rightWidth, bottomHeight);
};
};
@ -69,14 +70,15 @@ Dialog::Dialog( QWidget * parent, Qt::WindowFlags f )
: QWidget(parent, f),
d(new Private)
{
d->q = this;
d->background = new PanelSvg("dialogs/background", this);
d->background->setEnabledBorders(PanelSvg::AllBorders);
d->background->resize(size());
connect(d->background, SIGNAL(repaintNeeded()), this, SLOT(update()));
connect(Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeUpdated(this)));
d->themeUpdated(this);
connect(Plasma::Theme::self(), SIGNAL(changed()), this, SLOT(themeUpdated()));
d->themeUpdated();
}
Dialog::~Dialog()

View File

@ -81,7 +81,7 @@ class PLASMA_EXPORT Dialog : public QWidget
/**
* React to theme changes
*/
Q_PRIVATE_SLOT(d,void themeUpdated(Dialog * dialog));
Q_PRIVATE_SLOT(d, void themeUpdated())
};
} // Plasma namespace