Merge pull request #6768 from m-kuhn/remove_plugin_builder

Remove plugin builder code
This commit is contained in:
Matthias Kuhn 2018-04-09 22:33:23 +02:00 committed by GitHub
commit 3f7042d104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 0 additions and 842 deletions

View File

@ -1,184 +0,0 @@
#!/usr/bin/env python3
"""
***************************************************************************
plugin_builder.py
A script to automate creation of a new QGIS plugin using the plugin_template
--------------------------------------
Date : Sun Sep 16 12:11:04 AKDT 2007
Copyright : (C) Copyright 2007 Martin Dobias
Email :
Original authors of Perl version: Gary Sherman and Tim Sutton
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
"""
import os
import sys
import shutil
import re
def template_file(file):
return os.path.join('plugin_template', file)
def plugin_file(pluginDir, file):
return os.path.join(pluginDir, file)
# make sure we are in the plugins directory otherwise the changes this script
# will make will wreak havoc....
myDir = os.getcwd()
print("Checking that we are in the <qgis dir>/src/plugins/ directory....", end='')
pluginsDirectory = os.path.join('src', 'plugins')
if myDir[-len(pluginsDirectory):] == pluginsDirectory:
print("yes")
else:
print("no")
print(myDir)
print("Please relocate to the plugins directory before attempting to run this script.")
sys.exit(1)
# get the needed information from the user
print "Enter the directory name under qgis/src/plugins/ where your new plugin will be created."
print "We suggest using a lowercase underscore separated name e.g. clever_plugin"
print "Directory for the new plugin:",
pluginDir = raw_input()
print
print "Enter the name that will be used when creating the plugin library."
print "The name should be entered as a mixed case name with no spaces. e.g. CleverTool"
print "The plugin name will be used in the following ways:"
print "1) it will be 'lower cased' and used as the root of the generated lib name"
print " e.g. libqgis_plugin_clevertool"
print "2) in its upper cased form it will be used as the basis for class names, in particular"
print " CleverToolGuiBase <- The base class for the plugins configuration dialog / gui generated by uic"
print " CleverToolGui <- The concrete class for the plugins configuration dialog"
print "3) CleverTool <- The class that includes the plugin loader instructions and"
print " and calls to your custom application logic"
print "4) clevertool.h, clevertool.cpp etc. <- the filenames used to hold the above derived classes"
print "Plugin name:",
pluginName = raw_input()
pluginLCaseName = pluginName.lower()
print
print "Enter a short description (typically one line)"
print "e.g. The clever plugin does clever stuff in QGIS"
print "Plugin description:",
pluginDescription = raw_input()
print
print "Enter a plugin category. Category will help users"
print "to understand where to find plugin. E.g. if plugin"
print "will be available from Vector menu category is Vector"
print "Plugin category:",
pluginCategory = raw_input()
print
print "Enter the name of the application menu that will be created for your plugin"
print "Clever Tools"
print "Menu name:",
menuName = raw_input()
print
print "Enter the name of the menu entry (under the menu that you have just defined) that"
print "will be used to invoke your plugin. e.g. Clever Plugin"
print "Menu item name:",
menuItemName = raw_input()
# print a summary of what's about to happen
# and ask if we should proceed
print
print "Summary of plugin parameters:"
print "---------------------------------------------"
print "Plugin directory: ", pluginDir
print "Name of the plugin: ", pluginName
print "Description of the plugin:", pluginDescription
print "Category of the plugin: ", pluginCategory
print "Menu name: ", menuName
print "Menu item name: ", menuItemName
print
print "Warning - Proceeding will make changes to CMakeLists.txt in this directory."
print "Create the plugin? [y/n]:",
createIt = raw_input()
if createIt.lower() != 'y':
print "Plugin creation canceled, exiting"
sys.exit(2)
# create the plugin and modify the build files
# create the new plugin directory
os.mkdir(pluginDir)
# copy files to appropriate names
shutil.copy(template_file('CMakeLists.txt'), pluginDir)
shutil.copy(template_file('README.whatnext'), os.path.join(pluginDir, 'README'))
shutil.copy(template_file('plugin.qrc'), os.path.join(pluginDir, pluginLCaseName + '.qrc'))
shutil.copy(template_file('plugin.png'), os.path.join(pluginDir, pluginLCaseName + '.png'))
shutil.copy(template_file('plugin.cpp'), os.path.join(pluginDir, pluginLCaseName + '.cpp'))
shutil.copy(template_file('plugin.h'), os.path.join(pluginDir, pluginLCaseName + '.h'))
shutil.copy(template_file('plugingui.cpp'), os.path.join(pluginDir, pluginLCaseName + 'gui.cpp'))
shutil.copy(template_file('plugingui.h'), os.path.join(pluginDir, pluginLCaseName + 'gui.h'))
shutil.copy(template_file('pluginguibase.ui'), os.path.join(pluginDir, pluginLCaseName + 'guibase.ui'))
# Substitute the plugin specific vars in the various files
# This is a brute force approach but its quick and dirty :)
#
files = [plugin_file(pluginDir, 'CMakeLists.txt'),
plugin_file(pluginDir, 'README'),
plugin_file(pluginDir, pluginLCaseName + '.qrc'),
plugin_file(pluginDir, pluginLCaseName + '.cpp'),
plugin_file(pluginDir, pluginLCaseName + '.h'),
plugin_file(pluginDir, pluginLCaseName + 'gui.cpp'),
plugin_file(pluginDir, pluginLCaseName + 'gui.h'),
plugin_file(pluginDir, pluginLCaseName + 'guibase.ui')]
# replace occurrences of [pluginlcasename], [pluginname], [plugindescription], [menuname], [menutiem]
# in template with the values from user
replacements = [('\\[pluginlcasename\\]', pluginLCaseName),
('\\[pluginname\\]', pluginName),
('\\[plugindescription\\]', pluginDescription),
('\\[plugincategory\\]', pluginCategory),
('\\[menuname\\]', menuName),
('\\[menuitemname\\]', menuItemName)]
for file in files:
# read contents of the file
f = open(file)
content = f.read()
f.close()
# replace everything necessary
for repl in replacements:
content = re.sub(repl[0], repl[1], content)
# write changes to the file
f = open(file, "w")
f.write(content)
f.close()
# Add an entry to src/plugins/CMakeLists.txt
f = open('CMakeLists.txt', 'a')
f.write('\nSUBDIRS (' + pluginDir + ')\n')
f.close()
print "Your plugin %s has been created in %s, CMakeLists.txt has been modified." % (pluginName, pluginDir)
print
print "Once your plugin has successfully built, please see %s/README for" % pluginDir
print "hints on how to get started."

View File

@ -1,49 +0,0 @@
########################################################
# Files
SET ([pluginlcasename]_SRCS
[pluginlcasename].cpp
[pluginlcasename]gui.cpp
)
SET ([pluginlcasename]_UIS [pluginlcasename]guibase.ui)
SET ([pluginlcasename]_MOC_HDRS
[pluginlcasename].h
[pluginlcasename]gui.h
)
SET ([pluginlcasename]_RCCS [pluginlcasename].qrc)
########################################################
# Build
QT5_WRAP_UI ([pluginlcasename]_UIS_H ${[pluginlcasename]_UIS})
QT5_WRAP_CPP ([pluginlcasename]_MOC_SRCS ${[pluginlcasename]_MOC_HDRS})
QT5_ADD_RESOURCES([pluginlcasename]_RCC_SRCS ${[pluginlcasename]_RCCS})
ADD_LIBRARY ([pluginlcasename]plugin MODULE ${[pluginlcasename]_SRCS} ${[pluginlcasename]_MOC_SRCS} ${[pluginlcasename]_RCC_SRCS} ${[pluginlcasename]_UIS_H})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
../../core ../../core/geometry ../../core/metadata ../../core/raster
../../gui
..
)
TARGET_LINK_LIBRARIES([pluginlcasename]plugin
qgis_core
qgis_gui
)
########################################################
# Install
INSTALL(TARGETS [pluginlcasename]plugin
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})

View File

@ -1,15 +0,0 @@
##############################################
QGIS PLUGIN TEMPLATE DIRECTORY
T.Sutton 2004
##############################################
Please do not edit the files in this directory
unless you know exactly what you are doing -
these files are used as the basis for creating
new plugins. Altering these files may break
the automated plugin template generation process.
Please visit: http://qgis.org/pyqgis-cookbook/
For more information on creating plugins.

View File

@ -1,97 +0,0 @@
Welcome to your automatically generated plugin!
-------------------------------------------------------------
This is just a starting point. You now need to modify the code to make it do
something useful....read on for a more information to get yourself started.
Documentation:
-------------------------------------------------------------
You really need to read the QGIS API Documentation now at:
http://qgis.org/api/
In particular look at the following classes:
QGisInterface : http://qgis.org/api/classQgisInterface.html
QgsMapCanvas : http://qgis.org/api/classQgsMapCanvas.html
QgsMapTool : http://qgis.org/api/classQgsMapTool.html
QgisPlugin : http://qgis.org/api/classQgisPlugin.html
QGisInterface is an abstract base class (ABC) that specifies what publicly
available features of QGIS are exposed to third party code and plugins. An
instance of the QgisInterface is passed to the plugin when it loads. Please
consult the QGIS development team if there is functionality required in the
QGisInterface that is not available.
QgsPlugin is an ABC that defines required behavior your plugin must provide.
See below for more details.
What are all the files in my generated plugin directory for?
-------------------------------------------------------------
CMakeLists.txt
This is the generated CMake file that builds the plugin. You should add you
application specific dependencies and source files to this file.
[pluginlcasename].h
[pluginlcasename].cpp
This is the class that provides the 'glue' between your custom application
logic and the QGIS application. You will see that a number of methods are
already implemented for you - including some examples of how to add a raster or
vector layer to the main application map canvas. This class is a concrete
implementation of QgisPlugin (which defines required behavior for a plugin).
In particular, a plugin has a number of static methods and members so that the
QgsPluginManager and plugin loader logic can identify each plugin, create an
appropriate menu entry for it etc. Note there is nothing stopping you creating
multiple toolbar icons and menu entries for a single plugin. By default though
a single menu entry and toolbar button is created and its pre-configured to
call the run() method in this class when selected. This default implementation
provided for you by the plugin builder is well documented, so please refer to
the code for further advice.
[pluginlcasename]gui.ui
This is a Qt designer 'ui' file. It defines the look of the default plugin
dialog without implementing any application logic. You can modify this form to
suite your needs or completely remove it if your plugin does not need to
display a user form (e.g. for custom MapTools).
[pluginlcasename]gui.cpp
[pluginlcasename]gui.h
This is the concrete class where application logic for the above mentioned
dialog should go. The world is your oyster here really....
[pluginlcasename].qrc
This is the Qt4 resources file for your plugin. The Makefile generated for your
plugin is all set up to compile the resource file so all you need to do is add
your additional icons etc using the simple xml file format. Note the namespace
used for all your resources e.g. (":/[pluginname]/"). It is important to use
this prefix for all your resources. We suggest you include any other images and
run time data in this resource file too.
[pluginlcasename].png
This is the icon that will be used for your plugin menu entry and toolbar icon.
Simply replace this icon with your own icon to make your plugin distinctive
from the rest.
README
This file contains the documentation you are reading now!
Getting developer help:
-------------------------------------------------------------
For Questions and Comments regarding the plugin builder template and creating
your features in QGIS using the plugin interface please contact us via:
* the QGIS developers mailing list, or
* IRC (#qgis on freenode.net)
QGIS is distributed under the Gnu Public License. If you create a useful plugin
please consider contributing it back to the community.
Have fun and thank you for choosing QGIS.
The QGIS Team
2007

View File

@ -1,173 +0,0 @@
/***************************************************************************
[pluginlcasename].cpp
[plugindescription]
-------------------
begin : [PluginDate]
copyright : [(C) Your Name and Date]
email : [Your Email]
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
//
// QGIS Specific includes
//
#include <qgisinterface.h>
#include "qgsguiutils.h"
#include "[pluginlcasename].h"
#include "[pluginlcasename]gui.h"
//
// Qt4 Related Includes
//
#include <QAction>
#include <QToolBar>
static const QString sName = QObject::tr( "[menuitemname]" );
static const QString sDescription = QObject::tr( "[plugindescription]" );
static const QString sCategory = QObject::tr( "[plugincategory]" );
static const QString sPluginVersion = QObject::tr( "Version 0.1" );
static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
static const QString sPluginIcon = ":/[pluginlcasename]/[pluginlcasename].png";
//////////////////////////////////////////////////////////////////////
//
// THE FOLLOWING METHODS ARE MANDATORY FOR ALL PLUGINS
//
//////////////////////////////////////////////////////////////////////
/**
* Constructor for the plugin. The plugin is passed a pointer
* an interface object that provides access to exposed functions in QGIS.
* \param theQGisInterface - Pointer to the QGIS interface object
*/
[pluginname]::[pluginname]( QgisInterface *qgisInterface ):
QgisPlugin( sName, sDescription, sCategory, sPluginVersion, sPluginType ),
mQGisIface( qgisInterface )
{
}
[pluginname]::~[pluginname]()
{
}
/*
* Initialize the GUI interface for the plugin - this is only called once when the plugin is
* added to the plugin registry in the QGIS application.
*/
void [pluginname]::initGui()
{
// Create the action for tool
mQActionPointer = new QAction( QIcon( ":/[pluginlcasename]/[pluginlcasename].png" ), tr( "[menuitemname]" ), this );
mQActionPointer->setObjectName( "mQActionPointer" );
// Set the what's this text
mQActionPointer->setWhatsThis( tr( "Replace this with a short description of what the plugin does" ) );
// Connect the action to the run
connect( mQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
// Add the icon to the toolbar
mQGisIface->addToolBarIcon( mQActionPointer );
mQGisIface->addPluginToMenu( tr( "&[menuname]" ), mQActionPointer );
}
//method defined in interface
void [pluginname]::help()
{
//implement me!
}
// Slot called when the menu item is triggered
// If you created more menu items / toolbar buttons in initiGui, you should
// create a separate handler for each action - this single run() method will
// not be enough
void [pluginname]::run()
{
[pluginname]Gui *myPluginGui = new [pluginname]Gui( mQGisIface->mainWindow(), QgsGuiUtils::ModalDialogFlags );
myPluginGui->setAttribute( Qt::WA_DeleteOnClose );
myPluginGui->show();
}
// Unload the plugin by cleaning up the GUI
void [pluginname]::unload()
{
// remove the GUI
mQGisIface->removePluginMenu( "&[menuname]", mQActionPointer );
mQGisIface->removeToolBarIcon( mQActionPointer );
delete mQActionPointer;
}
//////////////////////////////////////////////////////////////////////////
//
//
// THE FOLLOWING CODE IS AUTOGENERATED BY THE PLUGIN BUILDER SCRIPT
// YOU WOULD NORMALLY NOT NEED TO MODIFY THIS, AND YOUR PLUGIN
// MAY NOT WORK PROPERLY IF YOU MODIFY THIS INCORRECTLY
//
//
//////////////////////////////////////////////////////////////////////////
/**
* Required extern functions needed for every plugin
* These functions can be called prior to creating an instance
* of the plugin class
*/
// Class factory to return a new instance of the plugin class
QGISEXTERN QgisPlugin *classFactory( QgisInterface *qgisInterfacePointer )
{
return new [pluginname]( qgisInterfacePointer );
}
// Return the name of the plugin - note that we do not user class members as
// the class may not yet be insantiated when this method is called.
QGISEXTERN QString name()
{
return sName;
}
// Return the description
QGISEXTERN QString description()
{
return sDescription;
}
// Return the category
QGISEXTERN QString category()
{
return sCategory;
}
// Return the type (either UI or MapLayer plugin)
QGISEXTERN int type()
{
return sPluginType;
}
// Return the version number for the plugin
QGISEXTERN QString version()
{
return sPluginVersion;
}
QGISEXTERN QString icon()
{
return sPluginIcon;
}
// Delete ourself
QGISEXTERN void unload( QgisPlugin *pluginPointer )
{
delete pluginPointer;
}

View File

@ -1,105 +0,0 @@
/***************************************************************************
[pluginlcasename].h
-------------------
begin : Jan 21, 2004
copyright : (C) 2004 by Tim Sutton
email : tim@linfiniti.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. *
* *
***************************************************************************/
/***************************************************************************
* QGIS Programming conventions:
*
* mVariableName - a class level member variable
* sVariableName - a static class level member variable
* variableName() - accessor for a class member (no 'get' in front of name)
* setVariableName() - mutator for a class member (prefix with 'set')
*
* Additional useful conventions:
*
* variableName - a method parameter (prefix with 'the')
* myVariableName - a locally declared variable within a method ('my' prefix)
*
* DO: Use mixed case variable names - myVariableName
* DON'T: separate variable names using underscores: my_variable_name (NO!)
*
* **************************************************************************/
#ifndef [pluginname]_H
#define [pluginname]_H
//QT includes
#include <QObject>
//QGIS includes
#include "../qgisplugin.h"
//forward declarations
class QAction;
class QToolBar;
class QgisInterface;
/**
* \class Plugin
* \brief [name] plugin for QGIS
* [description]
*/
class [pluginname]: public QObject, public QgisPlugin
{
Q_OBJECT
public:
//////////////////////////////////////////////////////////////////////
//
// MANDATORY PLUGIN METHODS FOLLOW
//
//////////////////////////////////////////////////////////////////////
/**
* Constructor for a plugin. The QgisInterface pointer is passed by
* QGIS when it attempts to instantiate the plugin.
* \param interface Pointer to the QgisInterface object.
*/
[pluginname]( QgisInterface *interface );
//! Destructor
virtual ~[pluginname]();
public slots:
//! init the gui
virtual void initGui();
//! Show the dialog box
void run();
//! unload the plugin
void unload();
//! show the help document
void help();
private:
////////////////////////////////////////////////////////////////////
//
// MANDATORY PLUGIN PROPERTY DECLARATIONS .....
//
////////////////////////////////////////////////////////////////////
int mPluginType;
//! Pointer to the QGIS interface object
QgisInterface *mQGisIface = nullptr;
//!pointer to the qaction for this plugin
QAction *mQActionPointer = nullptr;
////////////////////////////////////////////////////////////////////
//
// ADD YOUR OWN PROPERTY DECLARATIONS AFTER THIS POINT.....
//
////////////////////////////////////////////////////////////////////
};
#endif //[pluginname]_H

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/[pluginlcasename]/" >
<file>[pluginlcasename].png</file>
</qresource>
</RCC>

View File

@ -1,100 +0,0 @@
/***************************************************************************
* Copyright (C) 2003 by Tim Sutton *
* tim@linfiniti.com *
* *
* This is a plugin generated from the QGIS plugin template *
* *
* 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 "[pluginlcasename]gui.h"
#include "qgshelp.h"
//qt includes
//standard includes
[pluginname]Gui::[pluginname]Gui( QWidget *parent, Qt::WindowFlags fl )
: QDialog( parent, fl )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &[pluginname]Gui::showHelp );
// Below is an example of how to make the translators job
// much easier. Please follow this general guideline for LARGE
// pieces of text. One-liners can be added in the .ui file
// Note: Format does not relate to translation.
QString format( "<html><body><h3>%1</h3>%2<h3>%3</h3>%4<p><a href=http://qgis.org/api>"
"http://qgis.org/api</a><p>"
"%5<p>%6<p>%7<p>%8<p><h3>%9</h3>"
"<h4>CMakeLists.txt</h4>%11"
"<h4>[pluginlcasename].h, [pluginlcasename].cpp</h4>%12"
"<h4>[pluginlcasename]gui.ui</h4>%13"
"<h4>[pluginlcasename]gui.cpp, [pluginlcasename]gui.h</h4>%14"
"<h4>[pluginlcasename].qrc</h4>%15"
"<h4>[pluginlcasename].png</h4>%16"
"<h4>README</h4>%17"
"<h3>%18</h3>%19<ul>%20</ul>%21<p>%22"
"<p><b>The QGIS Team</b>"
"</body></html>" );
// Note: Table does not translate
QString table( "<table><tr><td>QGisInterface<td><a href=http://qgis.org/api/classQgisInterface.html>"
"http://qgis.org/api/classQgisInterface.html</a>"
"<tr><td>QgsMapCanvas<td><a href=http://qgis.org/api/classQgsMapCanvas.html>"
"http://qgis.org/api/classQgsMapCanvas.html</a>"
"<tr><td>QgsMapTool<td><a href=http://qgis.org/api/classQgsMapTool.html>"
"http://qgis.org/api/classQgsMapTool.html</a>"
"<tr><td>QgsPlugin<td><a href=http://qgis.org/api/classQgisPlugin.html>"
"http://qgis.org/api/classQgisPlugin.html</a></table>" );
// Note: Translatable strings below
QString text = format
.arg( tr( "Welcome to your automatically generated plugin!" ) )
.arg( tr( "This is just a starting point. You now need to modify the code to make it do something useful....read on for a more information to get yourself started." ) )
.arg( tr( "Documentation:" ) )
.arg( tr( "You really need to read the QGIS API Documentation now at:" ) )
.arg( tr( "In particular look at the following classes:" ) )
.arg( table )
.arg( "QGisInterface is an abstract base class (ABC) that specifies what publicly available features of QGIS are exposed to third party code and plugins. An instance of the QgisInterface is passed to the plugin when it loads. Please consult the QGIS development team if there is functionality required in the QGisInterface that is not available." )
.arg( tr( "QgsPlugin is an ABC that defines required behavior your plugin must provide. See below for more details." ) )
.arg( tr( "What are all the files in my generated plugin directory for?" ) )
.arg( tr( "This is the generated CMake file that builds the plugin. You should add you application specific dependencies and source files to this file." ) )
.arg( tr( "This is the class that provides the 'glue' between your custom application logic and the QGIS application. You will see that a number of methods are already implemented for you - including some examples of how to add a raster or vector layer to the main application map canvas. This class is a concrete instance of the QgisPlugin interface which defines required behavior for a plugin. In particular, a plugin has a number of static methods and members so that the QgsPluginManager and plugin loader logic can identify each plugin, create an appropriate menu entry for it etc. Note there is nothing stopping you creating multiple toolbar icons and menu entries for a single plugin. By default though a single menu entry and toolbar button is created and its pre-configured to call the run() method in this class when selected. This default implementation provided for you by the plugin builder is well documented, so please refer to the code for further advice." ) )
.arg( tr( "This is a Qt designer 'ui' file. It defines the look of the default plugin dialog without implementing any application logic. You can modify this form to suite your needs or completely remove it if your plugin does not need to display a user form (e.g. for custom MapTools)." ) )
.arg( tr( "This is the concrete class where application logic for the above mentioned dialog should go. The world is your oyster here really…" ) )
.arg( tr( "This is the Qt4 resources file for your plugin. The Makefile generated for your plugin is all set up to compile the resource file so all you need to do is add your additional icons etc using the simple xml file format. Note the namespace used for all your resources e.g. (':/Homann/'). It is important to use this prefix for all your resources. We suggest you include any other images and run time data in this resource file too." ) )
.arg( tr( "This is the icon that will be used for your plugin menu entry and toolbar icon. Simply replace this icon with your own icon to make your plugin distinctive from the rest." ) )
.arg( tr( "This file contains the documentation you are reading now!" ) )
.arg( tr( "Getting developer help:" ) )
.arg( tr( "For Questions and Comments regarding the plugin builder template and creating your features in QGIS using the plugin interface please contact us via:" ) )
.arg( tr( "<li> the QGIS developers mailing list, or </li><li> IRC (#qgis on freenode.net)</li>" ) )
.arg( tr( "QGIS is distributed under the Gnu Public License. If you create a useful plugin please consider contributing it back to the community." ) )
.arg( tr( "Have fun and thank you for choosing QGIS." ) );
textBrowser->setHtml( text );
}
[pluginname]Gui::~[pluginname]Gui()
{
}
void [pluginname]Gui::on_buttonBox_accepted()
{
//close the dialog
accept();
}
void [pluginname]Gui::on_buttonBox_rejected()
{
reject();
}
void [pluginname]Gui::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "plugins/plugins.html#[pluginname]" ) );
}

View File

@ -1,38 +0,0 @@
/***************************************************************************
* Copyright (C) 2003 by Tim Sutton *
* tim@linfiniti.com *
* *
* This is a plugin generated from the QGIS plugin template *
* *
* 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 [pluginname]GUI_H
#define [pluginname]GUI_H
#include <QDialog>
#include <ui_[pluginlcasename]guibase.h>
/**
@author Tim Sutton
*/
class [pluginname]Gui : public QDialog, private Ui::[pluginname]GuiBase
{
Q_OBJECT
public:
[pluginname]Gui( QWidget *parent = nullptr, Qt::WindowFlags fl = nullptr );
~[pluginname]Gui();
private:
static const int context_id = 0;
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void showHelp();
};
#endif

View File

@ -1,76 +0,0 @@
<ui version="4.0" >
<class>[pluginname]GuiBase</class>
<widget class="QDialog" name="[pluginname]GuiBase" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>584</width>
<height>435</height>
</rect>
</property>
<property name="windowTitle" >
<string>QGIS Plugin Template</string>
</property>
<property name="windowIcon" >
<iconset/>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="txtHeading" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font" >
<font>
<family>Sans Serif</family>
<pointsize>24</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text" >
<string>Plugin Template</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QTextBrowser" name="textBrowser" >
<property name="openExternalLinks" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok|QDialogButtonBox::SaveAll</set>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<resources/>
<connections/>
</ui>