[Qgis-developer] Help needed for 1st dive into Qgis C++ - Access and modify the Scale List combo box

kimaidou kimaidou at gmail.com
Mon May 7 01:03:06 PDT 2012


Hi devs,

I would like to learn C++ and understand Qgis code organisation, in order
to participate in making a better Qgis. This is why I am trying to propose
a simple new feature : in the project properties dialog, let the user
choose the scales he vould like to use for the current project. Then, use
these scales to replace the predefined scales in the status bar scales
list. The next step would be to optionnaly force Qgis to stick to these
scales when zooming in/out/extent, etc.

I have already coded the "project properties dialog" part : manage a list
of scales, with add/delete buttons, and read/save in the project xml file.
Now I need to interact with the scale list, wich is normally added by
src/app/qgisapp.cpp by the method
   QgisApp::createStatusBar()

The scale list is creating using the class QgsScaleComboBox :
mScaleEdit = new QgsScaleComboBox( statusBar() );

Now, I need som help. I tried to access the scale list directly using
QgisApp::instance()->statusBar() , but with no success.
I think what I should do is to add a method
QgsScaleComboBox::update(QStringList)  in qgsscalecombobox.cpp which change
the content of the list. But then, how can I access this method from
qgsprojectproperties.cpp ?

Thanks in advance

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120507/caf9138d/attachment.html


More information about the Qgis-developer mailing list