aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins/quickcontainer/QuickPPlugin.h
blob: 6f61c4d590e096e4f873e3e8880d15b6e6001325 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2015, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
//  This class is a simple container for a QtQuick plugin
//===========================================
#ifndef _LUMINA_DESKTOP_PANEL_PLUGIN_QUICK_H
#define _LUMINA_DESKTOP_PANEL_PLUGIN_QUICK_H

#include <QQuickWidget>
#include <QVBoxLayout>
#include "../LPPlugin.h"

#include <LUtils.h>
#include <QDebug>

class QuickPPlugin : public LPPlugin{
	Q_OBJECT
public:
	QuickPPlugin(QWidget* parent, QString ID, bool horizontal) : LPPlugin(parent, ID){
	  container = new QQuickWidget(this);
	    container->setResizeMode(QQuickWidget::SizeRootObjectToView);
	  this->layout()->addWidget(container);
	  horizontal = true; //just to silence compiler warning
	    container->setSource(QUrl::fromLocalFile( LUtils::findQuickPluginFile(ID.section("---",0,0)) ));
	}
	
	~QuickPPlugin(){}
	
private:
	QQuickWidget *container;

private slots:
	void statusChange(QQuickWidget::Status status){
	  if(status == QQuickWidget::Error){
	    qDebug() << "Quick Widget Error:" << this->type();
	  }
	}

};
#endif
bgstack15