#include <QtPlugin>
#include <QDebug>
#include <QPushButton>
#include <QVBoxLayout>
#include <QFileDialog>
#include "ContextFreePluginExample.h"
#include "Cube.h"
using namespace contextfreepluginexample;
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2( ContextFreePluginExample, ContextFreePluginExample )
#endif
void
ContextFreePluginExample::version( int& major, int& minor, int& bugfix ) const
{
major = 1;
minor = 0;
bugfix = 0;
}
QString
ContextFreePluginExample::name() const
{
return "Context Free Demo";
}
void
{
this->service = service;
qDebug() << "context free plugin opened";
QVBoxLayout* layout = new QVBoxLayout();
widget->setLayout( layout );
QPushButton* but = new QPushButton( "Load cube file" );
layout->addWidget( but );
connect( but, SIGNAL( clicked() ), this, SLOT( startAction() ) );
}
void
ContextFreePluginExample::startAction()
{
QString openFileName = QFileDialog::getOpenFileName( service->
getWidget(),
tr( "Choose a file to open" ),
"",
tr( "Cube3/4 files (*cube *cube.gz *.cubex);;Cube4 files (*.cubex);;Cube3 files (*.cube.gz *.cube);;All files (*.*);;All files (*)" ) );
cube::Cube* cube = new cube::Cube();
cube->openCubeReport( openFileName.toStdString() );
}
void
ContextFreePluginExample::closed()
{
qDebug() << "context free plugin closed";
}
QString
ContextFreePluginExample::getHelpText() const
{
return "context free plugin help text";
}