Krita

Search for usage in LXR

#include <Krita.h>

Inheritance diagram for Krita:

Public Slots

QActionaction (const QString &name) const
 
QList< QAction * > actions () const
 
DocumentactiveDocument () const
 
WindowactiveWindow () const
 
void addDockWidgetFactory (DockWidgetFactoryBase *factory)
 
void addExtension (Extension *extension)
 
bool addProfile (const QString &profilePath)
 
bool batchmode () const
 
QStringList colorDepths (const QString &colorModel) const
 
QStringList colorModels () const
 
DocumentcreateDocument (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 ()
 
Filterfilter (const QString &name) const
 
QStringList filters () const
 
QStringList filterStrategies () const
 
static QObjectfromVariant (const QVariant &v)
 
static QString getAppDataLocation ()
 
QIcon icon (QString &iconName) const
 
static Kritainstance ()
 
static QString krita_i18n (const QString &text)
 
static QString krita_i18nc (const QString &context, const QString &text)
 
Notifiernotifier () const
 
DocumentopenDocument (const QString &filename)
 
WindowopenWindow ()
 
QStringList profiles (const QString &colorModel, const QString &colorDepth) const
 
QString readSetting (const QString &group, const QString &name, const QString &defaultValue)
 
QStringList recentDocuments () const
 
QMap< QString, Resource * > resources (QString &type) const
 
void setActiveDocument (Document *value)
 
void setBatchmode (bool value)
 
QString version () const
 
QList< View * > views () const
 
QList< Window * > windows () const
 
void writeSetting (const QString &group, const QString &name, const QString &value)
 

Public Member Functions

 Krita (QObject *parent=0)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Additional Inherited Members

- Public Types inherited from QObject
typedef  QObjectList
 
- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

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.

Definition at line 27 of file Krita.h.

Constructor & Destructor Documentation

◆ Krita()

Krita::Krita ( QObject * parent = 0)
explicit

Definition at line 68 of file Krita.cpp.

◆ ~Krita()

Krita::~Krita ( )
override

Definition at line 76 of file Krita.cpp.

Member Function Documentation

◆ action

QAction * Krita::action ( const QString & name) const
slot
Returns
the action that has been registered under the given name, or 0 if no such action exists.

Definition at line 93 of file Krita.cpp.

◆ actions

QList< QAction * > Krita::actions ( ) const
slot
Returns
return a list of all actions for the currently active mainWindow.

Definition at line 83 of file Krita.cpp.

◆ activeDocument

Document * Krita::activeDocument ( ) const
slot
Returns
the currently active document, if there is one.

Definition at line 104 of file Krita.cpp.

◆ activeWindow

Window * Krita::activeWindow ( ) const
slot
Returns
the currently active window or None if there is no window

Definition at line 245 of file Krita.cpp.

◆ addDockWidgetFactory

void Krita::addDockWidgetFactory ( DockWidgetFactoryBase * factory)
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.

Parameters
factoryThe factory object.

Definition at line 397 of file Krita.cpp.

◆ addExtension

void Krita::addExtension ( Extension * extension)
slot

addExtension add the given plugin to Krita.

There will be a single instance of each Extension in the Krita process.

Parameters
extensionthe extension to add.

Definition at line 370 of file Krita.cpp.

◆ addProfile

bool Krita::addProfile ( const QString & profilePath)
slot

addProfile load the given profile into the profile registry.

Parameters
profilePaththe path to the profile.
Returns
true if adding the profile succeeded.

Definition at line 219 of file Krita.cpp.

◆ batchmode

bool Krita::batchmode ( ) const
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.

Returns
true if the script is run in batchmode

Definition at line 129 of file Krita.cpp.

◆ colorDepths

QStringList Krita::colorDepths ( const QString & colorModel) const
slot

colorDepths creates a list with the names of all color depths compatible with the given color model.

Parameters
colorModelthe id of a color model.
Returns
a list of all color depths or a empty list if there is no such color depths.

Definition at line 183 of file Krita.cpp.

◆ colorModels

QStringList Krita::colorModels ( ) const
slot

colorModels creates a list with all color models id's registered.

Returns
a list of all color models or a empty list if there is no such color models.

Definition at line 169 of file Krita.cpp.

◆ createDocument

Document * Krita::createDocument ( int width,
int height,
const QString & name,
const QString & colorModel,
const QString & colorDepth,
const QString & profile,
double resolution )
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:
from Krita import *
def add_document_to_window():
d = Application.createDocument(100, 100, "Test", "RGBA", "U8", "", 120.0)
Application.activeWindow().addView(d)
add_document_to_window()
Krita is a singleton class that offers the root access to the Krita object hierarchy.
Definition Krita.h:28
Window * activeWindow() const
Definition Krita.cpp:245
View * addView(Document *document)
Open a new view on the given document in this window.
Definition Window.cpp:83
   @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 329 of file Krita.cpp.

◆ dockers

QList< QDockWidget * > Krita::dockers ( ) const
slot
Returns
a list of all the dockers

Definition at line 308 of file Krita.cpp.

◆ documents

QList< Document * > Krita::documents ( ) const
slot
Returns
a list of all open Documents

Definition at line 140 of file Krita.cpp.

◆ extensions

QList< Extension * > Krita::extensions ( )
slot

return a list with all registered extension objects.

Definition at line 375 of file Krita.cpp.

◆ filter

Filter * Krita::filter ( const QString & name) const
slot

filter construct a Filter object with a default configuration.

Parameters
namethe name of the filter. Use Krita.instance().filters() to get a list of all possible filters.
Returns
the filter or None if there is no such filter.

Definition at line 156 of file Krita.cpp.

◆ filters

QStringList Krita::filters ( ) const
slot

Filters are identified by an internal name.

This function returns a list of all existing registered filters.

Returns
a list of all registered filters

Definition at line 149 of file Krita.cpp.

◆ filterStrategies

QStringList Krita::filterStrategies ( ) const
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

Returns
the id's of all available filters.

Definition at line 197 of file Krita.cpp.

◆ fromVariant

QObject * Krita::fromVariant ( const QVariant & v)
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 418 of file Krita.cpp.

◆ getAppDataLocation

QString Krita::getAppDataLocation ( )
staticslot

Definition at line 445 of file Krita.cpp.

◆ icon

QIcon Krita::icon ( QString & iconName) const
slot

icon This allows you to get icons from Krita's internal icons.

Parameters
iconNamename of the icon.
Returns
the icon related to this name.

Definition at line 392 of file Krita.cpp.

◆ instance

Krita * Krita::instance ( )
staticslot

instance retrieve the singleton instance of the Application object.

Definition at line 402 of file Krita.cpp.

◆ krita_i18n

QString Krita::krita_i18n ( const QString & text)
staticslot

Definition at line 435 of file Krita.cpp.

◆ krita_i18nc

QString Krita::krita_i18nc ( const QString & context,
const QString & text )
staticslot

Definition at line 440 of file Krita.cpp.

◆ notifier

Notifier * Krita::notifier ( ) const
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.

Returns
the notifier object

Definition at line 226 of file Krita.cpp.

◆ openDocument

Document * Krita::openDocument ( const QString & filename)
slot

openDocument creates a new Document, registers it with the Krita application and loads the given file.

Parameters
filenamethe file to open in the document
Returns
the document

Definition at line 351 of file Krita.cpp.

◆ openWindow

Window * Krita::openWindow ( )
slot

openWindow create a new main window.

The window is not shown by default.

Definition at line 364 of file Krita.cpp.

◆ profiles

QStringList Krita::profiles ( const QString & colorModel,
const QString & colorDepth ) const
slot

profiles creates a list with the names of all color profiles compatible with the given color model and color depth.

Parameters
colorModelA string describing the color model of the image:
  • A: Alpha mask
  • RGBA: RGB with alpha channel (The actual order of channels is most often BGR!)
  • XYZA: XYZ with alpha channel
  • LABA: LAB with alpha channel
  • CMYKA: CMYK with alpha channel
  • GRAYA: Gray with alpha channel
  • YCbCrA: YCbCr with alpha channel
colorDepthA string describing the color depth of the image:
  • U8: unsigned 8 bits integer, the most common type
  • U16: unsigned 16 bits integer
  • F16: half, 16 bits floating point. Only available if Krita was built with OpenEXR
  • F32: 32 bits floating point
Returns
a list with valid names

Definition at line 202 of file Krita.cpp.

◆ readSetting

QString Krita::readSetting ( const QString & group,
const QString & name,
const QString & defaultValue )
slot

readSetting read the given setting value from the kritarc file.

Parameters
groupThe group the setting is part of. If empty, then the setting is read from the general group.
nameThe name of the setting
defaultValueThe default value of the setting
Returns
a string representing the setting.

Definition at line 386 of file Krita.cpp.

◆ recentDocuments

QStringList Krita::recentDocuments ( ) const
slot

return all recent documents registered in the RecentFiles group of the kritarc

Definition at line 317 of file Krita.cpp.

◆ resources

QMap< QString, Resource * > Krita::resources ( QString & type) const
slot

resources returns a list of Resource objects of the given type

Parameters
typeValid types are:
  • pattern
  • gradient
  • brush
  • preset
  • palette
  • workspace

Definition at line 263 of file Krita.cpp.

◆ setActiveDocument

void Krita::setActiveDocument ( Document * value)
slot

setActiveDocument activates the first view that shows the given document

Parameters
valuethe document we want to activate

Definition at line 119 of file Krita.cpp.

◆ setBatchmode

void Krita::setBatchmode ( bool value)
slot

setBatchmode sets the batchmode to

Parameters
value;if true, scripts should not show dialogs or messageboxes.

Definition at line 134 of file Krita.cpp.

◆ version

QString Krita::version ( ) const
slot

version Determine the version of Krita

Usage: print(Application.version ())

Returns
the version string including git sha1 if Krita was built from git

Definition at line 231 of file Krita.cpp.

◆ views

QList< View * > Krita::views ( ) const
slot
Returns
a list of all views. A Document can be shown in more than one view.

Definition at line 236 of file Krita.cpp.

◆ windows

QList< Window * > Krita::windows ( ) const
slot
Returns
a list of all windows

Definition at line 254 of file Krita.cpp.

◆ writeSetting

void Krita::writeSetting ( const QString & group,
const QString & name,
const QString & value )
slot

writeSetting write the given setting under the given name to the kritarc file in the given settings group.

Parameters
groupThe group the setting belongs to. If empty, then the setting is written in the general section
nameThe name of the setting
valueThe value of the setting. Script settings are always written as strings.

Definition at line 380 of file Krita.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:13:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.