| 
    Krita Source Code Documentation
    
   | 
 
#include <Krita.h>
 Inheritance diagram for Krita:Public Slots | |
| QAction * | action (const QString &name) const | 
| QList< QAction * > | actions () const | 
| Document * | activeDocument () const | 
| Window * | activeWindow () const | 
| void | addDockWidgetFactory (DockWidgetFactoryBase *factory) | 
| addDockWidgetFactory Add the given docker factory to the application. For scripts loaded on startup, this means that every window will have one of the dockers created by the factory.   | |
| void | addExtension (Extension *extension) | 
| addExtension add the given plugin to Krita. There will be a single instance of each Extension in the Krita process.   | |
| bool | addProfile (const QString &profilePath) | 
| addProfile load the given profile into the profile registry.   | |
| bool | batchmode () const | 
| batchmode determines whether the script is run in batch mode. If batchmode is true, scripts should now show messageboxes or dialog boxes.   | |
| QStringList | colorDepths (const QString &colorModel) const | 
| colorDepths creates a list with the names of all color depths compatible with the given color model.   | |
| QStringList | colorModels () const | 
| colorModels creates a list with all color models id's registered.   | |
| Document * | createDocument (int width, int height, const QString &name, const QString &colorModel, const QString &colorDepth, const QString &profile, double resolution) | 
| QList< QDockWidget * > | dockers () const | 
| QList< Document * > | documents () const | 
| QList< Extension * > | extensions () | 
| Filter * | filter (const QString &name) const | 
| filter construct a Filter object with a default configuration.   | |
| QStringList | filters () const | 
| Filters are identified by an internal name. This function returns a list of all existing registered filters.   | |
| QStringList | filterStrategies () const | 
| filterStrategies Retrieves all installed filter strategies. A filter strategy is used when transforming (scaling, shearing, rotating) an image to calculate the value of the new pixels. You can use th   | |
| static QObject * | fromVariant (const QVariant &v) | 
| static QString | getAppDataLocation () | 
| QIcon | icon (QString &iconName) const | 
| icon This allows you to get icons from Krita's internal icons.   | |
| static Krita * | instance () | 
| instance retrieve the singleton instance of the Application object.   | |
| static QString | krita_i18n (const QString &text) | 
| static QString | krita_i18nc (const QString &context, const QString &text) | 
| Notifier * | notifier () const | 
| notifier the Notifier singleton emits signals when documents are opened and closed, the configuration changes, views are opened and closed or windows are opened.   | |
| Document * | openDocument (const QString &filename) | 
| openDocument creates a new Document, registers it with the Krita application and loads the given file.   | |
| Window * | openWindow () | 
| openWindow create a new main window. The window is not shown by default.   | |
| QStringList | profiles (const QString &colorModel, const QString &colorDepth) const | 
| profiles creates a list with the names of all color profiles compatible with the given color model and color depth.   | |
| QString | readSetting (const QString &group, const QString &name, const QString &defaultValue) | 
| readSetting read the given setting value from the kritarc file.   | |
| QStringList | recentDocuments () const | 
| return all recent documents registered in the RecentFiles group of the kritarc   | |
| QMap< QString, Resource * > | resources (QString &type) const | 
| resources returns a list of Resource objects of the given type   | |
| void | setActiveDocument (Document *value) | 
| setActiveDocument activates the first view that shows the given document   | |
| void | setBatchmode (bool value) | 
| setBatchmode sets the batchmode to   | |
| QString | version () const | 
| version Determine the version of Krita   | |
| QList< View * > | views () const | 
| QList< Window * > | windows () const | 
| void | writeSetting (const QString &group, const QString &name, const QString &value) | 
| writeSetting write the given setting under the given name to the kritarc file in the given settings group.   | |
Public Member Functions | |
| Krita (QObject *parent=0) | |
| ~Krita () override | |
Private Slots | |
| void | mainWindowIsBeingCreated (KisMainWindow *window) | 
| This is called from the constructor of the window, before the xmlgui file is loaded.   | |
Private Attributes | |
| Private *const | d | 
Static Private Attributes | |
| static Krita * | s_instance = 0 | 
Krita is a singleton class that offers the root access to the Krita object hierarchy.
The Krita.instance() is aliased as two builtins: Scripter and Application.
      
  | 
  explicit | 
Definition at line 68 of file Krita.cpp.
References connect(), KisPart::instance(), and mainWindowIsBeingCreated().
      
  | 
  override | 
Definition at line 76 of file Krita.cpp.
References d, krita::Krita::Private::extensions, and krita::Krita::Private::notifier.
      
  | 
  slot | 
Definition at line 93 of file Krita.cpp.
References action(), KisKActionCollection::action(), KisKXMLGUIClient::actionCollection(), KisPart::currentMainwindow(), and KisPart::instance().
      
  | 
  slot | 
Definition at line 83 of file Krita.cpp.
References KisKXMLGUIClient::actionCollection(), KisKActionCollection::actions(), KisPart::currentMainwindow(), and KisPart::instance().
      
  | 
  slot | 
Definition at line 104 of file Krita.cpp.
References KisMainWindow::activeView, KisPart::currentMainwindow(), d, KisView::document, and KisPart::instance().
      
  | 
  slot | 
Definition at line 233 of file Krita.cpp.
References KisPart::currentMainwindow(), and KisPart::instance().
      
  | 
  slot | 
addDockWidgetFactory Add the given docker factory to the application. For scripts loaded on startup, this means that every window will have one of the dockers created by the factory.
| factory | The factory object. | 
Definition at line 385 of file Krita.cpp.
References KoGenericRegistry< T >::add(), and KoDockRegistry::instance().
      
  | 
  slot | 
addProfile load the given profile into the profile registry.
| profilePath | the path to the profile. | 
Definition at line 207 of file Krita.cpp.
References KoColorSpaceEngine::addProfile(), KoGenericRegistry< T >::get(), KoColorSpaceEngineRegistry::instance(), and KIS_ASSERT.
      
  | 
  slot | 
batchmode determines whether the script is run in batch mode. If batchmode is true, scripts should now show messageboxes or dialog boxes.
Note that this separate from Document.setBatchmode(), which determines whether export/save option dialogs are shown.
Definition at line 129 of file Krita.cpp.
References krita::Krita::Private::batchMode, and d.
      
  | 
  slot | 
colorDepths creates a list with the names of all color depths compatible with the given color model.
| colorModel | the id of a color model. | 
Definition at line 179 of file Krita.cpp.
References KoColorSpaceRegistry::AllColorSpaces, KoColorSpaceRegistry::colorDepthList(), and KoColorSpaceRegistry::instance().
      
  | 
  slot | 
colorModels creates a list with all color models id's registered.
Definition at line 169 of file Krita.cpp.
References KoColorSpaceRegistry::AllColorSpaces, KoColorSpaceRegistry::colorModelsList(), and KoColorSpaceRegistry::instance().
      
  | 
  slot | 
@brief createDocument creates a new document and image and registers the document with the Krita application. Unless you explicitly call Document::close() the document will remain known to the Krita document registry. The document and its image will only be deleted when Krita exits. The document will have one transparent layer. To create a new document and show it, do something like:
@param width the width in pixels @param height the height in pixels @param name the name of the image (not the filename of the document) @param colorModel A string describing the color model of the image: <ul> <li>A: Alpha mask</li> <li>RGBA: RGB with alpha channel (The actual order of channels is most often BGR!)</li> <li>XYZA: XYZ with alpha channel</li> <li>LABA: LAB with alpha channel</li> <li>CMYKA: CMYK with alpha channel</li> <li>GRAYA: Gray with alpha channel</li> <li>YCbCrA: YCbCr with alpha channel</li> </ul> @param colorDepth A string describing the color depth of the image: <ul> <li>U8: unsigned 8 bits integer, the most common type</li> <li>U16: unsigned 16 bits integer</li> <li>F16: half, 16 bits floating point. Only available if Krita was built with OpenEXR</li> <li>F32: 32 bits floating point</li> </ul> @param profile The name of an icc profile that is known to Krita. If an empty string is passed, the default is taken. @param resolution the resolution in points per inch. @return the created document.
Definition at line 317 of file Krita.cpp.
References KisPart::addDocument(), KoColorSpaceRegistry::colorSpace(), KisPart::createDocument(), KoColorSpaceRegistry::instance(), KisPart::instance(), and KisConfig::RASTER_LAYER.
      
  | 
  slot | 
Definition at line 296 of file Krita.cpp.
References KisPart::currentMainwindow(), KisMainWindow::dockWidgets(), and KisPart::instance().
Definition at line 140 of file Krita.cpp.
References documents(), and KisPart::instance().
return a list with all registered extension objects.
Definition at line 363 of file Krita.cpp.
References d, and krita::Krita::Private::extensions.
      
  | 
  slot | 
filter construct a Filter object with a default configuration.
| name | the name of the filter. Use Krita.instance().filters() to get a list of all possible filters. | 
Definition at line 156 of file Krita.cpp.
References filter(), filters(), KisFilterRegistry::instance(), KisGlobalResourcesInterface::instance(), Filter::setConfiguration(), Filter::setName(), and KoGenericRegistry< T >::value().
      
  | 
  slot | 
Filters are identified by an internal name. This function returns a list of all existing registered filters.
Definition at line 149 of file Krita.cpp.
References KisFilterRegistry::instance(), and KoGenericRegistry< T >::keys().
      
  | 
  slot | 
filterStrategies Retrieves all installed filter strategies. A filter strategy is used when transforming (scaling, shearing, rotating) an image to calculate the value of the new pixels. You can use th
Definition at line 189 of file Krita.cpp.
References KisFilterStrategyRegistry::instance(), and KoGenericRegistry< T >::keys().
      
  | 
  staticslot | 
Scripter.fromVariant(variant) variant is a QVariant returns instance of QObject-subclass
This is a helper method for PyQt because PyQt cannot cast a variant to a QObject or QWidget
Definition at line 406 of file Krita.cpp.
References v.
      
  | 
  staticslot | 
Definition at line 433 of file Krita.cpp.
References KoResourcePaths::getAppDataLocation().
      
  | 
  slot | 
icon This allows you to get icons from Krita's internal icons.
| iconName | name of the icon. | 
Definition at line 380 of file Krita.cpp.
References KisIconUtils::loadIcon().
      
  | 
  staticslot | 
instance retrieve the singleton instance of the Application object.
Definition at line 390 of file Krita.cpp.
References Krita(), and s_instance.
      
  | 
  staticslot | 
      
  | 
  staticslot | 
      
  | 
  privateslot | 
This is called from the constructor of the window, before the xmlgui file is loaded.
Definition at line 438 of file Krita.cpp.
References d, and krita::Krita::Private::extensions.
      
  | 
  slot | 
notifier the Notifier singleton emits signals when documents are opened and closed, the configuration changes, views are opened and closed or windows are opened.
Definition at line 214 of file Krita.cpp.
References d, and krita::Krita::Private::notifier.
      
  | 
  slot | 
openDocument creates a new Document, registers it with the Krita application and loads the given file.
| filename | the file to open in the document | 
Definition at line 339 of file Krita.cpp.
References KisPart::addDocument(), batchmode(), KisPart::createDocument(), KisDocument::DontAddToRecent, KisPart::instance(), KisDocument::openPath(), and KisDocument::setFileBatchMode().
      
  | 
  slot | 
openWindow create a new main window. The window is not shown by default.
Definition at line 352 of file Krita.cpp.
References KisPart::createMainWindow(), and KisPart::instance().
      
  | 
  slot | 
profiles creates a list with the names of all color profiles compatible with the given color model and color depth.
| colorModel | A string describing the color model of the image: 
  | 
| colorDepth | A string describing the color depth of the image: 
  | 
Definition at line 194 of file Krita.cpp.
References KoColorSpaceRegistry::colorSpaceId(), KoColorSpaceRegistry::instance(), KoColorProfile::name, profiles(), and KoColorSpaceRegistry::profilesFor().
      
  | 
  slot | 
readSetting read the given setting value from the kritarc file.
| group | The group the setting is part of. If empty, then the setting is read from the general group. | 
| name | The name of the setting | 
| defaultValue | The default value of the setting | 
Definition at line 374 of file Krita.cpp.
      
  | 
  slot | 
return all recent documents registered in the RecentFiles group of the kritarc
Definition at line 305 of file Krita.cpp.
References recentDocuments().
      
  | 
  slot | 
resources returns a list of Resource objects of the given type
| type | Valid types are: | 
Definition at line 251 of file Krita.cpp.
References ResourceType::Brushes, KisBrushServerProvider::brushServer(), KisAbstractResourceModel::Filename, ResourceType::Gradients, KoResourceServerProvider::gradientServer, KisAbstractResourceModel::Id, KisBrushServerProvider::instance(), KisResourceServerProvider::instance(), KoResourceServerProvider::instance(), KisAbstractResourceModel::Name, KisResourceServerProvider::paintOpPresetServer(), ResourceType::Palettes, KoResourceServerProvider::paletteServer, ResourceType::Patterns, KoResourceServerProvider::patternServer, KoResourceServer< T >::resourceModel(), resources(), KisAbstractResourceModel::Thumbnail, ResourceType::Workspaces, and KisResourceServerProvider::workspaceServer().
setActiveDocument activates the first view that shows the given document
| value | the document we want to activate | 
Definition at line 119 of file Krita.cpp.
References KisView::document, KisPart::instance(), value(), and views().
      
  | 
  slot | 
      
  | 
  slot | 
version Determine the version of Krita
Usage: print(Application.version ())
Definition at line 219 of file Krita.cpp.
References KritaVersionWrapper::versionString().
Definition at line 224 of file Krita.cpp.
References KisPart::instance(), and views().
Definition at line 242 of file Krita.cpp.
References KisPart::instance().
      
  | 
  slot | 
writeSetting write the given setting under the given name to the kritarc file in the given settings group.
| group | The group the setting belongs to. If empty, then the setting is written in the general section | 
| name | The name of the setting | 
| value | The value of the setting. Script settings are always written as strings. | 
Definition at line 368 of file Krita.cpp.
References value().