From 479f5f799523bffbcc83dff581a2299c047c6fff Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:44:01 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- python/pykde/doc/limits.html | 64 ++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'python/pykde/doc/limits.html') diff --git a/python/pykde/doc/limits.html b/python/pykde/doc/limits.html index 3316c8c9..d94cabcb 100644 --- a/python/pykde/doc/limits.html +++ b/python/pykde/doc/limits.html @@ -79,18 +79,18 @@ NAME="AEN30" >Unicode support was added to Qt in v2.0 and to Python in v1.6. In Qt, Unicode support is implemented using the QStringTQString class. It is important to understand that QStringTQStrings, Python string objects and Python Unicode objects are all different but conversions between them are automatic in many cases and easy to achieve manually when needed.

Whenever PyKDE expects a QStringTQString as a function argument, a Python string object or a Python Unicode object can be provided instead, and PyKDE will do the necessary conversion automatically.

You may also manually convert Python string and Unicode objects to QStringTQStrings by using the QStringTQString constructor as demonstrated in the following code fragment.

qs1 = QString('Converted Python string object')
-qs2 = QString(u'Converted Python Unicode object')
qs1 = TQString('Converted Python string object') +qs2 = TQString(u'Converted Python Unicode object')

In order to convert a QStringTQString to a Python string object use the Python str() to a null QStringTQString and an empty QStringTQString both result in an empty Python string object.

In order to convert a QStringTQString to a Python Unicode object use the Python unicode() to a null QStringTQString and an empty QStringTQString both result in an empty Python Unicode object.

c = QColor();
-c = QColor();
c = TQColor(); +c = TQColor();
c = QColor()
-c = QColor()
c = TQColor() +c = TQColor()
self.c1 = QColor()
-self.c2 = QColor()
self.c1 = TQColor() +self.c2 = TQColor()QObjectTQObject (and any of its sub-classes) keeps pointers to its children and will automatically call their destructors. In these cases, the corresponding Python object will also keep a reference to the @@ -246,7 +246,7 @@ corresponding child objects.

So, in the following Python fragment, the first QLabelTQLabel is not destroyed when the second is assigned to because the parent QWidgetTQWidget still has a reference to it.

p = QWidget()
-l = QLabel('First label',p)
-l = QLabel('Second label',p)
p = TQWidget() +l = TQLabel('First label',p) +l = TQLabel('Second label',p)
tab = QTab()
+>tab = TQTab()
 tab.label = "First Tab"
-tab.r = QRect(10,10,75,30)
tr() methods

-In a normal Qt installation, every descendant of QObject inherits two methods -(tr (const char *) and tr (const char *, const char *) from QObject explicitly +In a normal Qt installation, every descendant of TQObject inherits two methods +(tr (const char *) and tr (const char *, const char *) from TQObject explicitly and also overloads these methods via the moc mechanism (by defining Q_OBJECT in the class declaration). KDE however is compiled with -DQT_NO_TRANSLATION, which prevents moc from creating the overloading tr() methods, and also produces @@ -330,9 +330,9 @@ side-effects with a normal Qt installation which was compiled without the

PyKDE handles this situation by NOT providing tr() methods (either the inherited -methods from QObject or the moc generated methods) for any KDE based QObject -descendant. The tr() methods are static, so QObject::tr () methods are available -via PyQt, as are tr() methods for any PyQt QObject descendant. PyKDE's handling +methods from TQObject or the moc generated methods) for any KDE based QObject +descendant. The tr() methods are static, so TQObject::tr () methods are available +via PyQt, as are tr() methods for any PyQt TQObject descendant. PyKDE's handling of these methods has no effect on PyQt.

Instead of the tr() methods, KDE uses corresponding i18n() methods for translating. -- cgit v1.2.3