Changeset View
Changeset View
Standalone View
Standalone View
user_manual/python_scripting/krita_python_plugin_howto.rst
Show First 20 Lines • Show All 344 Lines • ▼ Show 20 Line(s) | |||||
345 | 345 | | |||
346 | 346 | | |||
347 | and use the right import: | 347 | and use the right import: | ||
348 | 348 | | |||
349 | ``from PyQt5.QtCore import pyqtSignal`` | 349 | ``from PyQt5.QtCore import pyqtSignal`` | ||
350 | 350 | | |||
351 | To emit or create slots for objects that aren't standard python objects, you only have to put their names between quotation marks. | 351 | To emit or create slots for objects that aren't standard python objects, you only have to put their names between quotation marks. | ||
352 | 352 | | |||
353 | A note on unit tests | ||||
354 | -------------------- | ||||
355 | | ||||
356 | If you want to write unit tests for your plugin, have a look at the `mock krita module <https://github.com/rbreu/krita-python-mock>`_. | ||||
357 | | ||||
358 | | ||||
353 | Conclusion | 359 | Conclusion | ||
354 | ---------- | 360 | ---------- | ||
355 | 361 | | |||
356 | Okay, so that covers all the Krita specific details for creating python plugins. It doesn't handle how to parse the pixel data, or best practices with documents, but if you have a little bit of experience with python you should be able to start creating your own plugins. | 362 | Okay, so that covers all the Krita specific details for creating python plugins. It doesn't handle how to parse the pixel data, or best practices with documents, but if you have a little bit of experience with python you should be able to start creating your own plugins. | ||
357 | 363 | | |||
358 | As always, read the code carefully and read the API docs for python, Krita and Qt carefully to see what is possible, and you'll get pretty far. | 364 | As always, read the code carefully and read the API docs for python, Krita and Qt carefully to see what is possible, and you'll get pretty far. |