Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QgsFillSymbolLayerV2 descendants missing from sip #237

Closed
wants to merge 1 commit into from

Conversation

endmax
Copy link
Contributor

@endmax endmax commented Sep 19, 2012

I've added the missing classes derived from QgsFillSymbolLayerV2, QgsLineSymbolLayerV2 and QgsMarkerSymbolLayerV2 to QGis Python API.
The definitions have been splitted over three different .sip files
Now the APIs cover the entire QgsSymbolLayer hierarchy.
See also http://osgeo-org.1560.n6.nabble.com/QgsFillSymbolLayerV2-descendants-missing-from-sip-tt5002739.html

…ymbolLayerV2 and QgsMarkerSymbolLayerV2 to QGis Python API

splitting the definitions over three different .sip files
Now the APIs cover the entire QgsSymbolLayer hierarchy
@timlinux
Copy link
Member

+1 on testing - thanks for these updates Massimo

@etiennesky
Copy link
Contributor

I knew you'd say that! ;) Without testing, hard to test new sip bindings!

@endmax
Copy link
Contributor Author

endmax commented Sep 20, 2012

So, how do you suggest to test beside class instantiation ?
I mean, what is the goal of this test?

  1. test if a class (functions and attributes) exist / is exposed as expected ?
  2. test if a class behave as expected?
  3. a mix of 1 and 2?

@timlinux
Copy link
Member

There are a number of ways you can test.

  • use a render check e.g. tests/src/core/testqgsrenderers.cpp (you can implement the same test methodology in python, as the QgsRenderChecker has python bindings too see tests/src/python/test_qgsrasterlayer.py for an example.
  • simple instantiation using the provided api is a valid and useful way to verify that the api remains intact after changes
  • in the case of symbology you could also instantiate a symbol and then write it to qml and then veify that the qml matches a known one (though this may be vulnerable to small changes in the serialisation format.

Regards

Tim

@endmax
Copy link
Contributor Author

endmax commented Sep 20, 2012

I'm preparing test for classes instantiation and I've discovered a missing conversion (in my code) from top level class to derived classes. I've solved the problem completing the ConvertToSubClassCode section in the main class.
Is the dynamyc_cast the most convenient way to test for inheritance ?
How can I upload a new version for this pull request?

@timlinux
Copy link
Member

Hi

I believe if you commit to the same branch the updates will be automatic, otherwise close the pull request and create a new one after.

Thanks

Tim

@endmax
Copy link
Contributor Author

endmax commented Sep 27, 2012

I'm going to close this pull request and create a new one that will contain a test and some small changes.

@endmax endmax closed this Sep 27, 2012
@timlinux
Copy link
Member

Great thanks Massimo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants