[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [declarative-plasmoids] tasks: add declarative engine/scene/view
From:       Shaun Reich <shaun.reich () kdemail ! net>
Date:       2012-02-10 17:05:01
Message-ID: 20120210170501.1EB02A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit df110d3bf0f75bf461bc98d6843c7c39afcd7325 by Shaun Reich.
Committed on 10/02/2012 at 18:04.
Pushed by sreich into branch 'master'.

add declarative engine/scene/view

M  +9    -0    tasks/tasks.cpp

http://commits.kde.org/declarative-plasmoids/df110d3bf0f75bf461bc98d6843c7c39afcd7325

diff --git a/tasks/tasks.cpp b/tasks/tasks.cpp
index a5b41eb..a157a07 100644
--- a/tasks/tasks.cpp
+++ b/tasks/tasks.cpp
@@ -20,6 +20,10 @@
 #include "tasks.h"
 
 #include <QGraphicsView>
+#include <QDeclarativeEngine>
+#include <QDeclarativeView>
+#include <QDeclarativeComponent>
+#include <QUrl>
 
 #include <KDebug>
 
@@ -30,6 +34,11 @@ Tasks::Tasks(QObject *parent, const QVariantList &args)
 
     setAspectRatioMode(Plasma::IgnoreAspectRatio);
     setHasConfigurationInterface(false);
+
+    QDeclarativeEngine *engine = new QDeclarativeEngine;
+    QDeclarativeComponent component(engine, QUrl::fromLocalFile("qml/contents/ui/main.qml"));
+    QGraphicsObject *object = qobject_cast<QGraphicsObject *>(component.create());
+    scene()->addItem(object);
 }
 
 Tasks::~Tasks()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic