#include "healthcarefeuillessoins.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include 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"<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"