call addOffscreenWidget(widget) before actually embedding the widget in setGraphicsWidget(widget)

svn path=/trunk/KDE/kdelibs/; revision=1158454
This commit is contained in:
Marco Martin 2010-08-02 19:29:45 +00:00
parent 24e9370b7d
commit 2d190922f6
2 changed files with 5 additions and 4 deletions

View File

@ -656,6 +656,11 @@ void Dialog::setGraphicsWidget(QGraphicsWidget *widget)
d->graphicsWidgetPtr = widget;
if (widget) {
Plasma::Corona *c = qobject_cast<Plasma::Corona *>(widget->scene());
if (c) {
c->addOffscreenWidget(widget);
}
if (!layout()) {
QVBoxLayout *lay = new QVBoxLayout(this);
lay->setMargin(0);

View File

@ -77,10 +77,6 @@ class PLASMA_EXPORT Dialog : public QWidget
* Sets a QGraphicsWidget to be shown as the content in this dialog.
* The dialog will then set up a QGraphicsView and coordinate geometry with
* the widget automatically.
* The widget must be in the scene and not child of a movable
* widget such as an Applet. It is advised to call
* Corona::addOffScreenWidget(widget) prior to call this function that
* will take care of this issue.
*
* @arg widget the QGraphicsWidget to display in this dialog
*/