Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/*************************************************************************** | ||
qgsprojectionselectionwidgetplugin.cpp | ||
-------------------------------------- | ||
Date : 05.01.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 "qgsprojectionselectionwidget.h" | ||
#include "qgsprojectionselectionwidgetplugin.h" | ||
|
||
|
||
QgsProjectionSelectionWidgetPlugin::QgsProjectionSelectionWidgetPlugin( QObject *parent ) | ||
: QObject( parent ) | ||
, mInitialized( false ) | ||
{ | ||
} | ||
|
||
|
||
QString QgsProjectionSelectionWidgetPlugin::name() const | ||
{ | ||
return "QgsProjectionSelectionWidget"; | ||
} | ||
|
||
QString QgsProjectionSelectionWidgetPlugin::group() const | ||
{ | ||
return QgisCustomWidgets::groupName(); | ||
} | ||
|
||
QString QgsProjectionSelectionWidgetPlugin::includeFile() const | ||
{ | ||
return "qgsprojectionselectionwidget.h"; | ||
} | ||
|
||
QIcon QgsProjectionSelectionWidgetPlugin::icon() const | ||
{ | ||
return QIcon(); | ||
} | ||
|
||
bool QgsProjectionSelectionWidgetPlugin::isContainer() const | ||
{ | ||
return false; | ||
} | ||
|
||
QWidget *QgsProjectionSelectionWidgetPlugin::createWidget( QWidget *parent ) | ||
{ | ||
return new QgsProjectionSelectionWidget( parent ); | ||
} | ||
|
||
bool QgsProjectionSelectionWidgetPlugin::isInitialized() const | ||
{ | ||
return mInitialized; | ||
} | ||
|
||
void QgsProjectionSelectionWidgetPlugin::initialize( QDesignerFormEditorInterface *core ) | ||
{ | ||
Q_UNUSED( core ); | ||
if ( mInitialized ) | ||
return; | ||
mInitialized = true; | ||
} | ||
|
||
|
||
QString QgsProjectionSelectionWidgetPlugin::toolTip() const | ||
{ | ||
return tr( "A widget to select a generic projection system." ); | ||
} | ||
|
||
QString QgsProjectionSelectionWidgetPlugin::whatsThis() const | ||
{ | ||
return tr( "A widget to select a generic projection system." ); | ||
} | ||
|
||
QString QgsProjectionSelectionWidgetPlugin::domXml() const | ||
{ | ||
return QString( "<ui language=\"c++\">\n" | ||
" <widget class=\"%1\" name=\"mQgsProjectionSelectionWidget\">\n" | ||
" <property name=\"geometry\">\n" | ||
" <rect>\n" | ||
" <x>0</x>\n" | ||
" <y>0</y>\n" | ||
" <width>160</width>\n" | ||
" <height>27</height>\n" | ||
" </rect>\n" | ||
" </property>\n" | ||
" </widget>\n" | ||
"</ui>\n" ) | ||
.arg( name() ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*************************************************************************** | ||
qgsprojectionselectionwidgetplugin.h | ||
-------------------------------------- | ||
Date : 05.01.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 QGSPROJECTIONSELECTIONWIDGETPLUGIN_H | ||
#define QGSPROJECTIONSELECTIONWIDGETPLUGIN_H | ||
|
||
#include <QDesignerExportWidget> | ||
#include <QDesignerCustomWidgetInterface> | ||
|
||
|
||
class CUSTOMWIDGETS_EXPORT QgsProjectionSelectionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface | ||
{ | ||
Q_OBJECT | ||
Q_INTERFACES( QDesignerCustomWidgetInterface ) | ||
|
||
public: | ||
explicit QgsProjectionSelectionWidgetPlugin( QObject *parent = 0 ); | ||
|
||
private: | ||
bool mInitialized; | ||
|
||
// QDesignerCustomWidgetInterface interface | ||
public: | ||
QString name() const; | ||
QString group() const; | ||
QString includeFile() const; | ||
QIcon icon() const; | ||
bool isContainer() const; | ||
QWidget *createWidget( QWidget *parent ); | ||
bool isInitialized() const; | ||
void initialize( QDesignerFormEditorInterface *core ); | ||
QString toolTip() const; | ||
QString whatsThis() const; | ||
QString domXml() const; | ||
}; | ||
|
||
#endif // QGSPROJECTIONSELECTIONWIDGETPLUGIN_H |