mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
added QgsExtentGroupBox to custom widgets
This commit is contained in:
parent
8b2bbcd147
commit
346f84afb4
@ -28,6 +28,7 @@ SET (QGIS_CUSTOMWIDGETS_SRCS
|
||||
qgsdatetimeeditplugin.cpp
|
||||
qgsdatadefinedbuttonplugin.cpp
|
||||
qgsdoublespinboxplugin.cpp
|
||||
qgsextentgroupboxplugin.cpp
|
||||
qgsfieldcomboboxplugin.cpp
|
||||
qgsfieldexpressionwidgetplugin.cpp
|
||||
qgsfilterlineeditplugin.cpp
|
||||
@ -48,6 +49,7 @@ SET (QGIS_CUSTOMWIDGETS_MOC_HDRS
|
||||
qgsdatetimeeditplugin.h
|
||||
qgsdatadefinedbuttonplugin.h
|
||||
qgsdoublespinboxplugin.h
|
||||
qgsextentgroupboxplugin.h
|
||||
qgsfieldcomboboxplugin.h
|
||||
qgsfieldexpressionwidgetplugin.h
|
||||
qgsfilterlineeditplugin.h
|
||||
@ -74,6 +76,7 @@ SET(QGIS_CUSTOMWIDGETS_HDRS
|
||||
qgsdatetimeeditplugin.h
|
||||
qgsdatadefinedbuttonplugin.h
|
||||
qgsdoublespinboxplugin.h
|
||||
qgsextentgroupboxplugin.h
|
||||
qgsfieldcomboboxplugin.h
|
||||
qgsfieldexpressionwidgetplugin.h
|
||||
qgsfilterlineeditplugin.h
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "qgsdatadefinedbuttonplugin.h"
|
||||
#include "qgsdatetimeeditplugin.h"
|
||||
#include "qgsdoublespinboxplugin.h"
|
||||
#include "qgsextentgroupboxplugin.h"
|
||||
#include "qgsfieldcomboboxplugin.h"
|
||||
#include "qgsfieldexpressionwidgetplugin.h"
|
||||
#include "qgsfilterlineeditplugin.h"
|
||||
@ -44,6 +45,7 @@ QgisCustomWidgets::QgisCustomWidgets( QObject *parent )
|
||||
mWidgets.append( new QgsDataDefinedButtonPlugin( this ) );
|
||||
mWidgets.append( new QgsDateTimeEditPlugin( this ) );
|
||||
mWidgets.append( new QgsDoubleSpinBoxPlugin( this ) );
|
||||
mWidgets.append( new QgsExtentGroupBoxPlugin( this ) );
|
||||
mWidgets.append( new QgsFieldComboBoxPlugin( this ) );
|
||||
mWidgets.append( new QgsFieldExpressionWidgetPlugin( this ) );
|
||||
mWidgets.append( new QgsFilterLineEditPlugin( this ) );
|
||||
|
97
src/customwidgets/qgsextentgroupboxplugin.cpp
Normal file
97
src/customwidgets/qgsextentgroupboxplugin.cpp
Normal file
@ -0,0 +1,97 @@
|
||||
/***************************************************************************
|
||||
qgsextentroupboxplugin.cpp
|
||||
--------------------------------------
|
||||
Date : 28.07.2015
|
||||
Copyright : (C) 2015 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"
|
||||
#include "qgsextentgroupbox.h"
|
||||
#include "qgsextentgroupboxplugin.h"
|
||||
|
||||
|
||||
QgsExtentGroupBoxPlugin::QgsExtentGroupBoxPlugin( QObject *parent )
|
||||
: QObject( parent )
|
||||
, mInitialized( false )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
QString QgsExtentGroupBoxPlugin::name() const
|
||||
{
|
||||
return "QgsExtentGroupBox";
|
||||
}
|
||||
|
||||
QString QgsExtentGroupBoxPlugin::group() const
|
||||
{
|
||||
return QgisCustomWidgets::groupName();
|
||||
}
|
||||
|
||||
QString QgsExtentGroupBoxPlugin::includeFile() const
|
||||
{
|
||||
return "qgsextentroupbox.h";
|
||||
}
|
||||
|
||||
QIcon QgsExtentGroupBoxPlugin::icon() const
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
bool QgsExtentGroupBoxPlugin::isContainer() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QWidget *QgsExtentGroupBoxPlugin::createWidget( QWidget *parent )
|
||||
{
|
||||
return new QgsExtentGroupBox( parent );
|
||||
}
|
||||
|
||||
bool QgsExtentGroupBoxPlugin::isInitialized() const
|
||||
{
|
||||
return mInitialized;
|
||||
}
|
||||
|
||||
void QgsExtentGroupBoxPlugin::initialize( QDesignerFormEditorInterface *core )
|
||||
{
|
||||
Q_UNUSED( core );
|
||||
if ( mInitialized )
|
||||
return;
|
||||
mInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
QString QgsExtentGroupBoxPlugin::toolTip() const
|
||||
{
|
||||
return tr( "A group box to enter a map extent" );
|
||||
}
|
||||
|
||||
QString QgsExtentGroupBoxPlugin::whatsThis() const
|
||||
{
|
||||
return tr( "A group box to enter a map extent" );
|
||||
}
|
||||
|
||||
QString QgsExtentGroupBoxPlugin::domXml() const
|
||||
{
|
||||
return QString( "<ui language=\"c++\">\n"
|
||||
" <widget class=\"%1\" name=\"mExtentGroupBox\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>300</width>\n"
|
||||
" <height>100</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
" </widget>\n"
|
||||
"</ui>\n" )
|
||||
.arg( name() );
|
||||
}
|
48
src/customwidgets/qgsextentgroupboxplugin.h
Normal file
48
src/customwidgets/qgsextentgroupboxplugin.h
Normal file
@ -0,0 +1,48 @@
|
||||
/***************************************************************************
|
||||
qgsextentroupboxplugin.h
|
||||
--------------------------------------
|
||||
Date : 28.07.2015
|
||||
Copyright : (C) 2015 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. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSEXTENTGROUPBOXPLUGIN_H
|
||||
#define QGSEXTENTGROUPBOXPLUGIN_H
|
||||
|
||||
#include <QDesignerExportWidget>
|
||||
#include <QDesignerCustomWidgetInterface>
|
||||
|
||||
|
||||
class CUSTOMWIDGETS_EXPORT QgsExtentGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES( QDesignerCustomWidgetInterface )
|
||||
|
||||
public:
|
||||
explicit QgsExtentGroupBoxPlugin( QObject *parent = 0 );
|
||||
|
||||
private:
|
||||
bool mInitialized;
|
||||
|
||||
// QDesignerCustomWidgetInterface interface
|
||||
public:
|
||||
QString name() const override;
|
||||
QString group() const override;
|
||||
QString includeFile() const override;
|
||||
QIcon icon() const override;
|
||||
bool isContainer() const override;
|
||||
QWidget *createWidget( QWidget *parent ) override;
|
||||
bool isInitialized() const override;
|
||||
void initialize( QDesignerFormEditorInterface *core ) override;
|
||||
QString toolTip() const override;
|
||||
QString whatsThis() const override;
|
||||
QString domXml() const override;
|
||||
};
|
||||
#endif // QGSEXTENTGROUPBOXPLUGIN_H
|
Loading…
x
Reference in New Issue
Block a user