6

I have a QT 4.6 application (C++ language) and i need to add python scripting to it on windows platform. Unfortunately, i never embed python before, and it seems to be a lot of different ways to do so. Can anyone share his wisdom and point me into some articles/documentation i can read to perform a specified task in less painful way?

grigoryvp
  • 40,413
  • 64
  • 174
  • 277
  • If you're properly abstracting your design, the QTness shouldn't be relevant. Might help simplify your problem with one less thing to think about. :) – Cogwheel Dec 15 '09 at 16:30
  • Yes, i know, but i'm mentioning QT so if it's some good articles exists that are QT-specific, or some binding available, i can use it instead of pure abstract way ^_^ – grigoryvp Dec 15 '09 at 17:23

2 Answers2

7

You should take a look at PythonQt. From the homepage:

PythonQt is a dynamic Python binding for Qt. It offers an easy way to embed the Python scripting language into your Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt4.x. In contrast to PyQt , PythonQt is not a complete Python wrapper around the complete Qt functionality. So if you are looking for a way to write complete applications in Python using the Qt GUI, you should use PyQt.

If you are looking for a simple way to embed Python objects into your C++/Qt Application and to script parts of your application via Python, PythonQt is the way to go!

Build/installation instructions for Windows is near the bottom of the page.

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
Barry Wark
  • 107,306
  • 24
  • 181
  • 206
  • Where is a windows installer? I can only see sources? – grigoryvp Dec 15 '09 at 19:27
  • Sorry. There is no windows installer, as I'd remembered. You can install Python from the python.org installer, but you need VS to build PythonQt; I updated my answer. – Barry Wark Dec 15 '09 at 21:47
6

Edit:

You can use PythonQt (not PyQt) that allow you to use Python with Qt. I think this is what you are searching for.

Here a documentation on the official website: http://doc.qt.digia.com/qq/qq23-pythonqt.html.

mavroprovato
  • 8,023
  • 5
  • 37
  • 52
Patrice Bernassola
  • 14,136
  • 6
  • 46
  • 59
  • PyQt and PythonQt are two very different projects. PyQt lets you write Qt apps in Python. PythonQt lets you embed a Python interpreter inside a C++ Qt app. – Barry Wark Dec 15 '09 at 16:52