moved to shstk
This commit is contained in:
81
libs/touch_widgets/plugin/touchsliderplugin.cpp
Normal file
81
libs/touch_widgets/plugin/touchsliderplugin.cpp
Normal file
@@ -0,0 +1,81 @@
|
||||
#include "touchslider.h"
|
||||
#include "touchsliderplugin.h"
|
||||
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QDesignerFormEditorInterface>
|
||||
#include <QDesignerPropertyEditorInterface>
|
||||
|
||||
|
||||
TouchSliderPlugin::TouchSliderPlugin(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
void TouchSliderPlugin::initialize(QDesignerFormEditorInterface * /* core */)
|
||||
{
|
||||
if (m_initialized)
|
||||
return;
|
||||
|
||||
// Add extension registrations, etc. here
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
bool TouchSliderPlugin::isInitialized() const
|
||||
{
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
QWidget *TouchSliderPlugin::createWidget(QWidget *parent)
|
||||
{
|
||||
TouchSlider * ts = new TouchSlider(parent);
|
||||
ts->setMinimum(-5.);
|
||||
ts->setMaximum(5.);
|
||||
ts->setPrecision(0.2);
|
||||
ts->setValue(2.2);
|
||||
ts->setPrefix("Distanse");
|
||||
ts->setSuffix("meters");
|
||||
return ts;
|
||||
}
|
||||
|
||||
QString TouchSliderPlugin::name() const
|
||||
{
|
||||
return QLatin1String("TouchSlider");
|
||||
}
|
||||
|
||||
QString TouchSliderPlugin::group() const
|
||||
{
|
||||
return QLatin1String("Touch Widgets");
|
||||
}
|
||||
|
||||
QIcon TouchSliderPlugin::icon() const
|
||||
{
|
||||
return QIcon(":/icons/touchslider.png");
|
||||
}
|
||||
|
||||
QString TouchSliderPlugin::toolTip() const
|
||||
{
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
QString TouchSliderPlugin::whatsThis() const
|
||||
{
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
bool TouchSliderPlugin::isContainer() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QString TouchSliderPlugin::domXml() const
|
||||
{
|
||||
return QLatin1String("<widget class=\"TouchSlider\" name=\"touchSlider\">\n</widget>\n");
|
||||
}
|
||||
|
||||
QString TouchSliderPlugin::includeFile() const
|
||||
{
|
||||
return QLatin1String("touchslider.h");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user