2014-09-25 15:14:27 +02:00
|
|
|
/***************************************************************************
|
|
|
|
qgsspinboxplugin.cpp
|
|
|
|
--------------------------------------
|
|
|
|
Date : 01.09.2014
|
|
|
|
Copyright : (C) 2014 Denis Rouzaud
|
|
|
|
Email : denis.rouzaud@gmail.com
|
|
|
|
***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include "qgiscustomwidgets.h"
|
2015-06-10 13:59:08 +02:00
|
|
|
#include "qgsspinboxplugin.h"
|
2015-06-10 14:54:12 +02:00
|
|
|
#include "qgsspinbox.h"
|
2014-09-25 15:14:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
QgsSpinBoxPlugin::QgsSpinBoxPlugin( QObject *parent )
|
2017-03-03 08:42:00 +01:00
|
|
|
: QObject( parent )
|
|
|
|
, mInitialized( false )
|
2014-09-25 15:14:27 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString QgsSpinBoxPlugin::name() const
|
|
|
|
{
|
|
|
|
return "QgsSpinBox";
|
|
|
|
}
|
|
|
|
|
|
|
|
QString QgsSpinBoxPlugin::group() const
|
|
|
|
{
|
|
|
|
return QgisCustomWidgets::groupName();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString QgsSpinBoxPlugin::includeFile() const
|
|
|
|
{
|
|
|
|
return "qgsspinbox.h";
|
|
|
|
}
|
|
|
|
|
|
|
|
QIcon QgsSpinBoxPlugin::icon() const
|
|
|
|
{
|
2015-11-03 10:30:43 +01:00
|
|
|
return QIcon( ":/images/icons/qgis-icon-60x60.png" );
|
2014-09-25 15:14:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QgsSpinBoxPlugin::isContainer() const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
QWidget *QgsSpinBoxPlugin::createWidget( QWidget *parent )
|
|
|
|
{
|
|
|
|
return new QgsSpinBox( parent );
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QgsSpinBoxPlugin::isInitialized() const
|
|
|
|
{
|
|
|
|
return mInitialized;
|
|
|
|
}
|
|
|
|
|
|
|
|
void QgsSpinBoxPlugin::initialize( QDesignerFormEditorInterface *core )
|
|
|
|
{
|
2019-05-15 09:16:27 +02:00
|
|
|
Q_UNUSED( core )
|
2014-09-25 15:14:27 +02:00
|
|
|
if ( mInitialized )
|
|
|
|
return;
|
|
|
|
mInitialized = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString QgsSpinBoxPlugin::toolTip() const
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
QString QgsSpinBoxPlugin::whatsThis() const
|
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
QString QgsSpinBoxPlugin::domXml() const
|
|
|
|
{
|
|
|
|
return QString( "<ui language=\"c++\">\n"
|
|
|
|
" <widget class=\"%1\" name=\"mQgsSpinBox\">\n"
|
|
|
|
" <property name=\"geometry\">\n"
|
|
|
|
" <rect>\n"
|
|
|
|
" <x>0</x>\n"
|
|
|
|
" <y>0</y>\n"
|
|
|
|
" <width>90</width>\n"
|
|
|
|
" <height>27</height>\n"
|
|
|
|
" </rect>\n"
|
|
|
|
" </property>\n"
|
|
|
|
" </widget>\n"
|
|
|
|
"</ui>\n" )
|
|
|
|
.arg( name() );
|
|
|
|
}
|