summaryrefslogtreecommitdiffstats
path: root/src/widget/wpushbutton.cpp
diff options
context:
space:
mode:
authorJean Claveau <jean.claveau@c277.fr>2014-10-01 22:07:31 +0200
committerJean Claveau <jean.claveau@c277.fr>2014-10-01 22:07:31 +0200
commit13ebd33df74d7c69440d02df1511897cb589a854 (patch)
tree5654f73accecdf19552a2d1d1071c7eeb5b86289 /src/widget/wpushbutton.cpp
parent7b4f6932e9b54272a465040195ab53a2a074e4ff (diff)
removing leaked context from wpushbutton
Diffstat (limited to 'src/widget/wpushbutton.cpp')
-rw-r--r--src/widget/wpushbutton.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/widget/wpushbutton.cpp b/src/widget/wpushbutton.cpp
index 52678c4677..2d927a41cf 100644
--- a/src/widget/wpushbutton.cpp
+++ b/src/widget/wpushbutton.cpp
@@ -70,26 +70,26 @@ void WPushButton::setup(QDomNode node, const SkinContext& context) {
while (!state.isNull()) {
if (state.isElement() && state.nodeName() == "State") {
// support for variables in State elements
- SkinContext* stateContext = new SkinContext(context);
- stateContext->updateVariables(state);
+ SkinContext stateContext(context);
+ stateContext.updateVariables(state);
- int iState = stateContext->selectInt(state, "Number");
+ int iState = stateContext.selectInt(state, "Number");
if (iState < m_iNoStates) {
QString pixmapPath;
PixmapSource pixmapSource;
- pixmapSource = stateContext->getPixmapSource(stateContext->selectNode(state, "Unpressed"));
+ pixmapSource = stateContext.getPixmapSource(stateContext.selectNode(state, "Unpressed"));
if (!pixmapSource.isEmpty()) {
setPixmap(iState, false, pixmapSource);
}
- pixmapSource = stateContext->getPixmapSource(stateContext->selectNode(state, "Pressed"));
+ pixmapSource = stateContext.getPixmapSource(stateContext.selectNode(state, "Pressed"));
if (!pixmapSource.isEmpty()) {
setPixmap(iState, true, pixmapSource);
}
- m_text.replace(iState, stateContext->selectString(state, "Text"));
- QString alignment = stateContext->selectString(state, "Alignment");
+ m_text.replace(iState, stateContext.selectString(state, "Text"));
+ QString alignment = stateContext.selectString(state, "Alignment");
if (alignment == "left") {
m_align.replace(iState, Qt::AlignLeft);
} else if (alignment == "right") {