From 90825e2392b2d70e43c7a25b8a3752299a933894 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- python/pykde/doc/static.html | 183 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 python/pykde/doc/static.html (limited to 'python/pykde/doc/static.html') diff --git a/python/pykde/doc/static.html b/python/pykde/doc/static.html new file mode 100644 index 00000000..e68f13bd --- /dev/null +++ b/python/pykde/doc/static.html @@ -0,0 +1,183 @@ + + +Types and Related Topics + + + +

Types and Related Topics

+

Static Member Functions

+

+Static member functions are implemented as Python class functions. +For example the C++ static member function +QObject::connect() +is called from Python as +QObject.connect() or +self.connect() +if called from a sub-class of +QObject. +

+

None and NULL

+

Throughout the bindings, the +None +value can be specified wherever +NULL +is acceptable to the underlying C++ code.

+

Equally, +NULL +is converted to +None +whenever it is returned by the underlying C++ code +

+ +

Enumerated Types

+

+Enumerated types are implemented as a set of simple variables corresponding to +the separate enumerated values. +

+

+When using an enumerated value the name of the class (or a sub-class) in which +the enumerated type was defined in must be included. For example: +

+ + + + +
+
+Qt.SolidPattern
+QWidget.TabFocus
+QFrame.TabFocus
+
+
+ +

Namespaces

+

+The C++ code in KDE makes extensive use of namespaces (especially in the kio, kjs, +khtml, kfile, and kparts modules). In PyKDE, namespaces are treated as a "superclass". +For example, "from kparts import KParts" will import the KParts namespace and all +its members. To reference a class in the namespace, use <namespace name>..<classname>, +for example, KParts.ReadOnlyPart. It isn't necessary to import the <classname> (ReadOnlyPart +in the example). +

+

Return and Argument Types

+

+Some return types or argument types may be different than those in the C++ KDE libs. This is +done for convenience (eg returning/taking Python lists or dicts), because arguments are +scalar (non-object) types passed by reference (eg int*, bool&), or because there is no +way to express the C++ type in Python (eg template types) +

+

+Please check the Class Reference Docs which list all classes +and methods in Python format. +

+

Version Information

New in PyKDE-3.11

+

+PyKDE provides methods for determining both the KDE version being run and the PyKDE +version being run. The version methods are: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
return typeKDEExamplePyKDEExample
intKDE.versionMajor ()3PyKDE.versionMajor ()3
intKDE.versionMinor ()1PyKDE.versionMinor ()8
intKDE.versionRelease ()4PyKDE.versionRelease ()0
stringKDE.versionString ()"3.1.4"PyKDE.versionString ()"3.11.0"
+ +

Abstract Classes and Pure Virtual Methods

+

+C++ allows the use of abstract classes. Abstract classes cannot be used in programs +(instantiated) directly; their only purpose is to serve as a base class from which +programmers can derive other classes that can be used. +

+

+An abstract class in C++ is defined as a class that has one or more 'pure virtual' +methods. These can be identified in the C++ header files or C++ docs as methods set +equal to 0, for example: +

+ + + + +
+
+virtual int somePureVirtualMethod (int a) = 0;
+
+
+

+To derive a useful class from the abstract class, the programmer has to write methods +to overload each of the pure virtual methods. Following a suggestion on the mailing +list, the docs attempt to flag all abstract classes and identify the pure virtual +methods which must be overloaded in the derived class. Derived classes can be created +in Python by writing Python methods to overload the pure virtual methods - no C++ code +is required. +

+ + + + + -- cgit v1.2.3