Re: [Qgis-developer] rendering tests, what's the latest approach ?

2015-11-14 Thread Nyall Dawson
On 13 November 2015 at 02:42, Matthias Kuhn  wrote:
> Simple answer: don't use rendering tests and find other means to check
> it ;-)

Hmm... for something like this (testing rendering of a line style), I
think a rendering test is perfectly acceptable! It's only when
rendering tests are used for things like checking geometry operations
that it's an issue IMO.

Nyall


>
> If you still need, use the MultiRenderChecker, it is based on the
> RenderChecker but adds more possibilities for anomalies. At least that's
> the latest state of rendering tests I'm aware of...
>
> Best
>
> On 11/12/2015 04:37 PM, Sandro Santilli wrote:
>> I've found a bug in rendering line-offsetted marker line symbols [1]
>> and wondering what's the currently recommended way to add a testcase.
>>
>> [1] http://hub.qgis.org/issues/13811 or
>> https://github.com/qgis/QGIS/pull/2442
>>
>> Looking around I see many test files using the QgsRenderChecker
>> class in tests/src/core but the rationale is not clear to me.
>>
>> Here's the list:
>>
>>regression992.cpp
>>testqgsblendmodes.cpp
>>testqgscomposerobject.cpp
>>testqgscomposerutils.cpp
>>testqgsdiagram.cpp
>>testqgsgeometry.cpp
>>testqgsgradients.cpp
>>testqgsimageoperation.cpp
>>testqgsinvertedpolygonrenderer.cpp
>>testqgslabelingenginev2.cpp
>>testqgslegendrenderer.cpp
>>testqgslinefillsymbol.cpp
>>testqgsmaprenderer.cpp
>>testqgsmaprotation.cpp
>>testqgspainteffect.cpp
>>testqgspointpatternfillsymbol.cpp
>>testqgsrasterfill.cpp
>>testqgsrasterlayer.cpp
>>  * testqgsrenderers.cpp
>>testqgsshapeburst.cpp
>>
>> Then other files use the QgsMultiRenderChecker class instead:
>>
>>qgscompositionchecker.cpp
>>testqgsblendmodes.cpp
>>testqgsdiagram.cpp
>>testqgsinvertedpolygonrenderer.cpp
>>testqgspainteffect.cpp
>>testqgsrasterfill.cpp
>>testqgsrenderers.cpp
>>testqgsshapeburst.cpp
>>  * testqgsstylev2.cpp
>>  * testqgssymbolv2.cpp
>>
>> What's the difference between the two classes ?  Which one should I use ?
>> Should I put the new case in any existing file ?
>> (I've tagged the possible candidates with a star)
>>
>> --strk;
>>
>>   ()   Free GIS & Flash consultant/developer
>>   /\   http://strk.keybit.net/services.html
>> ___
>> Qgis-developer mailing list
>> Qgis-developer@lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> --
> Matthias Kuhn
> OPENGIS.ch - https://www.opengis.ch
> Spatial • (Q)GIS • PostGIS • Open Source
>
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] rendering tests, what's the latest approach ?

2015-11-14 Thread Nyall Dawson
On 13 November 2015 at 02:48, Sandro Santilli  wrote:
> On Thu, Nov 12, 2015 at 04:42:07PM +0100, Matthias Kuhn wrote:
>> Simple answer: don't use rendering tests and find other means to check
>> it ;-)
>
> How could I check that an arror is not flipped and does not move
> to the other side of the line ?
>
> To be honest, I like the idea of rendering tests. I know they are
> fragile in their current incarnation, but being a graphical
> application having tests actually check what the user would see
> is a good way to catch many issues.

I personally think we've reached a good level of stability with the
rendering tests. They now perform consistently across all platforms
(passing when they should and failing when they shouldn't). So I'm
keen to hear any thoughts on why you think these are still fragile?

Nyall



>
>> If you still need, use the MultiRenderChecker, it is based on the
>> RenderChecker but adds more possibilities for anomalies. At least that's
>> the latest state of rendering tests I'm aware of...
>
> Ok, great. How about the distinction between these two files ?
>
>   * testqgsstylev2.cpp
>   * testqgssymbolv2.cpp
>
> Actually, the second one is _not_ in the 2.8 branch (which I'm
> targetting). Should it be back-ported ?
>
> --strk;
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] TypeError: C++ type 'QgsFeatureIds' is not supported as a signal argument type

2015-11-14 Thread Matthias Kuhn
Hi,

Sometimes there is quiet a lot of traffic on this list and some
questions get forgotten. Or simply nobody knows the answer. Don't take
it personal :-)

I don't know if that's the reason, but you should use new-style signals.

iface.activeLayer().committedFeaturesRemoved.connect(listener)

Maybe it helps.

Best,
Matthias


On 11/13/2015 09:18 AM, //./\\-/_.\\ wrote:
> Hi developers,
>
> With OSX, QGIS 2.8.3 and higher, I found an error  what appears to be
> a regression (perhaps).
> And with QGIS 2.12, the problem persists.
>
> So, if you want to try to reproduce the error, open python console and
> try (with any active layer on editing mode):
>
> >>> layer = iface.activeLayer()
> >>> def listener(s, l):
> >>> print s, l
>
> Then,
>
> >>> layer.committedFeaturesRemoved.connect(listener)
>
> Or
>
> >>> from PyQt4.QtCore import QObject
> >>> from PyQt4.QtCore import SIGNAL
> >>> QObject.connect(layer, SIGNAL(r"committedFeaturesRemoved(QString,
> QgsFeatureIds )"), listener)
>
> It returns this error: “TypeError: C++ type 'QgsFeatureIds' is not
> supported as a signal argument type”
>
> My English is so bad that nobody wants to answer me?
>
> m431m
>
>
>
> 1. Oct 2015 16:22 de m4...@tutanota.com :
>
> Hi,
> No Mac user able to reproduce the error? Am i the only one?
> m431m
>
> 25. Sep 2015 13:50 de m4...@tutanota.com :
>
> Hi QGIS developers!
>
> I got strange error with the 'commitedFeaturesRemoved' signal.
> See: 
> http://www.qgis.org/api/classQgsVectorLayer.html#a520550b45603ed20d593b1050768bd97
>
> I try on python console (with any active layer on editing mode):
> >>> layer = iface.activeLayer()
> >>> def listener(s, l):
> >>> print s, l
> >>> layer.committedFeaturesRemoved.connect(listener)
>
> It returns `TypeError: C++ type 'QgsFeatureIds' is not
> supported as a signal argument type`
>
> Now replace `layer.commitedFeaturesRemoved.connect(listener)`by:
> >>> from PyQt4.QtCore import QObject
> >>> from PyQt4.QtCore import SIGNAL
> >>> QObject.disconnect(layer,
> SIGNAL(r"committedFeaturesRemoved()"), listener)
>
> No error, but it returns `False`.
>
> If I delete some features and switch off editing mode, it
> returns nothing! No print! The signal doesn't work(?)
>
> After exchanging a few message with some people on irc #qgis,
> the error only appears with latest QGIS version on OSX10.10.5.
> (it works well with 2.8.2). 
>
> Maybe someone that has approached the same problem... and
> solved it?
>
> m431m
>
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Matthias Kuhn
OPENGIS.ch - https://www.opengis.ch
Spatial • (Q)GIS • PostGIS • Open Source

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

Re: [Qgis-developer] TypeError: C++ type 'QgsFeatureIds' is not supported as a signal argument type

2015-11-14 Thread Nyall Dawson
On 14 November 2015 at 20:52, Matthias Kuhn  wrote:
> Hi,
>
> Sometimes there is quiet a lot of traffic on this list and some questions
> get forgotten. Or simply nobody knows the answer. Don't take it personal :-)
>
> I don't know if that's the reason, but you should use new-style signals.

It may have already been resolved by Jürgen in:

https://github.com/qgis/QGIS/commit/b5794b2f2ddc2eae746ad67eac8e899c44963d7c

Any chance you could test with the latest master version and confirm?

Nyall




>
> iface.activeLayer().committedFeaturesRemoved.connect(listener)
>
> Maybe it helps.
>
> Best,
> Matthias
>
>
>
> On 11/13/2015 09:18 AM, //./\\-/_.\\ wrote:
>
> Hi developers,
>
> With OSX, QGIS 2.8.3 and higher, I found an error  what appears to be a
> regression (perhaps).
> And with QGIS 2.12, the problem persists.
>
> So, if you want to try to reproduce the error, open python console and try
> (with any active layer on editing mode):
>
 layer = iface.activeLayer()
 def listener(s, l):
 print s, l
>
> Then,
>
 layer.committedFeaturesRemoved.connect(listener)
>
> Or
>
 from PyQt4.QtCore import QObject
 from PyQt4.QtCore import SIGNAL
 QObject.connect(layer, SIGNAL(r"committedFeaturesRemoved(QString,
 QgsFeatureIds )"), listener)
>
> It returns this error: “TypeError: C++ type 'QgsFeatureIds' is not supported
> as a signal argument type”
>
> My English is so bad that nobody wants to answer me?
>
> m431m
>
>
>
> 1. Oct 2015 16:22 de m4...@tutanota.com:
>
> Hi,
> No Mac user able to reproduce the error? Am i the only one?
> m431m
>
> 25. Sep 2015 13:50 de m4...@tutanota.com:
>
> Hi QGIS developers!
>
> I got strange error with the 'commitedFeaturesRemoved' signal.
> See:
> http://www.qgis.org/api/classQgsVectorLayer.html#a520550b45603ed20d593b1050768bd97
>
> I try on python console (with any active layer on editing mode):
 layer = iface.activeLayer()
 def listener(s, l):
 print s, l
 layer.committedFeaturesRemoved.connect(listener)
>
> It returns `TypeError: C++ type 'QgsFeatureIds' is not supported as a signal
> argument type`
>
> Now replace `layer.commitedFeaturesRemoved.connect(listener)`by:
 from PyQt4.QtCore import QObject
 from PyQt4.QtCore import SIGNAL
 QObject.disconnect(layer, SIGNAL(r"committedFeaturesRemoved()"),
 listener)
>
> No error, but it returns `False`.
>
> If I delete some features and switch off editing mode, it returns nothing!
> No print! The signal doesn't work(?)
>
> After exchanging a few message with some people on irc #qgis, the error only
> appears with latest QGIS version on OSX10.10.5. (it works well with 2.8.2).
>
> Maybe someone that has approached the same problem... and solved it?
>
> m431m
>
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> --
> Matthias Kuhn
> OPENGIS.ch - https://www.opengis.ch
> Spatial • (Q)GIS • PostGIS • Open Source
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] rendering tests, what's the latest approach ?

2015-11-14 Thread Sandro Santilli
On Sat, Nov 14, 2015 at 08:14:39PM +1100, Nyall Dawson wrote:
> On 13 November 2015 at 02:48, Sandro Santilli  wrote:

> > To be honest, I like the idea of rendering tests. I know they are
> > fragile in their current incarnation, but being a graphical
> > application having tests actually check what the user would see
> > is a good way to catch many issues.
> 
> I personally think we've reached a good level of stability with the
> rendering tests. They now perform consistently across all platforms
> (passing when they should and failing when they shouldn't). So I'm
> keen to hear any thoughts on why you think these are still fragile?

CDash shows many failures here (check 2.8.3-* builds):
http://dash.orfeo-toolbox.org/index.php?project=QGIS

All of them are rendering-based tests.

I'm sure the recent introduction of masks helps with that, but
it is evidently not easy enough to use.

--strk;
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Processing - Set style for raster layer bug?

2015-11-14 Thread Frank Sokolic

Hi all,

If I use the "Set style for raster layer" tool in [Processing Toolbox > 
Advanced interface > QGIS algorithms > Raster general tools] the style 
is loaded but isn't applied. To apply the style I have to go to Layer 
Properties > Style and then click the Apply button. Is this a feature or 
a bug?


Ubuntu 15.10 64 bit, QGIS Master.

Regards, Frank.

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