plasma-framework/widgets/rectangle.cpp
Matias Valdenegro Toro bef5a33ed5 - Full Doxygenization
- Ported PushButton to Plasma::Widget API
- Two new classes, Rectangle and Label.
- All Widgets should now inherit from Plasma::Widget


svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=691090
2007-07-22 22:16:40 +00:00

35 lines
588 B
C++

#include "rectangle.h"
#include <QPainter>
namespace Plasma {
Rectangle::Rectangle(Widget *parent)
: Widget(parent)
{
resize(400.0f, 400.0f);
setFlag(QGraphicsItem::ItemIsMovable);
}
Rectangle::~Rectangle()
{
}
Qt::Orientations Rectangle::expandingDirections() const
{
return Qt::Horizontal | Qt::Vertical;
}
void Rectangle::paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option);
Q_UNUSED(widget);
p->setBrush(Qt::white);
p->setPen(Qt::black);
p->setOpacity(0.5f);
p->drawRect(localGeometry());
}
}