Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Launch Qt uic

I have installed Qt designer 4.8.2, Pyside, and Python 3.3. When I create a form with Qt designer I am not able to see the code when clicking on view code. The error message is:"Unable to launch C:\Qt\4.8.2\bin\uic". I have the pyuic under C:\Python33\Lib\site-packages\PyQt4\uic. Please help.

like image 398
user1890223 Avatar asked Dec 09 '12 22:12

user1890223


3 Answers

Just create a directory where it search for uic.exe file and copy existing uic.exe file to that directory.

My example : When I clicked View Code it shows Error asking for file uic.exe in path C:\python374\Lib\site-packages\pyqt5_tools\Qt\bin\bin

But I found uicexe file is in C:\python374\Lib\site-packages\pyqt5_tools\Qt\bin folder So I created another bin folder and copied uic.exe into that folder . That solved my problem.

like image 55
Ram Avatar answered Nov 12 '22 23:11

Ram


Create a folder called bin inside the folder and move the exe inside uic.exe. It shows the code when click the view code from the QT designer.

enter image description here

like image 31
Rajesh Kumar Vimalamurthy Avatar answered Nov 13 '22 00:11

Rajesh Kumar Vimalamurthy


Although you can certainly use Qt Designer for creating UIs for PySide/PyQt, you should be aware that it is primarily a C++ tool - it doesn't have any built in support for Python. So the "View Code..." command you refer to only produces C++ code - which is probably not much use to you if you intend using PySide or PyQt.

Qt Designer UI files are in an XML format (they usually have a .ui extension).

To use them with Python, there are basically two options:

  1. Load the .ui files directly into your application.
  2. Convert the .ui files into Python modules using an external tool.

There are several differences between PySide and PyQt in how these two options are implemented.

For PyQt, the full documention for both options can be found here.

For PySide, the documentation for option 1 can be found here - but it does not look like there is any documentation for option 2. However, the external tool for PySide (which is called pyside-uic) works very similarly to the one for PyQt (which is called called pyuic4).

If you need more general information about how to get started using Qt with Python, try the PySide Wiki or the PyQt Wiki.

like image 20
ekhumoro Avatar answered Nov 12 '22 22:11

ekhumoro