I have installed qt (the open source version) and would like to code with python 3 in it. I write a code, however, I cannot compile it because the "build" tab and button are not active (they are grey). What can the problem be, and what should I do?
Short answer: Qt Creator is not designed for working with Python
Longer answer: The purpose of Qt Creator is really for using Qt in C++. Many of the features of the IDE revolve around that and will be unavailable if you aren't working with a Qt C++ project. This is why a "Build" menu exists: the commands there are for running the Qt and C++ compilers. Note that Python (a scripting language) does not require compilation, so it wouldn't make sense to attempt to compile your code anyway.
It might be that you're using Qt Creator because you're making use of one or more of the Qt modules that exist in Python (e.g. PyQt, PySide). These modules have been created as "bindings" to the Qt application framework allowing you to (for example) create Qt-style GUI applications in Python, but they have no requirement for you to use the Qt Creator IDE.
Alternatives: While Qt Creator is fine as a general code editor, in general I would recommend using another IDE for writing Python, such as Visual Studio Code (more flexible) or PyCharm (specifically for Python). If you want to stick with Qt Creator you can configure it to allow you to run your Python like this.
Finally, it's worth pointing out that it's possible to use the Qt Creator UI designer and then export the created files into a Python Qt application. See this question and its responses for more info.
I want to learn to use qt designer and i want to know what to install, because I've had some issues with python versions and distributions. This is my first time doing this I know basically nothing about python or QT. I appreciate your help
Qt Designer is just a quick way to visually define the GUI. You can then load the .ui files created there in you python application or convert them to python code: Convert pyQt UI to python. But I would rather recommend you to write the code from scratch by yourself. This way you can better understand how the things are actually work.
Qt is a C++ framework, if you want to use it with python you have to pick a python binding first. You basically have two choices here: PyQt and PySide. PyQt is proprietary software developed by Riverbank Computing Limited. PySide is open source software and nowadays the official Qt binding for python.
Similar to python with its major versions 2 and 3, Qt has two major versions Qt4 and Qt5 that are widely used. PyQt4 and PySide are Qt4 bindings, PyQt5 and PySide2 are Qt5 bindings.
So if you have no specific requirements regarding the version you should use, just install the latest version of Python, install PySide2 using pip and enjoy studying GUI programming with Python and Qt!
I have to choose PySide due to the license. But its Shiboken tool is so lack of documentations. I can't successfuly generate a binding for my Qt C++ libraries.
Looks like SIP is more mature at least on the documentation part. Is it possible for me to generate the binding using SIP, then run my python code on PySide to call the binding? My users environment would be Windows XP + Python 2.7 + PySide 1.1.2 (Window installer based, installed to C:\Python27\Lib\site-packages\PySide).
Why can't I use other Qt series with different Python releases?
You can. If you have a specific version of Qt you would like to use, you can either download a matching PyQt version from Riverbank's download site or you can compile your own version of PyQt. I've had to build them from scratch a few times when the provided binaries didn't match the Qt/Python versions I wanted to use. It's a bit of a hassle to compile but it's definitely possible.
Also, note that the up-and-coming PySide library is an alternative Qt binding for Python that looks like it has a good chance of supplanting PyQt (due to looser licensing constraints).
Generally speaking, Qt Designer is an optional and independent component from PyQt. You can use it to create your .ui files but after that, it's up to the developer to determine how to use them... either generate Python code from them with pyuic4 or load them dynamically. As long as the format of the resulting .ui files are compatible with your version of PyQt, it shouldn't matter which Designer version you're using (though I would strongly recommend you use the version matching the Qt version PyQt is linked against).
When you write an application using Qt, can it just be run right away in different operating systems? And (correct me if I'm wrong) you don't need to have Qt already installed in all of the different platforms where you want to execute your application?
How exactly does this work? Does Qt compile to the desired platform, or does it bundle some "dlls" (libs), or how does it do it? Is it different from programming a Java application, that runs cross-platform.
If you use Python to write a Qt application with Python bindings, does your end user need to have Python installed?
Qt (ideally) provides source compatibility, not binary compatibility. You still have to compile the application separately for each platform, and use the appropriate dynamic Qt libraries (which also need to be compiled separately, and have some platform-specific code).
For your final question, the user would need Python, the Qt libraries, and the binding library (e.g. pyqt), but there are various ways to bundle these.
PyQT [and its open source cousin PySide] are a great cross-platform QT binding for python, but it is not a magic solution for shipping your application for all platforms without doing any packaging/installer maintenance. I think maybe you might be expecting some magic.
QT is a cross-platform library written in C++. That means, you can write your C++ or Python (or other language with bindings) code once, and create a "window" (a form, a dialog box, something on the screen) and populate it with controls (buttons, and all that) and not have to deal with the platform differences in how buttons are made in Windows, Linux, and on Mac OS X.
Because it is a library, it can be packaged in multiple ways. It can be "statically linked" (built into your executable/binary/app) or "dynamically linked" (known as a DLL in windows, a shared library or on unix/linux or as a framework, in mac os x). It is not always "installed" on a computer, unless it is a shared library.
Even when it is "installed" onto a computer, multiple versions might exist on that computer, and so it is not proper to think of it as being an extension to your computer, but rather an extension to an application (a program) on your computer.
If you use Python bindings for QT, then your installation package for your application needs to include the QT binding's binary files (python extensions), the basic Python runtime environment including the Python executable and basic libraries, and your program's source code. It is possible to package most of this up into a single "bundle". On Mac OS X, for instance, all this can easily be put into a an ".app" bundle, and on Windows, and Linux, I believe there are packaging and installation tools that can help you do this easily.
Even though you will only need to write the user interface code for your application once, you will not magically get the ability to ship an application on all three primary platforms at once, without doing at least the building of the installer or packaging, separately for each platform. Users expect to download a setup/install package for Windows or Mac OS X, and perhaps for Unix/Linux it depends further on which distribution you install.
Update thanks to AdamW for this nokia link providing deployment information
The problem is your definition of "installed". For Qt to work, the executable just has to have access to the proper libraries.
Of course that for each platform a different executable and libraries have to be produced (see Qt docs).
About Python, if you are to run a Python executable you have to have it installed (in a more traditional kind of way). Unless you are running with py2exe in Windows, for instance.