Skip to content

Commit

Permalink
Implemented close and cancale sig/slot in default generated gui
Browse files Browse the repository at this point in the history
Added detailed instructions for getting started with the new gnerataed plugin once it is build.
Added some better comments to plugin.cpp


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5204 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Apr 6, 2006
1 parent 1e7d2c8 commit 7baf95f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 107 deletions.
13 changes: 9 additions & 4 deletions src/plugins/plugin_template/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,16 @@ static const QgisPlugin::PLUGINTYPE sPluginType = QgisPlugin::UI;
}

/*
* Initialize the GUI interface for the plugin
* 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()
{
// we create a single menu entry for this plugin - though you can easily add more here if you need to
QMenu *pluginMenu = mQGisIface->getPluginMenu("&[menuname]");
//set teh icon from the resource file
//set the icon from the resource file
mMenuId = pluginMenu->insertItem(QIcon(":/[pluginlcasename]/[pluginlcasename].png"),"&[menuitemname]", this, SLOT(run()));

//create a tooltip for the menu entry
pluginMenu->setWhatsThis(mMenuId, tr("Replace this with a short description of the what the plugin does"));

// Create the action for tool
Expand All @@ -111,7 +113,10 @@ void [pluginname]::help()
//implement me!
}

// Slot called when the buffer menu item is activated
// Slot called when the menu item is activated
// 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(mQGisApp, QgisGui::ModalDialogFlags);
Expand Down
Loading

0 comments on commit 7baf95f

Please sign in to comment.