This document describes a set of Python bindings for the TQt widget set.
Contact the author at <phil@riverbankcomputing.co.uk>
.
PyTQt is a set of Python bindings for the TQt toolkit and available for all platforms supported by TQt, including Windows, Linux, UNIX, MacOS/X and embedded systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested against TQt versions 1.43 to 3.3.7, TQt Non-commercial, TQtopia 1.5.0, and Python versions 1.5 to 2.5. TQt/Embedded v3 is not supported. TQt v4 is supported by PyTQt v4.
PyTQt is available under the GPL license for use with the GPL version of TQt, a a commercial license for use with the commercial version of TQt, a non-commercial license for use with the non-commercial version of TQt v2, and an educational license for use with the educational version of TQt.
PyTQt is built using SIP (a tool for generating Python extension modules for C++ class libraries). SIP v4.6 or later must be installed in order to build and run this version of PyTQt.
PyTQt for MacOS/X requires TQt v3.1.0 or later and Python v2.3 or later.
The bindings are implemented as a number of Python modules
tqt is the main module and contains the core classes and most user interface widgets.
tqtaxcontainer contains a sub-set of the classes implemented in TQt's TQAxContainer module, part of TQt's ActiveTQt framework.
tqtcanvas contains the classes implemented in TQt's Canvas module.
tqtgl contains the classes implemented in TQt's OpenGL module.
tqtnetwork contains the classes implemented in TQt's Network module.
tqtpe contains the classes implemented in TQtopia (originally called the TQt Palmtop Environment). It is only supported with TQt/Embedded.
tqtsql contains the classes implemented in TQt's SQL module.
tqttable contains the classes implemented in TQt's Table module.
tqtui contains the classes implemented in TQt's tqui library. These allow GUIs to be created directly from TQt Designer's .ui files.
tqtxml contains the classes implemented in TQt's XML module.
tqtext contains useful third-party classes that are not part of TQt. At the moment it contains bindings for TQScintilla, the port to TQt of the Scintilla programmer's editor class.
PyTQt also includes the pytquic and pytqlupdate utilities which correspond to the TQt uic and lupdate utilities. pytquic converts the GUI designs created with TQt Designer to executable Python code. pytqlupdate scans Python code, extracts all strings that are candidates for internationalisation, and creates an XML file for use by TQt Linguist.
TQt Designer is a GPL'ed GUI design editor provided by Trolltech as part of TQt. It generates an XML description of a GUI design. TQt includes uic which generates C++ code from that XML.
PyTQt includes pytquic which generates Python code from the same XML. The Python code is self contained and can be executed immediately.
It is sometimes useful to be able to include some specific Python code in the output generated by pytquic. For example, if you are using custom widgets, pytquic has no way of knowing the name of the Python module containing the widget and so cannot generate the required import statement. To help get around this, pytquic will extract any lines entered in the Comment field of TQt Designer's Form Settings dialog that begin with Python: and copies them to the generated output.
Here's a simple example showing the contents of the Comment field.
This comment will be ignored by pytquic. Python: Python:# Import our custom widget. Python:from foo import bar |
Here's the corresponding output from pytquic.
from PyTQt.tqt import * # Import our custom widget. from foo import bar |
Thanks to Christian Bird, pytquic will extract Python code entered using TQt Designer to implement slots. In TQt Designer, when you need to edit a slot and the source editor appears, enter Python code between the curly braces. Don't worry about the correct starting indent level, each line is prepended with a correct indentation.
Make sure that the ui.h file is in the same directory as the .ui file when using pytquic. The .ui file implies the name of the .ui.h file so there is no need to specify it on the command line.
Here's an example of a simple slot.
void DebMainWindowFrm::browsePushButtonClicked() { if self.debugging: TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") } |
Here is the resulting code when pytquic is run.
class DebMainWindowFrm(TQMainWindow): ...stuff... def browsePushButtonClicked(self): if self.debugging: TQMessageBox.critical(self, "Event", "browse pushbutton was clicked!") |
Note that indenting is as normal and that self and all other parameters passed to the slot are available.
If you use this, you will need to turn off all of the fancy options for the C++ editor in Designer as it tries to force C++ syntax and that's naturally annoying when trying to code in Python.
TQt includes the lupdate program which parses C++ source files converting calls to the TQT_TR_NOOP() and TQT_TRANSLATE_NOOP() macros to .ts language source files. The lrelease program is then used to generate .qm binary language files that are distributed with your application.
Thanks to Detlev Offenbach, PyTQt includes the pytqlupdate program. This generates the same .ts language source files from your PyTQt source files.
When deploying commercial PyTQt applications it is necessary to discourage users from accessing the underlying PyTQt modules for themselves. A user that used the modules shipped with your application to develop new applications would themselves be considered a developer and would need their own commercial TQt and PyTQt licenses.
One solution to this problem is the VendorID package. This allows you to build Python extension modules that can only be imported by a digitally signed custom interpreter. The package enables you to create such an interpreter with your application embedded within it. The result is an interpreter that can only run your application, and PyTQt modules that can only be imported by that interpreter. You can use the package to similarly restrict access to any extension module.
In order to build PyTQt with support for the VendorID package, pass the -i command line flag to configure.py.
The SIP build system (ie. the sipconfig module) is described in the SIP documentation. PyTQt includes the pytqtconfig module that can be used by configuration scripts of other bindings that are built on top of PyTQt.
The pytqtconfig module contains the following classes:
This class encapsulates additional configuration values, specific to PyTQt, that can be accessed as instance variables.
The following configuration values are provided (in addition to those provided by the sipconfig.Configuration class):
The name of the directory containing the pytquic and pytqlupdate executables.
The name of the directory containing the PyTQt modules.
A string containing the names of the PyTQt modules that were installed.
A string of the SIP flags used to generate the code for the tqt module and which should be added to those needed by any module that imports the tqt module.
A string of the SIP flags used to generate the code for the tqtaxcontainer module and which should be added to those needed by any module that imports the tqtaxcontainer module.
A string of the SIP flags used to generate the code for the tqtcanvas module and which should be added to those needed by any module that imports the tqtcanvas module.
A string of the SIP flags used to generate the code for the tqtext module and which should be added to those needed by any module that imports the tqtext module.
A string of the SIP flags used to generate the code for the tqtgl module and which should be added to those needed by any module that imports the tqtgl module.
A string of the SIP flags used to generate the code for the tqtnetwork module and which should be added to those needed by any module that imports the tqtnetwork module.
A string of the SIP flags used to generate the code for the tqtsql module and which should be added to those needed by any module that imports the tqtsql module.
A string of the SIP flags used to generate the code for the tqttable module and which should be added to those needed by any module that imports the tqttable module.
A string of the SIP flags used to generate the code for the tqtui module and which should be added to those needed by any module that imports the tqtui module.
A string of the SIP flags used to generate the code for the tqtxml module and which should be added to those needed by any module that imports the tqtxml module.
The name of the base directory where the .sip files for each of the PyTQt modules is installed. A sub-directory exists with the same name as the module.
The PyTQt version as a 3 part hexadecimal number (eg. v3.10 is represented as 0x030a00).
The PyTQt version as a string. For development snapshots it will start with snapshot-.
The Makefile class for modules that import the tqt module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqtaxcontainer module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqtcanvas module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqtext module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqtgl module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqtnetwork module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqttable module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqtsql module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqtui module.
This is a reimplementation of sipconfig.Makefile.finalise().
The Makefile class for modules that import the tqtxml module.
This is a reimplementation of sipconfig.Makefile.finalise().
Internally PyTQt implements a lazy technique for attribute lookup where attributes are only placed in type and instance dictionaries when they are first referenced. This technique is needed to reduce the time taken to import large modules such as PyTQt.
In most circumstances this technique is transparent to an application. The exception is when super is used with a PyTQt class. The way that super is currently implemented means that the lazy lookup is bypassed resulting in AttributeError exceptions unless the attribute has been previously referenced.
Note that this restriction applies to any class wrapped by SIP and not just PyTQt.
Unicode support was added to TQt in v2.0 and to Python in v1.6. In TQt, Unicode support is implemented using the TQString class. It is important to understand that TQStrings, 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 PyTQt expects a TQString as a function argument, a Python string object or a Python Unicode object can be provided instead, and PyTQt will do the necessary conversion automatically.
You may also manually convert Python string and Unicode objects to TQStrings by using the TQString constructor as demonstrated in the following code fragment.
qs1 = TQString('Converted Python string object') qs2 = TQString(u'Converted Python Unicode object') |
In order to convert a TQString to a Python string object use the Python str() function. Applying str() to a null TQString and an empty TQString both result in an empty Python string object.
In order to convert a TQString to a Python Unicode object use the Python unicode() function. Applying unicode() to a null TQString and an empty TQString both result in an empty Python Unicode object.
When an instance of a C++ class is not created from Python it is not possible to access the protected member functions, or emit the signals, of that instance. Attempts to do so will raise a Python exception. Also, any Python methods corresponding to the instance's virtual member functions will never be called.
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.
PyTQt represents void * values as objects of type sip.voidptr. Such values are often used to pass the addresses of external objects between different Python modules. To make this easier, a Python integer (or anything that Python can convert to an integer) can be used whenever a sip.voidptr is expected.
A sip.voidptr may be converted to a Python integer by using the int() builtin function.
A sip.voidptr may be converted to a Python string by using its asstring() method. The asstring() method takes an integer argument which is the length of the data in bytes.
PyTQt implements the full set of TQt's thread classes. Python, of course, also has its own thread extension modules. If you are using SIP v4 (or later) and Python v2.3.5 (or later) then PyTQt does not impose any additional restrictions. (Read the relevant part of the TQt documentation to understand the restrictions imposed by the TQt API.)
If you are using earlier versions of either SIP or Python then it is possible to use either of the APIs so long as you follow some simple rules.
If you use the TQt API then the very first import of one of the PyTQt modules must be done from the main thread.
If you use the Python API then all calls to PyTQt (including any imports) must be done from one thread only. Therefore, if you want to make calls to PyTQt from several threads then you must use the TQt API.
If you want to use both APIs in the same application then all calls to PyTQt must be done from threads created using the TQt API.
The above comments actually apply to any SIP generated module, not just PyTQt.
C++ does not garbage collect unreferenced class instances, whereas Python does. In the following C++ fragment both colours exist even though the first can no longer be referenced from within the program:
c = new TQColor(); c = new TQColor(); |
In the corresponding Python fragment, the first colour is destroyed when the second is assigned to c:
c = TQColor() c = TQColor() |
In Python, each colour must be assigned to different names. Typically this is done within class definitions, so the code fragment would be something like:
self.c1 = TQColor() self.c2 = TQColor() |
Sometimes a TQt class instance will maintain a pointer to another instance and will eventually call the destructor of that second instance. The most common example is that a TQObject (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 corresponding child objects.
So, in the following Python fragment, the first TQLabel is not destroyed when the second is assigned to l because the parent TQWidget still has a reference to it.
p = TQWidget() l = TQLabel('First label',p) l = TQLabel('Second label',p) |
Access to C++ variables is supported. They are accessed as Python instance variables. For example:
tab = TQTab() tab.label = "First Tab" tab.r = TQRect(10,10,75,30) |
Global variables and static class variables are effectively read-only. They can be assigned to, but the underlying C++ variable will not be changed. This may change in the future.
Access to protected C++ class variables is not supported. This may change in the future.
It is not possible to define a new Python class that sub-classes from more than one TQt class.
TQt implements i18n support through the TQt Linguist application, the TQTranslator class, and the TQApplication::translate(), TQObject::tr() and TQObject::trUtf8() methods. Usually the tr() method is used to obtain the correct translation of a message. The translation process uses a message context to allow the same message to be translated differently. tr() is actually generated by moc and uses the hardcoded class name as the context. On the other hand, TQApplication::translate() allows to context to be explicitly stated.
Unfortunately, because of the way TQt implents tr() (and trUtf8()) it is not possible for PyTQt to exactly reproduce its behavour. The PyTQt implementation of tr() (and trUtf8()) uses the class name of the instance as the context. The key difference, and the source of potential problems, is that the context is determined dynamically in PyTQt, but is hardcoded in TQt. In other words, the context of a translation may change depending on an instance's class hierarchy.
class A(TQObject): def __init__(self): TQObject.__init__(self) def hello(self): return self.tr("Hello") class B(A): def __init__(self): A.__init__(self) a = A() a.hello() b = B() b.hello() |
In the above the message is translated by a.hello() using a context of A, and by b.hello() using a context of B. In the equivalent C++ version the context would be A in both cases.
The PyTQt behaviour is unsatisfactory and may be changed in the future. It is recommended that TQApplication.translate() be used in preference to tr() (and trUtf8()). This is guaranteed to work with current and future versions of PyTQt and makes it much easier to share message files between Python and C++ code. Below is the alternative implementation of A that uses TQApplication.translate().
class A(TQObject): def __init__(self): TQObject.__init__(self) def hello(self): return tqApp.translate("A","Hello") |
Note that the code generated by pytquic uses TQApplication.translate().
A signal may be either a TQt signal (specified using TQ_SIGNAL()) or a Python signal (specified using PYSIGNAL()).
A slot can be either a Python callable object, a TQt signal (specified using TQ_SIGNAL()), a Python signal (specified using PYSIGNAL()), or a TQt slot (specified using TQ_SLOT()).
You connect signals to slots (and other signals) as you would from C++. For example:
TQObject.connect(a,TQ_SIGNAL("TQtSig()"),pyFunction) TQObject.connect(a,TQ_SIGNAL("TQtSig()"),pyClass.pyMethod) TQObject.connect(a,TQ_SIGNAL("TQtSig()"),PYSIGNAL("PySig")) TQObject.connect(a,TQ_SIGNAL("TQtSig()"),TQ_SLOT("TQtSlot()")) TQObject.connect(a,PYSIGNAL("PySig"),pyFunction) TQObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) TQObject.connect(a,PYSIGNAL("PySig"),TQ_SIGNAL("TQtSig()")) TQObject.connect(a,PYSIGNAL("PySig"),TQ_SLOT("TQtSlot()")) |
When a slot is a Python method that corresponds to a TQt slot then a signal can be connected to either the Python method or the TQt slot. The following connections achieve the same effect.
sbar = TQScrollBar() lcd = TQLCDNumber() TQObject.connect(sbar,TQ_SIGNAL("valueChanged(int)"),lcd.display) TQObject.connect(sbar,TQ_SIGNAL("valueChanged(int)"),lcd,TQ_SLOT("display(int)")) |
The difference is that the second connection is made at the C++ level and is more efficient.
Disconnecting signals works in exactly the same way.
Any instance of a class that is derived from the TQObject class can emit a signal using the emit method. This takes two arguments. The first is the Python or TQt signal, the second is a Python tuple which are the arguments to the signal. For example:
a.emit(TQ_SIGNAL("clicked()"),()) a.emit(PYSIGNAL("pySig"),("Hello","World")) |
Note that when a slot is a Python callable object its reference count is not increased. This means that a class instance can be deleted without having to explicitly disconnect any signals connected to its methods. However, it also means that using lambda expressions as slots will not work unless you keep a separate reference to the expression to prevent it from being immediately garbage collected.
TQt allows a signal to be connected to a slot that requires fewer arguments than the signal passes. The extra arguments are quietly discarded. Python slots can be used in the same way.
Static member functions are implemented as Python class functions. For example the C++ static member function TQObject::connect() is called from Python as TQObject.connect() or self.connect() if called from a sub-class of TQObject.
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:
TQt.SolidPattern TQWidget.TabFocus TQFrame.TabFocus |
The following sections should be used in conjunction with the normal class documentation - only the differences specific to the Python bindings are documented here.
In these sections, Not yet implemented implies that the feature can be easily implemented if needed. Not implemented implies that the feature will not be implemented, either because it cannot be or because it is not appropriate.
If a class is described as being fully implemented then all non-private member functions and all public class variables have been implemented.
If an operator has been implemented then it is stated explicitly.
Classes that are not mentioned have not yet been implemented.
All constant values defined by TQt have equivalent constants defined to Python.
This takes one parameter which is a list of argument strings. Arguments used by TQt are removed from the list.
This takes two parameters, the first of which is a list of argument strings. Arguments used by TQt are removed from the list.
This takes two parameters, the first of which is a list of argument strings. Arguments used by TQt are removed from the list. (TQt v2.2+)
This has been renamed to exec_loop in Python.
A Python string can be used whenever a TQByteArray can be used. A TQByteArray can be converted to a Python string using the Python str() function.
Not implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not implemented.
Not implemented.
The Python == and != operators are supported.
This takes no parameters and returns the h, s and v values as a tuple.
This takes no parameters and returns the r, g and b values as a tuple.
This takes no parameters and returns the h, s and v values as a tuple.
This takes no parameters and returns the r, g and b values as a tuple.
This takes the initial, parent and name parameters and returns a tuple containing the TQRgb result and the ok value.
This takes no parameters and returns a tuple of the x and y values. (TQt v2)
This takes only the t parameter and returns a tuple of the hframe, vframe and overlap values. (TQt v2)
A Python string can be used whenever a TQCString can be used. A TQCString can be converted to a Python string using the Python str() function.
Not implemented.
This returns a tuple of the short result and the ok value.
This returns a tuple of the ushort result and the ok value.
This returns a tuple of the int result and the ok value.
This returns a tuple of the uint result and the ok value.
This returns a tuple of the long result and the ok value.
This returns a tuple of the ulong result and the ok value.
This returns a tuple of the float result and the ok value.
This returns a tuple of the double result and the ok value.
This takes no parameters. The TQDataStream result and the data read are returned as a tuple.
This takes only the l parameter. The TQDataStream result and the data read are returned as a tuple.
len is derived from s and not passed as a parameter.
len is derived from s and not passed as a parameter.
The Python ==, !=, <, <=, >, >= and __nonzero__ operators are supported.
This takes no parameters and returns the week number and the year number as a tuple. (TQt v3.1+)
TQDateTime is fully implemented, including the Python ==, !=, <, <=, >, >= and __nonzero__ operators.
TQTime is fully implemented, including the Python ==, !=, <, <=, >, >= and __nonzero__ operators.
This has been renamed to exec_loop in Python.
This method also causes ownership of the underlying C++ dialog to be transfered to Python. This means that the C++ dialog will be deleted when the Python wrapper is garbage collected. Although this is a little inconsistent, it ensures that the dialog is deleted without having to explicity code it using TQObject.deleteLater() or other techniques.
TQDir is fully implemented, including the Python len, [] (for reading slices and individual elements), ==, != and in operators
This class isn't implemented. Whenever a TQFileInfoList is the return type of a function or the type of an argument, a Python list of TQFileInfo instances is used instead.
This takes the w parameter and returns the index of the TQDockWIndow or -1 if the TQDockArea does not contain the TQDockWindow.
TQEvent is fully implemented.
Instances of TQEvents are automatically converted to the correct sub-class.
TQCustomEvent is fully implemented. Any Python object can be passed as the event data and its reference count is increased.
Not implemented.
This takes a single len parameter. The data is returned if there was no error, otherwise None is returned.
This takes a single maxlen parameter. The data is returned if there was no error, otherwise None is returned.
Not yet implemented. (TQt v2+)
Not yet implemented. (TQt v2+)
len is derived from data and not passed as a parameter.
TQFilePreview is fully implemented. However it cannot be used from Python in the same way as it is used from C++ because PyTQt does not support multiple inheritance involving more than one wrapped class. A trick that seems to work is to use composition rather than inheritance as in the following code fragment.
class FilePreview(TQFilePreview): pass class Preview(TQLabel): def __init__(self, parent=None): TQLabel.__init__(self, parent) self.preview = FilePreview() self.preview.previewUrl = self.previewUrl |
Note that TQFilePreview cannot be instantiated directly because it is abstract. Thanks to Hans-Peter Jansen for this trick.
This takes the def, parent and name parameters and returns a tuple containing the TQFont result and the ok value.
This takes the parent and name parameters and returns a tuple containing the TQFont result and the ok value.
TQRect boundingRect
(int x, int y, int w, int h, int flags, const TQString &str, int len = -1, int tabstops = 0, int *tabarray = 0);The tabarray parameter is a Python list of integers.
The tabarray parameter is a Python list of integers.
The Python == and != operators are supported.
This takes a list of strings as its parameter.
The colorTable parameter is a list of TQRgb instances or None. (TQt v2.1+)
The return value is a sip.voidptr object which is only useful if passed to another Python module.
The return value is a sip.voidptr object which is only useful if passed to another Python module.
Not implemented.
The return value is a sip.voidptr object which is only useful if passed to another Python module.
len is derived from buf and not passed as a parameter.
The return value is a sip.voidptr object which is only useful if passed to another Python module.
static void defineIOHandler
(const char *format, const char *header, const char *flags, image_io_handler read_image, image_io_handler write_image);Not implemented.
static TQString getText
(const TQString &caption, const TQString &label, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);The ok is not passed and the returned value is a tuple of the TQString result and the ok flag. (TQt v2.1 - v2.3.1)
static TQString getText
(const TQString &caption, const TQString &label, TQLineEdit::EchoModeecho, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);The ok is not passed and the returned value is a tuple of the TQString result and the ok flag. (TQt v2.2 - v2.3.1)
static TQString getText
(const TQString &caption, const TQString &label, TQLineEdit::EchoModeecho = TQLineEdit::Normal, const TQString &text = TQString::null, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);The ok is not passed and the returned value is a tuple of the TQString result and the ok flag. (TQt v3+)
static int getInteger
(const TQString &caption, const TQString &label, int num = 0, int from = -2147483647, int to = 2147483647, int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);The ok is not passed and the returned value is a tuple of the int result and the ok flag.
static double getDouble
(const TQString &caption, const TQString &label, double num = 0, double from = -2147483647, double to = 2147483647, int step = 1, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);The ok is not passed and the returned value is a tuple of the double result and the ok flag.
static TQString getItem
(const TQString &caption, const TQString &label, const TQStringList &list, int current = 0, bool editable = TRUE, bool *ok = 0, TQWidget *parent = 0, const char *name = 0);The ok is not passed and the returned value is a tuple of the TQString result and the ok flag.
void scrollBarMetrics
(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);This takes only the sb parameter and returns a tuple of the sliderMin, sliderMax, sliderLength and buttonDim values.
TQKeySequence is fully implemented including the operators ==, !=, TQString() and int(). A TQString instance or a Python integer may be used whenever a TQKeySequence can be used.
This takes the w parameter and returns a tuple containing the bool result, row and col. (TQt v2+)
This takes only the xpos parameter and returns the int result and the chr value as a tuple. (TQt v3+)
This has been renamed delChar in Python. (TQt v2+)
This takes no parameters and returns the bool result and the start and end values as a tuple. (TQt v3+)
Types based on the TQPtrList template are automatically converted to and from Python lists of the type.
This takes the index parameter and returns a tuple containing the bool result and yPos. (TQt v1.x)
TQListView is fully implemented.
Note that to remove a child TQListViewItem you must first call takeItem() and then del().
TQListViewItem is fully implemented.
Note that to remove a child TQListViewItem you must first call takeItem() and then del().
This returns a tuple of the short result and the ok value.
This returns a tuple of the ushort result and the ok value.
This returns a tuple of the int result and the ok value.
This returns a tuple of the uint result and the ok value.
This returns a tuple of the long result and the ok value.
This returns a tuple of the ulong result and the ok value.
This returns a tuple of the float result and the ok value.
This returns a tuple of the double result and the ok value.
This operator is fully implemented. (TQt v3+)
This operator is fully implemented. (TQt v3+)
This takes only the tb parameter and returns a tuple of the result, dock, index, nl and extraOffset values. (TQt v2.1.0+)
This returns a list of TQToolBar instances. (TQt v2.1.0+)
Types based on the TQMemArray template are automatically converted to and from Python lists of the type.
This takes no parameters and returns a tuple of the x and y values. (TQt v2)
void scrollBarMetrics
(const TQScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);This takes only the sb parameter and returns a tuple of the sliderMin, sliderMax, sliderLength and buttonDim values. (TQt v2)
void scrollBarMetrics
(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);This takes only the sb parameter and returns a tuple of the sliderMin, sliderMax, sliderLength and buttonDim values. (TQt v2)
This takes only the t parameter and returns a tuple of the hframe, vframe and overlap values. (TQt v2)
This takes no parameters and returns a tuple of the line and col values. (TQt v1.x, TQt v2.x)
This has been renamed delChar in Python. (TQt v1.x, TQt v2.x)
This takes no parameters and returns a tuple of the line and col values. (TQt v1.x, TQt v2.x)
This takes no parameters and returns a tuple of the bool result and the line1, col1, line2 and col2 values.
Not yet implemented.
Not yet implemented.
static bool disconnect
(const TQObject *sender, const char *signal, const TQObject *receiver, const char *member);At the moment PyTQt does not support the full behaviour of the corresponding TQt method. In particular, specifying None (ie. 0 in C++) for the signal and receiver parameters is not yet supported.
This class isn't implemented. Whenever a TQObjectList is the return type of a function or the type of an argument, a Python list of TQObject instances is used instead.
TQRect boundingRect
(int x, int y, int w, int h, int flags, const char *str, int len = -1, char **intern = 0);The intern parameter is not supported.
The intern parameter is not supported.
void drawText
(int x, int y, int w, int h, int flags, const char *str, int len = -1, TQRect *br = 0, char **intern = 0);The intern parameter is not supported.
void drawText
(const TQRect&, int flags, const char *str, int len = -1, TQRect *br = 0, char **intern = 0);The intern parameter is not supported.
This takes a single parameter which is a list of tab stops.
This returns a list of tab stops.
This takes a list of strings as its parameter.
len is derived from buf and not passed as a parameter.
Not implemented.
Types based on the TQPair template are automatically converted to and from Python tuples of two elements.
void scrollBarMetrics
(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);This takes only the sb parameter and returns a tuple of the sliderMin, sliderMax, sliderLength and buttonDim values. (TQt v2)
The Python +, +=, -, -=, unary -, *, *=, /, /=, ==, != and __nonzero__ operators are supported.
Not implemented.
Not implemented.
This takes a single parameter which is a list of points.
This takes the single parameter i and returns the x and y values as a tuple.
This takes two parameters, index and a list of points.
Not implemented.
This takes a single parameter which is a list of points.
Not implemented.
Types based on the TQPtrList template are automatically converted to and from Python lists of the type.
The Python &, &=, |, |=, ==, !=, in and __nonzero__ operators are supported.
This takes no parameters and returns a tuple containing the four values.
This takes no parameters and returns a tuple containing the four values.
Not implemented. (TQt v2+)
Not implemented. (TQt v2+)
Not implemented. (TQt v2+)
Not implemented. (TQt v2+)
The Python == and != operators are supported.
This takes str and index parameters and returns a tuple of the int result and the len value. (TQt v1.x)
This takes str and index parameters and returns a tuple of the int result and the len value. (TQt v2+)
The Python |, |=, +, +=, &, &=, -, -=, ^, ^=, ==, !=, in and __nonzero__ operators are supported.
Not implemented.
Not yet implemented. (TQt v2.2+)
This takes the x and y parameters and returns a tuple containing the vx and vy values. (TQt v2+)
This takes the vx and vy parameters and returns a tuple containing the x and y values. (TQt v2+)
TQSemaphore is fully implemented. The += and -= operators have also been implemented, but require Python v2.0 or later.
The ok is not passed and the returned value is a tuple of the bool result and the ok flag.
The ok is not passed and the returned value is a tuple of the double result and the ok flag.
The ok is not passed and the returned value is a tuple of the TQString result and the ok flag.
The ok is not passed and the returned value is a tuple of the TQStringList result and the ok flag.
The ok is not passed and the returned value is a tuple of the TQStringList result and the ok flag.
The ok is not passed and the returned value is a tuple of the int result and the ok flag.
Not implemented.
void scrollBarMetrics
(const TQScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);This takes only the sb parameter and returns a tuple of the sliderMin, sliderMax, sliderLength and buttonDim values. (TQt v2)
The Python +, +=, -, -=, *, *=, /, /=, ==, != and __nonzero__ operators are supported.
Not implemented.
Not implemented.
A Python string object (or Unicode object) can be used whenever a TQString can be used. A TQString can be converted to a Python string object using the Python str() function, and to a Python Unicode object using the Python unicode() function.
The Python +=, len, [] (for reading slices and individual characters), in and comparison operators are supported.
Not yet implemented. (TQt v2+)
Not yet implemented. (TQt v2+)
Not yet implemented. (TQt v2+)
Not yet implemented. (TQt v2.1+)
Not implemented.
This returns a tuple of the short result and the ok value.
This returns a tuple of the ushort result and the ok value.
This returns a tuple of the int result and the ok value.
This returns a tuple of the uint result and the ok value.
This returns a tuple of the long result and the ok value.
This returns a tuple of the ulong result and the ok value.
This returns a tuple of the float result and the ok value.
This returns a tuple of the double result and the ok value.
The Python len, [] (for both reading and writing slices and individual elements), del (for deleting slices and individual elements), +, +=, *, *=, ==, != and in operators are supported.
This does not return a value.
This does not return a value.
This class isn't implemented. Whenever a TQStrList is the return type of a function or the type of an argument, a Python list of strings is used instead.
This takes no parameters and returns a tuple of the x and y values. (TQt v2)
virtual void scrollBarMetrics
(const TQScrollBar *b, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);Thus takes only the b parameter and returns a tuple of the sliderMin, sliderMax, sliderLength and buttonDim values. (TQt v2)
This takes only the t parameter and returns a tuple of the hframe, vframe and overlap values. (TQt v2)
This takes the col parameter and returns a tuple containing the bool result and xPos.
This takes the row parameter and returns a tuple containing the bool result and yPos.
The returned value is a tuple of the TQCString result and the updated lenInOut.
The returned value is a tuple of the TQCString result and the updated lenInOut.
This takes only the pos parameter and returns a tuple of the value returned via the para pointer and the int result.
This has been renamed delChar in Python.
virtual bool find
(const TQString &expr, bool cs, bool wo, bool forward = TRUE, int *para = 0, int *index = 0);If the para and index parameters are omitted then the bool result is returned. If both are supplied (as integers) then a tuple of the bool result and the modified values of para and index is returned.
This takes no parameters and returns a tuple of the values returned via the para and index pointers.
This takes only the selNum parameter and returns a tuple of the paraFrom, indexFrom, paraTo and indexTo values.
Types based on the TQValueList template are automatically converted to and from Python lists of the type.
Not implemented.
Not yet implemented. (TQt v3+)
Not yet implemented.
Not yet implemented.
Not yet implemented. (TQt v3+)
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not implemented.
Not yet implemented. (TQt v3+)
Not yet implemented.
Not yet implemented.
Not implemented.
Not implemented.
This has been renamed to lowerW in Python.
This has been renamed to raiseW in Python.
This class isn't implemented. Whenever a TQWidgetList is the return type of a function or the type of an argument, a Python list of instances is used instead.
This takes no parameters and returns a tuple of the x and y values. (TQt v2)
void scrollBarMetrics
(const TQTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);This takes only the sb parameter and returns a tuple of the sliderMin, sliderMax, sliderLength and buttonDim values. (TQt v2)
This takes only the t parameter and returns a tuple of the hframe, vframe and overlap values. (TQt v2)
The Python ==, != and *= operators are supported.
This takes no parameters and returns a tuple of the TQWMatrix result and the invertible value.
This takes the x and y parameters and returns a tuple containing the tx and ty values.
This takes the x and y parameters and returns a tuple containing the tx and ty values. (TQt v1.x)
This takes the x and y parameters and returns a tuple containing the tx and ty values. (TQt v2+)
Not implemented.
Not implemented.
Not implemented.
Not implemented.
This is a utility method provided by PyTQt to make it easier to use Mark Hammond's win32com module to manipulate objects created by the tqtaxcontainer module.
The RegisterActiveObject() COM function is called to register the TQAxBase instance as a weak object with the guid GUID. The revoke handle is returned.
This is a wrapper around the RevokeActiveObject() COM function and is called to revoke the object registered using registerWeakActiveObject(). rhandle is the revoke handle returned by registerWeakActiveObject().
TQCanvas is fully implemented.
This class isn't implemented. Whenever a TQCanvasItemList is the return type of a function or the type of an argument, a Python list of TQCanvasItem instances is used instead.
The pixmaps argument is a Python list of TQPixmap instances, and the hotspots argument is a Python list of TQPoint instances. (TQt v2.2.0 - TQt v2.3.1)
The pixmaps argument is a Python list of TQPixmap instances. (TQt v3+)
This takes no parameters and returns a tuple of the values returned by the line and index pointers.
This takes no parameters and returns a tuple of the values returned by the lineFrom, indexFrom, lineTo and indexTo pointers.
TQextScintillaLexerProperties is fully implemented.
TQDns is fully implemented.
This takes a single maxlen parameter. The data is returned if there was no error, otherwise None is returned.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
This takes a single maxlen parameter. The data is returned if there was no error, otherwise None is returned.
This takes a single len parameter. The data is returned if there was no error, otherwise Py_None is returned.
This takes a single maxlen parameter. The data is returned if there was no error, otherwise Py_None is returned.
len is derived from data and not passed as a parameter.
This takes a single len parameter. The data is returned if there was no error, otherwise None is returned.
len is derived from data and not passed as a parameter.
This takes two parameters, the first of which is a list of argument strings. Arguments used by TQt are removed from the list.
This has been renamed to exec_loop in Python.
This has been renamed delRecords in Python.
This has been renamed delRecords in Python.
This has been renamed execQuery in Python.
TQSqlPropertyMap is fully implemented. However, because PyTQt does not allow new properties to be defined, it is not possible to implement custom editor widgets in Python and add them to a property map. This will simple be ignored.
This problem may be addressed in a future release of PyTQt.
Not yet implemented. (TQt v3.2.0+)
This has been renamed execQuery in Python.
This has been renamed execQuery in Python. (TQt v3.1+)
TQSqlRecordInfo is implemented as a Python list of TQSqlFieldInfo instances.
This has been renamed delRecords in Python.
This has been renamed execQuery in Python.
TQDomImplementation is fully implemented.
bool setContent
(const TQCString &buffer, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);This takes the buffer and namespaceProcessing parameters and returns a tuple containing the bool result and the errorMsg, errorLine and errorColumn values. (TQt v3+)
bool setContent
(const TQByteArray &buffer, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);This takes the buffer and namespaceProcessing parameters and returns a tuple containing the bool result and the errorMsg, errorLine and errorColumn values. (TQt v3+)
bool setContent
(const TQString &text, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);This takes the text and namespaceProcessing parameters and returns a tuple containing the bool result and the errorMsg, errorLine and errorColumn values. (TQt v3+)
bool setContent
(const TQIODevice *dev, bool namespaceProcessing, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);This takes the dev and namespaceProcessing parameters and returns a tuple containing the bool result and the errorMsg, errorLine and errorColumn values. (TQt v3+)
bool setContent
(const TQCString &buffer, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);This takes the buffer parameter only and returns a tuple containing the bool result and the errorMsg, errorLine and errorColumn values. (TQt v3+)
bool setContent
(const TQByteArray &buffer, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);This takes the buffer parameter only and returns a tuple containing the bool result and the errorMsg, errorLine and errorColumn values. (TQt v3+)
bool setContent
(const TQString &text, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);This takes the text parameter only and returns a tuple containing the bool result and the errorMsg, errorLine and errorColumn values. (TQt v3+)
bool setContent
(const TQIODevice *dev, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);This takes the dev parameter only and returns a tuple containing the bool result and the errorMsg, errorLine and errorColumn values. (TQt v3+)
bool setContent
(TQXmlInputSource *source, TQXmlReader *reader, TQString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);Not yet implemented. (TQt v3.2.0+)