use a QWeakPointer with the graphics widget handed in as we don't own it
This commit is contained in:
parent
d47a6bf33b
commit
9775682bef
@ -160,8 +160,8 @@ void PopupApplet::setWidget(QWidget *widget)
|
||||
|
||||
QGraphicsWidget *PopupApplet::graphicsWidget()
|
||||
{
|
||||
if (d->graphicsWidget != 0) {
|
||||
return d->graphicsWidget;
|
||||
if (d->graphicsWidget) {
|
||||
return d->graphicsWidget.data();
|
||||
} else {
|
||||
return static_cast<Applet*>(this)->d->extender.data();
|
||||
}
|
||||
@ -668,7 +668,6 @@ PopupAppletPrivate::PopupAppletPrivate(PopupApplet *applet)
|
||||
: q(applet),
|
||||
icon(0),
|
||||
widget(0),
|
||||
graphicsWidget(0),
|
||||
popupPlacement(Plasma::FloatingPopup),
|
||||
popupAlignment(Qt::AlignLeft),
|
||||
savedAspectRatio(Plasma::InvalidAspectRatioMode),
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
QWeakPointer<Plasma::Dialog> dialogPtr;
|
||||
QWeakPointer<QGraphicsProxyWidget>proxy;
|
||||
QWidget *widget;
|
||||
QGraphicsWidget *graphicsWidget;
|
||||
QWeakPointer<QGraphicsWidget> graphicsWidget;
|
||||
Plasma::PopupPlacement popupPlacement;
|
||||
Qt::AlignmentFlag popupAlignment;
|
||||
Plasma::AspectRatioMode savedAspectRatio;
|
||||
|
Loading…
Reference in New Issue
Block a user