A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mevislab.github.io/pythonqt/Examples.html below:

PythonQt: Examples

Examples are available in the examples directory. The PyScriptingConsole implements a simple interactive scripting console that shows how to script a simple application. The PyLauncher application can be used to run arbitrary PythonQt scripts given on the commandline.

The following shows a simple example on how to integrate PythonQt into your Qt application:

#include <QApplication>

...

{

context

.evalScript(

"print example"

);

context

.evalScript(

"def multiply(a,b):\n return a*b;\n"

);

args << 42 << 47;

...

PyObject * PythonQtConvertPairToPython(const void *inPair, int metaTypeId)

a smart pointer that stores a PyObject pointer and that handles reference counting automatically

void addObject(const QString &name, QObject *object)

add the given object to the module as a variable with name (it can be removed via clearVariable)

static void init(int flags=IgnoreSiteModule|RedirectStdOut, const QByteArray &pythonQtModuleName=QByteArray())

PythonQtObjectPtr getMainModule()

get the main module of python

static PythonQt * self()

get the singleton instance


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4