diff --git a/widgets/checkbox.cpp b/widgets/checkbox.cpp index c441199d9..54ec9a190 100644 --- a/widgets/checkbox.cpp +++ b/widgets/checkbox.cpp @@ -48,6 +48,8 @@ public: void setPixmap() { if (imagePath.isEmpty()) { + delete svg; + svg = 0; return; } @@ -65,6 +67,8 @@ public: QPainter p(&pm); svg->paint(&p, pm.rect()); } else { + delete svg; + svg = 0; pm = QPixmap(absImagePath); } diff --git a/widgets/label.cpp b/widgets/label.cpp index ea113c2fe..e2b032199 100644 --- a/widgets/label.cpp +++ b/widgets/label.cpp @@ -52,6 +52,8 @@ public: void setPixmap() { if (imagePath.isEmpty()) { + delete svg; + svg = 0; return; } @@ -69,6 +71,8 @@ public: QPainter p(&pm); svg->paint(&p, pm.rect()); } else { + delete svg; + svg = 0; pm = QPixmap(absImagePath); } diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 964e832b0..1c00d85d6 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -62,6 +62,8 @@ public: void setPixmap() { if (imagePath.isEmpty()) { + delete svg; + svg = 0; return; } @@ -92,6 +94,8 @@ public: svg->paint(&p, pm.rect()); } } else { + delete svg; + svg = 0; pm = QPixmap(absImagePath); } diff --git a/widgets/radiobutton.cpp b/widgets/radiobutton.cpp index 2728d7f11..cbcd708e9 100644 --- a/widgets/radiobutton.cpp +++ b/widgets/radiobutton.cpp @@ -48,6 +48,8 @@ public: void setPixmap() { if (imagePath.isEmpty()) { + delete svg; + svg = 0; return; } @@ -65,6 +67,8 @@ public: QPainter p(&pm); svg->paint(&p, pm.rect()); } else { + delete svg; + svg = 0; pm = QPixmap(absImagePath); } diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index 3a63469d3..e59691c30 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -62,6 +62,8 @@ public: void setPixmap() { if (imagePath.isEmpty()) { + delete svg; + svg = 0; return; } @@ -92,6 +94,8 @@ public: svg->paint(&p, pm.rect()); } } else { + delete svg; + svg = 0; pm = QPixmap(absImagePath); }