#include <QVBoxLayout>
#include <QtPlugin>
#include "SimpleExample.h"
using namespace simpleexampleplugin;
SimpleExample::SimpleExample()
{
}
bool
{
this->service = service;
widget_ = new QWidget();
qlabel_ = new QLabel( "example string" );
QVBoxLayout* layout = new QVBoxLayout();
widget_->setLayout( layout );
layout->addWidget( qlabel_ );
connect( service, SIGNAL( treeItemIsSelected( cubepluginapi::TreeItem* ) ),
this, SLOT( treeItemIsSelected( cubepluginapi::TreeItem* ) ) );
return true;
}
void
SimpleExample::cubeClosed()
{
delete widget_;
}
void
SimpleExample::version( int& major, int& minor, int& bugfix ) const
{
major = 1;
minor = 0;
bugfix = 0;
}
QString
SimpleExample::name() const
{
return "Simple Example";
}
QString
SimpleExample::getHelpText() const
{
return "Just a simple example.";
}
QWidget*
SimpleExample::widget()
{
return widget_;
}
QString
SimpleExample::label() const
{
return "Example Plugin Label";
}
void
SimpleExample::treeItemIsSelected( TreeItem* item )
{
QString txt = item->getName() + " " + QString::number( item->getValue() );
qlabel_->setText( txt );
}