Plasma
appletmovespacer.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "appletmovespacer.h"
00021
00022 #include <QGraphicsSceneDragDropEvent>
00023
00024 #include <Plasma/FrameSvg>
00025
00026 AppletMoveSpacer::AppletMoveSpacer(QGraphicsWidget *parent)
00027 : QGraphicsWidget(parent)
00028 {
00029 m_background = new Plasma::FrameSvg(this);
00030 m_background->setImagePath("widgets/frame");
00031 m_background->setElementPrefix("sunken");
00032 }
00033
00034 AppletMoveSpacer::~AppletMoveSpacer()
00035 {
00036 }
00037
00038 void AppletMoveSpacer::dropEvent(QGraphicsSceneDragDropEvent *event)
00039 {
00040 event->setPos(mapToParent(event->pos()));
00041 emit dropRequested(event);
00042 }
00043
00044 void AppletMoveSpacer::resizeEvent(QGraphicsSceneResizeEvent *event)
00045 {
00046 m_background->resizeFrame(event->newSize());
00047 }
00048
00049 void AppletMoveSpacer::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
00050 {
00051 Q_UNUSED(option)
00052 Q_UNUSED(widget)
00053
00054 m_background->paintFrame(painter);
00055 }
00056
00057 #include "appletmovespacer.moc"