rendered paste body#include "healthcarefeuillessoins.h"
#include <QPainter>
#include <QFontMetrics>
#include <QSizeF>
#include <KLocale>
#include <QTableWidget>
#include <QGraphicsScene>
#include <QLabel>
#include <QGraphicsProxyWidget>
#include <QGraphicsLinearLayout>
#include <plasma/svg.h>
#include <plasma/theme.h>
#include <plasma/view.h>
#include <QDebug>
#include <QVBoxLayout>
#include <QGroupBox>
#include <QGraphicsView>
HealthcareFeuillesSoins::HealthcareFeuillesSoins(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args),m_corona(this)
{
// this will get us the standard applet background, for free!
setBackgroundHints(DefaultBackground);
setHasConfigurationInterface(true);
resize(300, 400);
m_corona.addText("coucou");
}
HealthcareFeuillesSoins::~HealthcareFeuillesSoins()
{
if (hasFailedToLaunch()) {
// Do some cleanup here
} else {
// Save settings
}
}
void HealthcareFeuillesSoins::init()
{
qDebug()<<"scene2"<<this->scene();
QLabel *label1 = new QLabel("1");
QLabel *label2 = new QLabel("2");
table=new QTableWidget;
table->setRowCount(3);
table->setColumnCount(3);
table->setCellWidget(0,0,new QLabel("1"));
table->setCellWidget(0,1,new QLabel("1"));
table->setCellWidget(0,2,new QLabel("1"));
table->setCellWidget(1,0,new QLabel("2"));
table->setCellWidget(1,1,new QLabel("2"));
table->setCellWidget(1,2,new QLabel("2"));
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(label1);
layout->addWidget(table);
QGroupBox *groupBox= new QGroupBox ();
groupBox->setLayout(layout);
// m_corona.addWidget(groupBox);
// this->scene()
//m_corona.addText("cas");
QGraphicsProxyWidget *proxy = this->scene()->addWidget(label1);
proxy->setPos(10,10); //position where u want in scene
// resize(layout->sizeHint());
QGraphicsView view(&m_corona);
view.show();
}
void HealthcareFeuillesSoins::paintInterface(QPainter *p,
const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
{
p->setRenderHint(QPainter::SmoothPixmapTransform);
p->setRenderHint(QPainter::Antialiasing);
// Now we draw the applet, starting with our svg
}
#include "healthcarefeuillessoins.moc"