[Qgis-developer] Problems while including .h files in QGIS code

Germán Carrillo carrillo.german at gmail.com
Sat Mar 7 17:38:30 PST 2015


Hi All,

I'd like to let (PyQGIS) users choose between Table and Form View when
calling showAttributeTable() via QgisInterface. I'm preparing a pull
request for that.

However, I'm having a hard time with includes, since once I add #include
"qgsdualview.h" in my qgisInterface.h file, I get the following error:


*    .../QGIS/src/providers/delimitedtext/../../gui/qgisinterface.h:49:25:
fatal error: qgsdualview.h: No such file or directory #include
"qgsdualview.h"*
Of course, if I don't add such include, I get a "qgisinterface.h:296:57:
error: 'QgsDualView' has not been declared" error.

On the other hand, if I add the (../gui/attributetable) path to
CMakeLists.txt I start getting problems with the Interpolation plugin,
namely:

*
QGIS/src/plugins/interpolation/../../gui/attributetable/qgsdualview.h:21:32:
fatal error: ui_qgsdualviewbase.h: No such file or directory #include
"ui_qgsdualviewbase.h"*

Which I couldn't resolve.

I would avoid this problem by using a boolean value (bool formViewMode =
False)  as parameter of showAttributeTable() but I guess it's better and
clearer to use the QgsDualView::ViewMode enum, even if it's more complex to
implement.

The code I'm working on can be accessed in this branch [1].

What would be the correct way of dealing with such include?

Regards,

Germán
--
[1] https://github.com/gacarrillor/QGIS/tree/editform
-- 
-----------
   |\__
(:>__)(
   |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150307/96f6858a/attachment.html>


More information about the Qgis-developer mailing list