mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Connect up to projectRead signal...
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@2263 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
96d86666fa
commit
140d2993da
@ -104,10 +104,20 @@ void Plugin::initGui()
|
||||
myQActionPointer = new QAction("Copyright Label", QIconSet(icon), "&Wmi",0, this, "run");
|
||||
// Connect the action to the run
|
||||
connect(myQActionPointer, SIGNAL(activated()), this, SLOT(run()));
|
||||
// This calls the north arrow renderer everytime the cnavas has drawn itself
|
||||
// This calls the renderer everytime the cnavas has drawn itself
|
||||
connect(qGisInterface->getMapCanvas(), SIGNAL(renderComplete(QPainter *)), this, SLOT(renderLabel(QPainter *)));
|
||||
//this resets this plugin up if a project is loaded
|
||||
connect(qgisMainWindowPointer, SIGNAL(projectRead()), this, SLOT(projectRead()));
|
||||
|
||||
// Add the icon to the toolbar
|
||||
qGisInterface->addToolBarIcon(myQActionPointer);
|
||||
//initialise default values in the gui
|
||||
projectRead();
|
||||
}
|
||||
|
||||
void Plugin::projectRead()
|
||||
{
|
||||
std::cout << "Copyright plugin - project read slot called...." << std::endl;
|
||||
//default text to start with - try to fetch it from qgsproject
|
||||
QgsProject::Properties myProperties = QgsProject::instance()->properties("CopyrightLabel");
|
||||
for ( QgsProject::Properties::const_iterator i = myProperties.begin();
|
||||
@ -147,7 +157,6 @@ void Plugin::initGui()
|
||||
mLabelQColor = QColor(Qt::black);
|
||||
|
||||
refreshCanvas();
|
||||
|
||||
}
|
||||
//method defined in interface
|
||||
void Plugin::help()
|
||||
|
@ -45,7 +45,9 @@ class Plugin:public QObject, public QgisPlugin
|
||||
virtual ~ Plugin();
|
||||
public slots:
|
||||
//! init the gui
|
||||
virtual void initGui();
|
||||
void initGui();
|
||||
//!set values on the gui when a project is read or the gui first loaded
|
||||
void projectRead();
|
||||
//! Show the dialog box
|
||||
void run();
|
||||
void renderLabel(QPainter *);
|
||||
|
Loading…
x
Reference in New Issue
Block a user