Re: [Qgis-developer] QGIS custom widgets with python plugins

2014-11-25 Thread Denis Rouzaud

Hi Stefan,

To properly compile the UI file using pyuic4, you need to have the uic 
widget plugin installed.


This is the file qgis_customwidgets.py that should be located in 
/usr/lib/python2.7/dist-packages/PyQt4/uic/widget-plugins/


This file can be either installed by the package python-qgis-common or 
using -WITH_CUSTOM_WIDGETS=TRUE if you compile your own QGIS (I suppose 
this requires a make install).


Let me know if this helps.

Best wishes,

Denis

On 14.11.2014 16:13, Ziegler Stefan wrote:

Hi

I sucessfully used QGIS custom widgets (eg. qgscollapsiblegroupbox) in qt designer in and then with 
python plugins with uic.loadUiType(). Using the traditional pyuic approach 
I get an missing module error when starting QGIS:

ImportError: No module named qgscollapsiblegroupbox

I'm on Ubuntu 14.04 with an own compiled QGIS master. Do I have to put 
libqgis_customwidgets.so.2.7.0 somewhere specific? Or is there anything else 
I have to do?

Regards
Stefan

Freundliche Grüsse
Stefan Ziegler
Kantonsgeometer

Amt für Geoinformation
Amtliche Vermessung
Rötistrasse 4
4500 Solothurn

Telefon +41 32 627 75 96
Telefax +41 32 627 75 98
stefan.zieg...@bd.so.ch
http://www.so.ch


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] QGIS custom widgets with python plugins

2014-11-25 Thread Arnaud Morvan


If you install QGIS to custom path, you should set some environment 
variables before calling pyuic4


exemple:

export QGIS_PREFIX_PATH=~/apps/qgis-master
export LD_LIBRARY_PATH=$QGIS_PREFIX_PATH/lib
export PYTHONPATH=$QGIS_PREFIX_PATH/share/qgis/python/:$PYTHONPATH

Personnally, I've added one line in
/usr/lib/python2.7/dist-packages/PyQt4/uic/widget-plugins/qgis_customwidgets.py

pluginType = MODULE
def moduleInformation():
try:
import qgis.gui
return qgis.gui, dir(qgis.gui)
except ImportError:
*print impossible to import qgis.gui*
return , []

to detect import error

Arnaud


Le 25/11/2014 09:35, Denis Rouzaud a écrit :

Hi Stefan,

To properly compile the UI file using pyuic4, you need to have the uic 
widget plugin installed.


This is the file qgis_customwidgets.py that should be located in 
/usr/lib/python2.7/dist-packages/PyQt4/uic/widget-plugins/


This file can be either installed by the package python-qgis-common or 
using -WITH_CUSTOM_WIDGETS=TRUE if you compile your own QGIS (I 
suppose this requires a make install).


Let me know if this helps.

Best wishes,

Denis

On 14.11.2014 16:13, Ziegler Stefan wrote:

Hi

I sucessfully used QGIS custom widgets (eg. qgscollapsiblegroupbox) 
in qt designer in and then with python plugins with 
uic.loadUiType(). Using the traditional pyuic approach I get an 
missing module error when starting QGIS:


ImportError: No module named qgscollapsiblegroupbox

I'm on Ubuntu 14.04 with an own compiled QGIS master. Do I have to 
put libqgis_customwidgets.so.2.7.0 somewhere specific? Or is there 
anything else I have to do?


Regards
Stefan

Freundliche Grüsse
Stefan Ziegler
Kantonsgeometer

Amt für Geoinformation
Amtliche Vermessung
Rötistrasse 4
4500 Solothurn

Telefon +41 32 627 75 96
Telefax +41 32 627 75 98
stefan.zieg...@bd.so.ch
http://www.so.ch


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


--
Arnaud Morvan
Ingénieur logiciel
Tél: +33 (0)4 79 26 57 95

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Building QGIS 2.6 from sources failed

2014-11-25 Thread Nejia
Hi,

 

I'm trying to built QGIS 2.6 from sources ; qgis_app failed:

 

235moc: Cannot create
C:/DEV/QGIS_Sources/QGIS-release-2_6/ms-windows/osgeo4w/build-x86/src/app/gp
s/qwtpolar-0.1/moc_qwt_polar_panner.cxx

235Project : error PRJ0019: A tool returned an error code from Generating
gps/qwtpolar-0.1/moc_qwt_polar_panner.cxx

234Generating gps/qwtpolar-0.1/moc_qwt_polar_magnifier.cxx

235Creating browse information file...

235Microsoft Browse Information Maintenance Utility Version 9.00.21022

235Copyright (C) Microsoft Corporation. All rights reserved.

235BSCMAKE: error BK1506 : cannot open file
'.\qgis_app.dir\RelWithDebInfo\qgisappinterface.sbr': No such file or
directory

234Generating gps/qwtpolar-0.1/moc_qwt_polar_canvas.cxx

235Build log was saved at
file://c:\DEV\QGIS_Sources\QGIS-release-2_6\ms-windows\osgeo4w\build-x86\sr
c\app\qgis_app.dir\RelWithDebInfo\BuildLog.htm

235qgis_app - 2 error(s), 0 warning(s)

 

If I clean ALL_BUILD and rebuild qgis failed:

 

234moc: Cannot create
C:/DEV/QGIS_Sources/QGIS-release-2_6/ms-windows/osgeo4w/build-x86/src/app/op
enstreetmap/moc_qgsosmimportdialog.cxx

235Generating openstreetmap/moc_qgsosmdownloaddialog.cxx

234Project : error PRJ0019: A tool returned an error code from Generating
openstreetmap/moc_qgsosmimportdialog.cxx

234Creating browse information file...

234Microsoft Browse Information Maintenance Utility Version 9.00.21022

234Copyright (C) Microsoft Corporation. All rights reserved.

234BSCMAKE: error BK1506 : cannot open file
'.\qgis.dir\RelWithDebInfo\qgisapp.sbr': No such file or directory

235Generating gps/moc_qgsgpsinformationwidget.cxx

234Build log was saved at
file://c:\DEV\QGIS_Sources\QGIS-release-2_6\ms-windows\osgeo4w\build-x86\sr
c\app\qgis.dir\RelWithDebInfo\BuildLog.htm

234qgis - 2 error(s), 0 warning(s)

 

Regards,

Nejia

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] (no subject)

2014-11-25 Thread Theuns Heydenrych
Hi
In QGIS versions before 2.6 , I could right click and show a custom popup
menu from the QgsMapCanvas, but not anymore. Its like something is
consuming the right click event on the QgsMapCanvas.
Do anyone know anything about this?
How can I get a right click event from the QgsMapCanvas again?

I have connected a slot to the customContextMenuRequested signal of the
QWidget where on my QgsMapCanvas instance is displaying. In versions before
2.6 i could display my custom menu on a right click on the QgsMapCanvas,
but not anymore. :-(

Regards
Theuns Heydenrych
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Right click event from QgsMapCanvas

2014-11-25 Thread Theuns Heydenrych
First I would like to apologise for sending a mail without a subject, had
some finger trouble there, sorry.

In QGIS versions before 2.6 , I could right click and show a custom popup
menu from the QgsMapCanvas, but not anymore. Its like something is
consuming the right click event on the QgsMapCanvas.
Do anyone know anything about this?
How can I get a right click event from the QgsMapCanvas again?

I have connected a slot to the customContextMenuRequested signal of the
QWidget where on my QgsMapCanvas instance is displaying. In versions before
2.6 i could display my custom menu on a right click on the QgsMapCanvas,
but not anymore. :-(

Regards
Theuns Heydenrych
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] User-contributed scripts/models for Processing

2014-11-25 Thread kimaidou
Hi Alexander,

As an author of some scripts, I think this feature is a great opportunities
to easily share useful snippets. I am not sure though we made enough
publicity around it. I fear only power users will have the idea to open
the branches of processing toolbox and discover there is a Scripts / Tools
/ Get scripts from collection. I have no idea though how to improve this.

I would prefer to use Github bugtracker, but I have no strong opinion about
it.

I agree we should warn the users and tell them the provided scripts are
like extensions, delivered as is.


Cheers,
Michael

2014-11-18 16:40 GMT+01:00 Alexander Bruy alexander.b...@gmail.com:

 Hi all and sorry for cross-posting,

 you may have know that we have a GitHub repo with user-contributed scripts
 and models for Processing [0] and Processing itself provides easy way to
 download them for further use.

 This scripts/models may contain bugs or one may want to submit feature
 request.
 Unfortunately right now there is no central place for this. So we have
 two options
 here:
  1. create special category in QGIS bugtracker
  2. use GitHub bugtracker

 Another thing, as this scripts and models (well, the biggest part of
 them) actually
 contributed by users, core developers are not responsible to their
 bugs. But users often think that if they use script/model in QGIS that
 this is QGIS bug and complain. Maybe we should add a
 warning/explanation to download dialog?

 Opinions?

 [0] https://github.com/qgis/QGIS-Processing


 --
 Alexander Bruy
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] (no subject)

2014-11-25 Thread Theuns Heydenrych
Problem solved.
I connected to the parent widget's customContextMenuRequested signal,
instead of the QgsMapCanvas's customContextMenuRequested signal.

On Tue, Nov 25, 2014 at 11:58 AM, Theuns Heydenrych 
theunsheydenr...@gmail.com wrote:

 Hi
 In QGIS versions before 2.6 , I could right click and show a custom popup
 menu from the QgsMapCanvas, but not anymore. Its like something is
 consuming the right click event on the QgsMapCanvas.
 Do anyone know anything about this?
 How can I get a right click event from the QgsMapCanvas again?

 I have connected a slot to the customContextMenuRequested signal of the
 QWidget where on my QgsMapCanvas instance is displaying. In versions before
 2.6 i could display my custom menu on a right click on the QgsMapCanvas,
 but not anymore. :-(

 Regards
 Theuns Heydenrych


 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Right click event from QgsMapCanvas

2014-11-25 Thread theunsgis
Problem solved.
I connected to the parent widget's customContextMenuRequested signal,
instead of the QgsMapCanvas's customContextMenuRequested signal. 



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Right-click-event-from-QgsMapCanvas-tp5174732p5174783.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] Core Python plugins and their dependencies

2014-11-25 Thread Alexander Bruy
Hi all,

do we have any policy about dependencies of core Python plugins?
Current situation
is a bit messy and confusing.

DB Manager depends on psycopg2 and pyspatialite, but we does not ship this
packages into QGIS source tree. Same for Processing, it contains several
algorithms that require matplotlib and we does not bundle matplotlib in QGIS
source tree. And it is fine, as user can easily install this packages
using package
manager or pip.

On other hand MetaSearch adds 7.4 Mb of dependecies to QGIS sources, while
in most Linux distributions this packages available from repositories
or from PyPI.
Even under Windows this packages present in OSGeo4W installer.

I think it would be good to have clear policy on this. Personally I
think that we
should avoid including Python dependencies in QGIS sources and if plugin
requires some 3rd party libs, we can make it disabled by default ot
even optional (so it will be compiled and installed only if all
necessary dependencies already available).

Opinions?

-- 
Alexander Bruy
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Core Python plugins and their dependencies

2014-11-25 Thread Jürgen E . Fischer
Hi Alex,

On Tue, 25. Nov 2014 at 15:06:30 +0200, Alexander Bruy wrote:
 DB Manager depends on psycopg2 and pyspatialite, but we does not ship this
 packages into QGIS source tree. Same for Processing, it contains several
 algorithms that require matplotlib and we does not bundle matplotlib in QGIS
 source tree. And it is fine, as user can easily install this packages using
 package manager or pip.

We ship pyspatialite - that's not available everywhere and in case we're using
internal spatialite it should be built against that version.


 I think it would be good to have clear policy on this.

Well, I don't have a good idea what thise clear policy could be.  I'd say there
should be a compelling reason why third party dependencies are included.

pyspatialite is there because of internal spatialite.  Maybe that can be
reconsidered too.  I doubt that anything uses internal spatialite anymore and
there also pysqlite that could be used with spatialite instead of pyspatialite.

owslib is not available everywhere - also AFAIK it's closely releated to
MetaSearch and has the same upstream.

Everything else could be removed from ext-libs AFAICS.



Jürgen

-- 
Jürgen E. Fischer   norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13  Fax. +49-4931-918175-50
Software Engineer   D-26506 Norden http://www.norbit.de
QGIS release manager (PSC)  GermanyIRC: jef on FreeNode 



signature.asc
Description: Digital signature
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] QGIS 2.6 compilation on Windows

2014-11-25 Thread Martin Landa
Hi,

2014-11-24 16:36 GMT+01:00 Jürgen E. j...@norbit.de:
 flex NEWS says Support for reentrant C scanners has been added for 2.5.6

 I use flex from cygwin on Windows.

thanks, it solved my problem! Martin

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Core Python plugins and their dependencies

2014-11-25 Thread Tom Kralidis




On Tue, 25 Nov 2014, Jürgen E. wrote:


Date: Tue, 25 Nov 2014 14:45:55 +0100
From: Jürgen E. j...@norbit.de
Reply-To: qgis-developer@lists.osgeo.org
To: qgis-developer@lists.osgeo.org
Subject: Re: [Qgis-developer] Core Python plugins and their dependencies

Hi Alex,

On Tue, 25. Nov 2014 at 15:06:30 +0200, Alexander Bruy wrote:

DB Manager depends on psycopg2 and pyspatialite, but we does not ship this
packages into QGIS source tree. Same for Processing, it contains several
algorithms that require matplotlib and we does not bundle matplotlib in QGIS
source tree. And it is fine, as user can easily install this packages using
package manager or pip.


We ship pyspatialite - that's not available everywhere and in case we're using
internal spatialite it should be built against that version.



I think it would be good to have clear policy on this.


Well, I don't have a good idea what thise clear policy could be.  I'd say there
should be a compelling reason why third party dependencies are included.

pyspatialite is there because of internal spatialite.  Maybe that can be
reconsidered too.  I doubt that anything uses internal spatialite anymore and
there also pysqlite that could be used with spatialite instead of pyspatialite.

owslib is not available everywhere - also AFAIK it's closely releated to
MetaSearch and has the same upstream.

Everything else could be removed from ext-libs AFAICS.




FYI the other deps in https://github.com/qgis/QGIS/tree/master/python/ext-libs 
are either
required by OWSLib or MetaSearch proper.

OWSLib: dateutil, pytz,
jinja2: markupsafe, pygments, six

I've deleted python/ext-libs/tests as this was a (since fixed) buggy artifact 
of the OWSLib build/install.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] pb with change attribute value in QGIS 2.6

2014-11-25 Thread Nejia
Hi,

 

I have a tool that allow to edit attribute of features (only one attribute):

1-  I select the feature by click on it: vectorLayer-getFeatures(
QgsFeatureRequest().setFilterRect( tSelectRect ).setFlags(
QgsFeatureRequest::ExactIntersect ))

2-  Modify the attribute

3-  Validate attribute change : vectorLayer-changeAttributeValue(
fId(), iField, newValue,oldValue );

 

The attribute change in attribute table but not on the label (layer is
labeled with the attribute) and in the identify result dialog.

 

I compile my plugin with libraries of Qgis 2.6 shipped with OSGeo4W, if I
use libraries of QGIS that I build from sources it work without any problem.

I compiled the same plugin with libraries of QGIS 2.4 shipped with OSGeo4W
and it worked fine.

 

Regards

Nejia

 

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Core Python plugins and their dependencies

2014-11-25 Thread Alexander Bruy
Hi Tom,

yes, I know that all this packages required by MetaSearch.
But as Jürgen said all this packages available from package
manager in most Linux distros and in OSGeo4W.

2014-11-25 16:14 GMT+02:00 Tom Kralidis tomkrali...@gmail.com:



 On Tue, 25 Nov 2014, Jürgen E. wrote:

 Date: Tue, 25 Nov 2014 14:45:55 +0100
 From: Jürgen E. j...@norbit.de
 Reply-To: qgis-developer@lists.osgeo.org
 To: qgis-developer@lists.osgeo.org
 Subject: Re: [Qgis-developer] Core Python plugins and their dependencies

 Hi Alex,

 On Tue, 25. Nov 2014 at 15:06:30 +0200, Alexander Bruy wrote:

 DB Manager depends on psycopg2 and pyspatialite, but we does not ship
 this
 packages into QGIS source tree. Same for Processing, it contains several
 algorithms that require matplotlib and we does not bundle matplotlib in
 QGIS
 source tree. And it is fine, as user can easily install this packages
 using
 package manager or pip.


 We ship pyspatialite - that's not available everywhere and in case we're
 using
 internal spatialite it should be built against that version.


 I think it would be good to have clear policy on this.


 Well, I don't have a good idea what thise clear policy could be.  I'd say
 there
 should be a compelling reason why third party dependencies are included.

 pyspatialite is there because of internal spatialite.  Maybe that can be
 reconsidered too.  I doubt that anything uses internal spatialite anymore
 and
 there also pysqlite that could be used with spatialite instead of
 pyspatialite.

 owslib is not available everywhere - also AFAIK it's closely releated to
 MetaSearch and has the same upstream.

 Everything else could be removed from ext-libs AFAICS.



 FYI the other deps in
 https://github.com/qgis/QGIS/tree/master/python/ext-libs are either
 required by OWSLib or MetaSearch proper.

 OWSLib: dateutil, pytz,
 jinja2: markupsafe, pygments, six

 I've deleted python/ext-libs/tests as this was a (since fixed) buggy
 artifact of the OWSLib build/install.
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
Alexander Bruy
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Core Python plugins and their dependencies

2014-11-25 Thread Alexander Bruy
Hi Jürgen,

thanks for you reply.

2014-11-25 15:45 GMT+02:00 Jürgen E. j...@norbit.de:
 Well, I don't have a good idea what thise clear policy could be.  I'd say 
 there
 should be a compelling reason why third party dependencies are included.

Ok, got your point. Sounds fine for me.

 pyspatialite is there because of internal spatialite.  Maybe that can be
 reconsidered too.  I doubt that anything uses internal spatialite anymore and
 there also pysqlite that could be used with spatialite instead of 
 pyspatialite.

if I'm not wrong, now recommended and officially supported way to use SpatiaLite
from Python is pysqlite. But DB Manager used pyspatialite, so maybe
first we need
update it.

-- 
Alexander Bruy
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows

2014-11-25 Thread eliu1234
Thanks for the link. 
I have checked out the C++ code example on Github before. But it is just
kinda frustrating to see that the examples are mostly from 5 years ago and
so much have changed. Also, for the add_raster_layer example in particular,
the github does not even have all the files needed for the code to run. And
when I just copy the code I need from there, it does not work either.


Nejia wrote
 To write QGIS C++ plugin see :
 http://download.osgeo.org/qgis/doc/manual/qgis-1.1.0_coding-compilation_guide_en.pdf
 (2.2 Programming a QGIS C++ Plugin in four steps)
 And you can find some C++ plugin examples here:
 https://github.com/qgis/QGIS-Code-Examples and
 https://github.com/qgis/QGIS-Code-Examples/tree/master/4_adding_rasters_to_canvas
 
 Regards,
 Nejia
 
 -Message d'origine-
 De : 

 qgis-developer-bounces@.osgeo

  [mailto:

 qgis-developer-bounces@.osgeo

 ] De la part de eliu1234
 Envoyé : lundi 24 novembre 2014 17:52
 À : 

 qgis-developer@.osgeo

 Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis
 application with QtCreator and MSVC2008 on Windows
 
 QgisInterface  is an abstract class. How are you initializing it? Or do
 you just declare it and add a raster layer directly? Because from that
 link, I see the addRasterLayer method is a pure virtual function and
 QgisInterface is abstract class. I want to add this layer into a
 QgsMapCanvas, how should I do that?
 
 Also, is it possible for you to test my code before to see if it works on
 your system? 
 QgsRasterLayer * rlayer = new
 QgsRasterLayer(http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=jsonpretty=true,raster;);
 qDebug()  rlayer-isValid();
 
 
 Nejia wrote
 QgisInterface  *m_ptInterface;
 See
 http://qgis.org/api/2.6/classQgisInterface.html#a808a34b507a8c4204d607
 a5857d62748
 
 Regards,
 Nejia
 
 -Message d'origine-
 De : 
 
 qgis-developer-bounces@.osgeo
 
  [mailto:
 
 qgis-developer-bounces@.osgeo
 
 ] De la part de eliu1234
 Envoyé : vendredi 21 novembre 2014 21:36 À :
 
 qgis-developer@.osgeo
 
 Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis 
 application with QtCreator and MSVC2008 on Windows
 
 What is the m_ptInterface in your code?
 
 
 Nejia wrote
 I use the same environment of Qgis to write c++ plugins:
 http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master
 /
 doc/INSTALL.html#toc14
 
 to add raster layer:
 m_ptInterface-addRasterLayer(http://server.arcgisonline.com/ArcGIS/
 r est/services/World_Imagery/MapServer?f=jsonpretty=true,raster);
 
 Regards,
 Nejia
 
 -Message d'origine-
 De : 
 
 qgis-developer-bounces@.osgeo
 
  [mailto:
 
 qgis-developer-bounces@.osgeo
 
 ] De la part de eliu1234
 Envoyé : jeudi 20 novembre 2014 21:40 À :
 
 qgis-developer@.osgeo
 
 Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis 
 application with QtCreator and MSVC2008 on Windows
 
 Do you have a system setup that can write qgis c++ application? If 
 you do, can you create a valid raster layer from that?
 
 
 Nejia wrote
 1- see my response here
 http://stackoverflow.com/questions/26920574/cannot-find-qgsapplicati
 o
 n
 -h-and
 -other-header-files/27035138#27035138
 
 -Message d'origine-
 De : 
 
 qgis-developer-bounces@.osgeo
 
 [mailto:
 
 qgis-developer-bounces@.osgeo
 
 ] De la part de eliu1234
 Envoyé : mercredi 19 novembre 2014 17:39 À :
 
 qgis-developer@.osgeo
 
 Objet : Re: [Qgis-developer] Problems with developing custom c++ 
 qgis application with QtCreator and MSVC2008 on Windows
 
 1. So in the .proj file, what do i need to change?
 
 2. My Python works in this case, it is the C++ part that is not
 working. 
 
 
 Nejia wrote
 Hi,
 
 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using 
 release mode so if you want to debug your application you can use 
 RelWithDebInfo mode.
 2- see:
 http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-lay
 e
 r
 -
 using-
 pyqgis
 http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-im
 a
 g
 e
 ry-dat
 aset-to-qgis/
 
 Cheers
 Nejia
 
 
 
 
 
 --
 View this message in context:
 http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-
 c
 -
 qgis-a
 pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.
 h t ml Sent from the Quantum GIS - Developer mailing list archive at 
 Nabble.com.
 ___
 Qgis-developer mailing list
 
 Qgis-developer@.osgeo
 
 http://lists.osgeo.org/mailman/listinfo/qgis-developer
 
 ___
 Qgis-developer mailing list
 
 Qgis-developer@.osgeo
 
 http://lists.osgeo.org/mailman/listinfo/qgis-developer
 
 
 
 
 
 --
 View this message in context:
 http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c
 -
 qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p517
 4 130.html Sent from the Quantum GIS - Developer mailing list archive 
 at Nabble.com.
 

[Qgis-developer] QgsMapRenderer and QgsMapSettings relation

2014-11-25 Thread Sandro Santilli
I've found code dealing with aspect-ratio adjustments in two places:
QgsMapSettings::updateDerived() and QgsMapRenderer::adjustExtentToSize()

As I'm trying to deal with viewport rotation, any such duplication makes
the work harder as things need to be changed in many different places.

Similar thing happens for QgsMapRenderer::setExtent, which is also
present in QgsMapSettings.

As QgsMapRenderer is actually initialized with a QgsMapSetting object,
should it always use services exposed by that class rather than re-doing
things locally ? Or what am I missing ?

Thanks in advance.

--strk;

 ()  ASCII ribbon campaign  --  Keep it simple !
 /\  http://strk.keybit.net/rants/ascii_mails.txt  
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] qgis --version and qgis_mapserv.fcgi --version ?

2014-11-25 Thread Richard Duivenvoorde
Hi devs,

Playng with QGIS-mapserver I had a qgis_mapserv.fcgi hanging around in
/usr/lib/cgi-bin of which I did not know which version it was

Trying (he, this is Linux) to do a
  qgis_mapserv.fcgi --version
it appears that's not working
So I tried
  qgis --version
which is not there either :-(

We off course have this info in the about-dialog, but I was wondering if
it is worth a feature request to implement those for both exe's (and
qbrowser?)?
Would be cool to see version (git commit?), and used libs (and versions).

We are a first class linux citizen isn't it ;-)

Regards,

Richard Duivenvoorde
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] qgis --version and qgis_mapserv.fcgi --version ?

2014-11-25 Thread kimaidou
Hi Richard,

You could also use ldd to get the linked libraries.

I agree with you it could be good to be able to get the git commit number
for one installed QGIS ( build or downloaded)

Michael

2014-11-25 21:49 GMT+01:00 Richard Duivenvoorde rdmaili...@duif.net:

 Hi devs,

 Playng with QGIS-mapserver I had a qgis_mapserv.fcgi hanging around in
 /usr/lib/cgi-bin of which I did not know which version it was

 Trying (he, this is Linux) to do a
   qgis_mapserv.fcgi --version
 it appears that's not working
 So I tried
   qgis --version
 which is not there either :-(

 We off course have this info in the about-dialog, but I was wondering if
 it is worth a feature request to implement those for both exe's (and
 qbrowser?)?
 Would be cool to see version (git commit?), and used libs (and versions).

 We are a first class linux citizen isn't it ;-)

 Regards,

 Richard Duivenvoorde
 ___
 Qgis-developer mailing list
 Qgis-developer@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Problems with developing custom c++ qgis application with QtCreator and MSVC2008 on Windows

2014-11-25 Thread eliu1234
Thanks for the link. 
I have checked out the C++ code example on Github before. But it is just
kinda frustrating to see that the examples are mostly from 5 years ago and
so much have changed. Also, for the add_raster_layer example in particular,
I setup the whole project on my computer and try to add a layer, it reports
an invalid layer. So right now, I have no idea what to change in order for
the code to work.


Nejia wrote
 To write QGIS C++ plugin see :
 http://download.osgeo.org/qgis/doc/manual/qgis-1.1.0_coding-compilation_guide_en.pdf
 (2.2 Programming a QGIS C++ Plugin in four steps)
 And you can find some C++ plugin examples here:
 https://github.com/qgis/QGIS-Code-Examples and
 https://github.com/qgis/QGIS-Code-Examples/tree/master/4_adding_rasters_to_canvas
 
 Regards,
 Nejia
 
 -Message d'origine-
 De : 

 qgis-developer-bounces@.osgeo

  [mailto:

 qgis-developer-bounces@.osgeo

 ] De la part de eliu1234
 Envoyé : lundi 24 novembre 2014 17:52
 À : 

 qgis-developer@.osgeo

 Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis
 application with QtCreator and MSVC2008 on Windows
 
 QgisInterface  is an abstract class. How are you initializing it? Or do
 you just declare it and add a raster layer directly? Because from that
 link, I see the addRasterLayer method is a pure virtual function and
 QgisInterface is abstract class. I want to add this layer into a
 QgsMapCanvas, how should I do that?
 
 Also, is it possible for you to test my code before to see if it works on
 your system? 
 QgsRasterLayer * rlayer = new
 QgsRasterLayer(http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=jsonpretty=true,raster;);
 qDebug()  rlayer-isValid();
 
 
 Nejia wrote
 QgisInterface  *m_ptInterface;
 See
 http://qgis.org/api/2.6/classQgisInterface.html#a808a34b507a8c4204d607
 a5857d62748
 
 Regards,
 Nejia
 
 -Message d'origine-
 De : 
 
 qgis-developer-bounces@.osgeo
 
  [mailto:
 
 qgis-developer-bounces@.osgeo
 
 ] De la part de eliu1234
 Envoyé : vendredi 21 novembre 2014 21:36 À :
 
 qgis-developer@.osgeo
 
 Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis 
 application with QtCreator and MSVC2008 on Windows
 
 What is the m_ptInterface in your code?
 
 
 Nejia wrote
 I use the same environment of Qgis to write c++ plugins:
 http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master
 /
 doc/INSTALL.html#toc14
 
 to add raster layer:
 m_ptInterface-addRasterLayer(http://server.arcgisonline.com/ArcGIS/
 r est/services/World_Imagery/MapServer?f=jsonpretty=true,raster);
 
 Regards,
 Nejia
 
 -Message d'origine-
 De : 
 
 qgis-developer-bounces@.osgeo
 
  [mailto:
 
 qgis-developer-bounces@.osgeo
 
 ] De la part de eliu1234
 Envoyé : jeudi 20 novembre 2014 21:40 À :
 
 qgis-developer@.osgeo
 
 Objet : Re: [Qgis-developer] Problems with developing custom c++ qgis 
 application with QtCreator and MSVC2008 on Windows
 
 Do you have a system setup that can write qgis c++ application? If 
 you do, can you create a valid raster layer from that?
 
 
 Nejia wrote
 1- see my response here
 http://stackoverflow.com/questions/26920574/cannot-find-qgsapplicati
 o
 n
 -h-and
 -other-header-files/27035138#27035138
 
 -Message d'origine-
 De : 
 
 qgis-developer-bounces@.osgeo
 
 [mailto:
 
 qgis-developer-bounces@.osgeo
 
 ] De la part de eliu1234
 Envoyé : mercredi 19 novembre 2014 17:39 À :
 
 qgis-developer@.osgeo
 
 Objet : Re: [Qgis-developer] Problems with developing custom c++ 
 qgis application with QtCreator and MSVC2008 on Windows
 
 1. So in the .proj file, what do i need to change?
 
 2. My Python works in this case, it is the C++ part that is not
 working. 
 
 
 Nejia wrote
 Hi,
 
 1- QGIS and Qt libraries shipped with Osgeo4W are compiled using 
 release mode so if you want to debug your application you can use 
 RelWithDebInfo mode.
 2- see:
 http://gis.stackexchange.com/questions/120823/how-to-load-a-wms-lay
 e
 r
 -
 using-
 pyqgis
 http://ieqgis.wordpress.com/2014/08/09/adding-esris-online-world-im
 a
 g
 e
 ry-dat
 aset-to-qgis/
 
 Cheers
 Nejia
 
 
 
 
 
 --
 View this message in context:
 http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-
 c
 -
 qgis-a
 pplication-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p5173838.
 h t ml Sent from the Quantum GIS - Developer mailing list archive at 
 Nabble.com.
 ___
 Qgis-developer mailing list
 
 Qgis-developer@.osgeo
 
 http://lists.osgeo.org/mailman/listinfo/qgis-developer
 
 ___
 Qgis-developer mailing list
 
 Qgis-developer@.osgeo
 
 http://lists.osgeo.org/mailman/listinfo/qgis-developer
 
 
 
 
 
 --
 View this message in context:
 http://osgeo-org.1560.x6.nabble.com/Problems-with-developing-custom-c
 -
 qgis-application-with-QtCreator-and-MSVC2008-on-Windows-tp5173711p517
 4 130.html Sent from the Quantum GIS - Developer mailing list archive 
 at 

Re: [Qgis-developer] [plugins] refreshing canvas

2014-11-25 Thread Alexia Mondot
I've tried to add the canvas.repaint() with my canvas.refresh(), and it 
seems to work !


Thanks !
Alexia

On 25/11/2014 00:37, Nathan Woodrow wrote:

Hey,

I suspect you are running into this 
http://gis.stackexchange.com/questions/87841/why-qgsmapcanvas-only-appear-after-lost-focus 



Here is a fix http://gis.stackexchange.com/a/92734/97

- Nathan

On Tue Nov 25 2014 at 9:34:14 AM Alexia Mondot alexia.mon...@free.fr 
mailto:alexia.mon...@free.fr wrote:


Thanks for your answer.

Actually, I wonder if my refresh problem is not only on QGIS 2.2.
I believe I had not reproduce this behaviour on QGIS 2.4 and 2.6.
And I didn't know about the bug.
I have these two points to analyse.

The multithread rendering was available in QGIS 2.2 ??

I'm going to work on the two previous points.

Thanks again,
Alexia



On 24/11/2014 23:52, Luigi Pirelli wrote:

could be related with this?

https://hub.qgis.org/issues/9799

check OTF reprojection combination

regards, Luigi Pirelli

On 24 November 2014 at 23:49, Luigi Pirellilui...@gmail.com  
mailto:lui...@gmail.com  wrote:

may you also test with the last 2.6version?

regards, Luigi Pirelli

On 24 November 2014 at 01:16, Alexia Mondotale...@mondot.fr  
mailto:ale...@mondot.fr  wrote:

Hi all,

I have a plugin using a customized version of Dockable Mirror Map.
I use it to display each processing result in a new view.

I get a strange behaviour with my plugin :
Some times, the canvas stays white. A scroll in it is fine to reload it and
my image is displayed.
I get this problem since the beginning of the development on QIGS 2.2. It is
for me a random problem, because I can't say why I get these white canvas.
But, when I get it I save the projet with the white view, and when reloaded,
the canvas is still white.

I've played with canvas.refresh(), canvas renderer flags and even with
canvas.freeze().
I can't understand the behaviour I get, maybe I have a wrong usage of the
properties above.
I also thought about triggerRepaint()...

Thanks by advance,
Alexia


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org  mailto:Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org  mailto:Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org mailto:Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer



___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Contrast Enhancement

2014-11-25 Thread Alexia Mondot

Hi all,

I have some problems to apply new stretching values to my layer

I have a function which allows to adapt the stretching of my image 
without the raster layer properties dialog.


When I open an image with my plugin, I display it on the canvas, I open 
my own histograms, and I can move the min max stretch of the 3 displayed 
bands.


It works well. But, when i save the project, i reopen it, I want to 
change the image stretching, it does nothing. The values are set, but it 
seems that the layer renderer is not updated.


Here is my stretching code :


print canvas
print layer :, theRasterLayer

# type of layer : raster, vector, other
typeOfLayer = theRasterLayer.type()

dataProvider = theRasterLayer.dataProvider()

# the layer has to be a raster layer
if typeOfLayer == 1 :
if (theRasterLayer.rasterType() == 0 ) and 
theRasterLayer.renderer():

[...]

elif theRasterLayer.rasterType() == 2  and 
theRasterLayer.renderer():

min_red, max_red = values[0]
min_green, max_green = values[1]
min_blue, max_blue = values[2]

redEnhancement = QgsContrastEnhancement( 
dataProvider.dataType( 0 ) )
greenEnhancement = QgsContrastEnhancement( 
dataProvider.dataType( 1 ) )
blueEnhancement = QgsContrastEnhancement( 
dataProvider.dataType( 2 ) )

#set stretch to min max
redEnhancement.setMinimumValue( min_red )
redEnhancement.setMaximumValue( max_red )
greenEnhancement.setMinimumValue( min_green )
greenEnhancement.setMaximumValue( max_green )
blueEnhancement.setMinimumValue( min_blue )
blueEnhancement.setMaximumValue( max_blue )
redEnhancement.setContrastEnhancementAlgorithm(1)
greenEnhancement.setContrastEnhancementAlgorithm(1)
blueEnhancement.setContrastEnhancementAlgorithm(1)

print blue enhancement, blueEnhancement
print blue max, blueEnhancement.maximumValue()
print blue min, blueEnhancement.minimumValue()

theRasterLayer.renderer().setRedContrastEnhancement( 
redEnhancement)
theRasterLayer.renderer().setGreenContrastEnhancement( 
greenEnhancement )
theRasterLayer.renderer().setBlueContrastEnhancement( 
blueEnhancement)


theRasterLayer.triggerRepaint()

print theRasterLayer.renderer().blueContrastEnhancement()
print 
theRasterLayer.renderer().blueContrastEnhancement().minimumValue()
print 
theRasterLayer.renderer().blueContrastEnhancement().maximumValue()

canvas.refresh()
canvas.repaint()


In my case, the canvas, is the main canvas, I have checked I work on the 
good one comparing  the print canvas and the python console with 
iface.mapCanvas().


I know :
* both cases run this function.
* the minimum and maximum values of contrast enhancement are the same in 
my two prints (before and after the setXContrastEnhancement) (so the 
theRasterLayer.renderer().blueContrastEnhancement() seems to be well set)

* these values are the good ones
* they aren't displayed in the raster layer properties dialog
* my raster layer source is ok
* when i do these steps on the QGIS python console with the layer 
iface.mapCanvas().currentLayer() which points to the same file, it works



layer = iface.mapCanvas().currentLayer()
blue_en = QgsContrastEnhancement( layer.dataProvider().dataType(2))
blue_en.setMinimumValue(150)
blue_en.setMaximumValue(350)
blue_en.setContrastEnhancementAlgorithm(1)
layer.renderer().setBlueContrastEnhancement(blue_en)
layer.triggerRepaint()


What have I missed ?

Thanks by advance,
Alexia
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer