GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing mevislab.github.io — PythonQt: PythonQt Class Reference
PythonQt Class Reference The main interface to the Python Qt binding, realized as a singleton. More...
Inheritance diagram for PythonQt:
Detailed DescriptionThe main interface to the Python Qt binding, realized as a singleton. Use PythonQt::init() to initialize the singleton and PythonQt::self() to access it. While there can be only one PythonQt instance, you can have any number of Python context to do scripting in. One possibility is to use createModuleFromFile(), createModuleFromScript() or createUniqueModule() to get a context that is separated from the other contexts. Alternatively you can use Python dicts as contexts for script evaluation, but you will need to populate the dict with the builtins instance to have all Pythons available when running code in the scope of a dict. Definition at line 178 of file PythonQt.h. Member Typedef Documentation◆ ProfilingCB
callback for profiling. className and methodName are only passed when state == Enter, otherwise they are NULL. Definition at line 234 of file PythonQt.h. Member Enumeration Documentation◆ InitFlags
flags that can be passed to PythonQt::init()
Definition at line 186 of file PythonQt.h. 186 {
187 RedirectStdOut = 1,
188 IgnoreSiteModule = 2,
189 ExternalHelp = 4,
190 PythonAlreadyInitialized = 8
191 };
@ RedirectStdOut < sets if the std out/err is redirected to pythonStdOut() and pythonStdErr() signals Definition PythonQt.h:187 @ PythonAlreadyInitialized < sets that PythonQt should not can PyInitialize, since it is already done Definition PythonQt.h:190 @ ExternalHelp < sets if help() calls on PythonQt modules are forwarded to the pythonHelpRequest() signal Definition PythonQt.h:189 ◆ ObjectType
defines the object types for introspection
Definition at line 254 of file PythonQt.h. ◆ ProfilingCallbackState◆ TypeSlots
flags that tell PythonQt which operators to expect on the registered type
Definition at line 194 of file PythonQt.h. 194 {
195 Type_Add = 1,
196 Type_Subtract = 1 << 1,
197 Type_Multiply = 1 << 2,
198 Type_Divide = 1 << 3,
199 Type_Mod = 1 << 4,
200 Type_And = 1 << 5,
201 Type_Or = 1 << 6,
202 Type_Xor = 1 << 7,
203 Type_LShift = 1 << 8,
204 Type_RShift = 1 << 9,
205
206 Type_InplaceAdd = 1 << 10,
207 Type_InplaceSubtract = 1 << 11,
208 Type_InplaceMultiply = 1 << 12,
209 Type_InplaceDivide = 1 << 13,
210 Type_InplaceMod = 1 << 14,
211 Type_InplaceAnd = 1 << 15,
212 Type_InplaceOr = 1 << 16,
213 Type_InplaceXor = 1 << 17,
214 Type_InplaceLShift = 1 << 18,
215 Type_InplaceRShift = 1 << 19,
216
217 Type_Length = 1 << 20,
218 Type_MappingSetItem = 1 << 21,
219 Type_MappingGetItem = 1 << 22,
220
221 Type_EnterExit = 1 << 23,
222
223 Type_Invert = 1 << 29,
224 Type_RichCompare = 1 << 30,
225 Type_NonZero = 1 << 31,
226
227 };
Member Function Documentation◆ addClassDecorators()
add an object whose slots will be used as decorator slots for class objects (ownership is passed to PythonQt) The slots need to follow the following convention:
This will add:
◆ addDecorators()
this will add the object both as class and instance decorator (ownership is passed to PythonQt) ◆ addInstanceDecorators()
add an object whose slots will be used as decorator slots for other QObjects or CPP classes. The slots need to follow the convention that the first argument is a pointer to the wrapped object. (ownership is passed to PythonQt) Example: A slot with the signature bool doSomething(QWidget* w, int a)
will extend QWidget instances (and derived classes) with a "bool doSomething(int a)" slot that will be called with the concrete instance as first argument. So in Python you can now e.g. call someWidget.doSomething(12)
without QWidget really having this method. This allows to easily make normal methods of Qt classes callable by forwarding them with such decorator slots or to make CPP classes (which are not derived from QObject) callable from Python. ◆ addObject()
add the given ◆ addParentClass()
add a parent class relation to the ◆ addPolymorphicHandler()
add a handler for polymorphic downcasting ◆ addSignalHandler() [1/2]
add a signal handler to the given ◆ addSignalHandler() [2/2]
add a signal handler to the given ◆ addSysPath()
prepend a path to sys.path to allow importing from it ◆ addVariable()
add the given variable to the object ◆ addWrapperFactory() [1/2]
add the given factory to PythonQt (ownership stays with caller) ◆ addWrapperFactory() [2/2]
add the given factory to PythonQt (ownership stays with caller) ◆ call() [1/2]
call the given python object, returns the result converted to a QVariant ◆ call() [2/2]
call the given python ◆ callAndReturnPyObject()
call the given python object, returns the result as new PyObject ◆ cleanup()
cleanup of the singleton ◆ clearError()
reset error flag. After calling this, hadError() will return false.
◆ clearNotFoundCachedMembers()
clear all NotFound entries on all class infos, to ensure that newly loaded wrappers can add methods even when the object was wrapped by PythonQt before the wrapper was loaded ◆ createModuleFromFile()
creates the new module ◆ createModuleFromScript()
creates the new module ◆ createUniqueModule()
create a uniquely named module, you can use evalFile or evalScript to populate the module with script code ◆ evalCode()evaluates the given code and returns the result value (use Py_Compile etc. to create pycode from string) If pycode is NULL, a python error is printed. ◆ evalFile()
evaluates the given script code from file ◆ evalScript() [1/2]
evaluates the given script code in context of given globals and locals and returns the result value ◆ evalScript() [2/2]
evaluates the given script code and returns the result value ◆ getImporterIgnorePaths()
get paths that the importer should ignore ◆ getMainModule()
get the main module of python ◆ getNativeVariable()
get the variable with the ◆ getReturnTypeOfWrappedMethod() [1/2]
returns the return type of the method ◆ getReturnTypeOfWrappedMethod() [2/2]
returns the return type of the method of a wrapped c++ object referenced by ◆ getVariable()
get the variable with the ◆ hadError()
return true if handleError() has been called and an error occurred. ◆ handleError()
handle a python error, call this when a python function fails. If no error occurred, it returns false. The error is currently just output to the python stderr, future version might implement better trace printing ◆ helpCalled()
called by internal help methods ◆ importInterface()
get access to the file importer (if set) Referenced by setImporter(). ◆ importModule()
import the given module and return a reference to it (useful to import e.g. "sys" and call something on it) If a module is already imported, this returns the already imported module. ◆ init()
initialize the python qt binding (flags are a or combination of PythonQt::InitFlags), if References IgnoreSiteModule, and RedirectStdOut. ◆ installDefaultImporter()
this installs the default QFile importer (which effectively does a setImporter(NULL)) (without calling setImporter or installDefaultImporter at least once, the default python import mechanism is in place) the default importer allows to import files from anywhere QFile can read from, including the Qt resource system using ":". Keep in mind that you need to extend "sys.path" with ":" to be able to import from the Qt resources. Definition at line 554 of file PythonQt.h. void setImporter(PythonQtImportFileInterface *importInterface) References setImporter(). ◆ introspection()
read vars etc. in scope of an ◆ introspectObject()
read vars etc. in scope of the given ◆ introspectType()
read vars etc. in scope of the type object called ◆ lookupCallable()
returns the found callable object or NULL
◆ lookupObject()
returns the found object or NULL
◆ overwriteSysPath()
overwrite the python sys path (call this directly after PythonQt::init() if you want to change the std python sys path) ◆ parseFile()
parses the given file (using PythonQt's own import mechanism) and returns the python code object, this can then be used to call evalCode() ◆ parseFileWithPythonLoaders()
Parses the given file and returns the python code object, this can then be used to call evalCode() It uses Python's importlib machinery to load the file's code and supports source and sourceless loading and generation of cache files. ◆ priv()
get access to internal data (should not be used on the public API, but is used by some C functions) Definition at line 572 of file PythonQt.h. 572{ return _self ? _self->_p : nullptr; }
Referenced by PythonQtConvertListOfKnownClassToPythonList(), and PythonQtConvertPythonListToListOfKnownClass(). ◆ pythonHelpRequest
emitted when help() is called on a PythonQt object and ◆ pythonStdErr
emitted when python outputs something to stderr (and redirection is turned on) ◆ pythonStdOut
emitted when python outputs something to stdout (and redirection is turned on) ◆ qObjectMissingAttributeCallback()
call the callback if it is set ◆ qObjectNoLongerWrappedCB()
call the callback if it is set ◆ redirectStdOutCallbackEnabled()
return true if std out/err redirection is enabled. ◆ registerClass()
registers a QObject derived class to PythonQt (this is implicitly called by addObject as well) ◆ registerCPPClass()
add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants (ownership of wrapper is passed to PythonQt) Make sure that you have done a qRegisterMetaType first, if typeName is a user type! This will add a wrapper object that is used to make calls to the given classname ◆ registerQObjectClassNames()
as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes and it will register the classes when it first sees a pointer to such a derived class ◆ removeSignalHandler() [1/2]
remove a signal handler from the given ◆ removeSignalHandler() [2/2]
remove a signal handler from the given ◆ removeSignalHandlers()
globally removes all signal handlers (connections between QObjects and Python). ◆ removeVariable()
remove the given variable ◆ removeWrapperFactory() [1/2]
remove the wrapper factory ◆ removeWrapperFactory() [2/2]
remove the wrapper factory ◆ self()
get the singleton instance ◆ setEnableThreadSupport()
Enable GIL and thread state handling (turned off by default). If you want to use Python threading, you have to call this with true early in your main thread, before you launch any threads in Python. It can be called before or after PythonQt::init(). ◆ setImporter()
replace the internal import implementation and use the supplied interface to load files (both py and pyc files) (this method should be called directly after initialization of init() and before calling overwriteSysPath(). On the first call to this method, it will install a generic PythonQt importer in Pythons "path_hooks". This is not reversible, so even setting setImporter(NULL) afterwards will keep the custom PythonQt importer with a QFile default import interface. Subsequent python import calls will make use of the passed importInterface which forwards all import calls to the given References importInterface(). Referenced by installDefaultImporter(). ◆ setImporterIgnorePaths()
set paths that the importer should ignore ◆ setModuleImportPath()
sets the path list of a module to the given list (important for local imports) ◆ setProfilingCallback()
sets a callback that is called before and after function calls for profiling ◆ setQObjectMissingAttributeCallback()
set a callback that is called when a QObject does not have a specific attribute. ◆ setQObjectNoLongerWrappedCallback()
set a callback that is called when a QObject with parent == NULL is no longer wrapped by PythonQt ◆ setQObjectWrappedCallback()
set a callback that is called when a QObject with parent == NULL is wrapped by PythonQt ◆ setRedirectStdInCallback()
Overwrite default handling of stdin using a custom callback. It internally backup the original 'sys.stdin' into 'sys.pythonqt_original_stdin' ◆ setRedirectStdInCallbackEnabled()
Enable or disable stdin custom callback. It resets 'sys.stdin' using either 'sys.pythonqt_stdin' or 'sys.pythonqt_original_stdin' ◆ setRedirectStdOutCallbackEnabled()
enable or disable std out/err redirection to pythonStdOut() and pythonStdErr() signals. ◆ setSystemExitExceptionHandlerEnabled()
if set to true, the systemExitExceptionRaised signal will be emitted if exception SystemExit is caught
◆ systemExitExceptionHandlerEnabled()
return true if SystemExit exception is handled by PythonQt ◆ systemExitExceptionRaised
emitted when both custom SystemExit exception handler is enabled and a SystemExit exception is raised. The documentation for this class was generated from the following file: Generated on for PythonQt by | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||