use the caching (!), don't crash if we get a 0 widget parameter
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=821186
This commit is contained in:
parent
996da901e2
commit
659844e273
@ -842,7 +842,7 @@ void Applet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QW
|
|||||||
//FIXME: we should probably set the pixmap to screenSize(), but that breaks stuff atm.
|
//FIXME: we should probably set the pixmap to screenSize(), but that breaks stuff atm.
|
||||||
QPixmap pixmap(boundingRect().size().toSize());
|
QPixmap pixmap(boundingRect().size().toSize());
|
||||||
|
|
||||||
QGraphicsView* qgv = qobject_cast<QGraphicsView*>(widget->parent());
|
QGraphicsView* qgv = qobject_cast<QGraphicsView*>(widget ? widget->parent() : 0);
|
||||||
bool ghost = (qgv && (qgv == d->ghostView));
|
bool ghost = (qgv && (qgv == d->ghostView));
|
||||||
|
|
||||||
if (ghost) {
|
if (ghost) {
|
||||||
@ -1120,7 +1120,6 @@ void Applet::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
|
|
||||||
parent->setPos(parent->pos() + delta);
|
parent->setPos(parent->pos() + delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1524,6 +1523,7 @@ void Applet::Private::init()
|
|||||||
{
|
{
|
||||||
// WARNING: do not access config() OR globalConfig() in this method!
|
// WARNING: do not access config() OR globalConfig() in this method!
|
||||||
// that requires a scene, which is not available at this point
|
// that requires a scene, which is not available at this point
|
||||||
|
q->setCacheMode(DeviceCoordinateCache);
|
||||||
q->setAcceptsHoverEvents(true);
|
q->setAcceptsHoverEvents(true);
|
||||||
q->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
q->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
||||||
// FIXME: adding here because nothing seems to be doing it in QGraphicsView,
|
// FIXME: adding here because nothing seems to be doing it in QGraphicsView,
|
||||||
|
@ -104,8 +104,10 @@ Containment::~Containment()
|
|||||||
|
|
||||||
void Containment::init()
|
void Containment::init()
|
||||||
{
|
{
|
||||||
|
if (isContainment()) {
|
||||||
setCacheMode(NoCache);
|
setCacheMode(NoCache);
|
||||||
setFlag(QGraphicsItem::ItemIsMovable, false);
|
setFlag(QGraphicsItem::ItemIsMovable, false);
|
||||||
|
}
|
||||||
setFlag(QGraphicsItem::ItemClipsChildrenToShape, false);
|
setFlag(QGraphicsItem::ItemClipsChildrenToShape, false);
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
setAcceptsHoverEvents(true);
|
setAcceptsHoverEvents(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user