drop the requirement of a containment on construction
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=852337
This commit is contained in:
parent
e293d7d785
commit
364aabf073
18
view.cpp
18
view.cpp
@ -108,20 +108,24 @@ View::View(Containment *containment, QWidget *parent)
|
|||||||
: QGraphicsView(parent),
|
: QGraphicsView(parent),
|
||||||
d(new ViewPrivate(this, 0))
|
d(new ViewPrivate(this, 0))
|
||||||
{
|
{
|
||||||
Q_ASSERT(containment);
|
|
||||||
d->initGraphicsView();
|
d->initGraphicsView();
|
||||||
setScene(containment->scene());
|
|
||||||
setContainment(containment);
|
if (containment) {
|
||||||
|
setScene(containment->scene());
|
||||||
|
setContainment(containment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
View::View(Containment *containment, int viewId, QWidget *parent)
|
View::View(Containment *containment, int viewId, QWidget *parent)
|
||||||
: QGraphicsView(parent),
|
: QGraphicsView(parent),
|
||||||
d(new ViewPrivate(this, viewId))
|
d(new ViewPrivate(this, viewId))
|
||||||
{
|
{
|
||||||
Q_ASSERT(containment);
|
|
||||||
d->initGraphicsView();
|
d->initGraphicsView();
|
||||||
setScene(containment->scene());
|
|
||||||
setContainment(containment);
|
if (containment) {
|
||||||
|
setScene(containment->scene());
|
||||||
|
setContainment(containment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -200,6 +204,8 @@ void View::setContainment(Plasma::Containment *containment)
|
|||||||
int screen = -1;
|
int screen = -1;
|
||||||
if (oldContainment) {
|
if (oldContainment) {
|
||||||
screen = d->containment->screen();
|
screen = d->containment->screen();
|
||||||
|
} else {
|
||||||
|
setScene(containment->scene());
|
||||||
}
|
}
|
||||||
|
|
||||||
d->containment = containment;
|
d->containment = containment;
|
||||||
|
Loading…
Reference in New Issue
Block a user