2

i installed Qt designer 4, created a small windows with buttons, now when i click view code...

i get the message

unable to lunch C:Python27/Lib/site-packages/PyQt4\uic.

i check the folder and i dont see any uic files, i have a uic folder with bunch of python files, want to be able to see the code thats is been generated, yes, i understand that will be in C++ and thats what i want to see. UIC is not installed? should i have c compiler? should i download it from somewhere else?

should i never use qt designer any more and just go for qt creator?

thanks guys.

pelos
  • 1,744
  • 4
  • 24
  • 34
  • The PyQt binary package for Windows does not install the full set of [Qt command-line tools](http://doc.qt.io/qt-4.8/qttools.html). Specifically, `uic.exe` is not included, which is why you are seeing that error message. – ekhumoro Jul 03 '16 at 16:11
  • k, i installed qt5 with qt creator and i do see now the uic.exe file, i copy paste it to the python27>libs>site-packages>PyQt4 and also to the UIC folder, i still have the same error =( can i change the path in qt designer to use the UIC path of qt creator? thanks =) – pelos Jul 06 '16 at 01:44

3 Answers3

2

I ran into a similar issue using Qt Designer and found this video.

In my case, the error was:

"Unable to launch C:\Program Files (x86)\Qt Designer\bin\uic".

It turns out my uic file was in the directory

"C:\Program Files (x86)\Qt Designer"

To solve my case, I had to create the "bin" folder and move the uic file to it. Then I could use "form > view code".

yudhiesh
  • 6,383
  • 3
  • 16
  • 49
rawrafied
  • 21
  • 2
0

I don't know what you mean with "when I click view code". So I'm answering two questions.

How do I preview the window in Qt Designer? Eiter press "Ctrl+R" or in the menu bar navigate to "Form -> Preview..."

How do I use the ui file within a python script? You need to compile your ui file to a python file. It is explained here.

If none of these answers your question you should try to specify your problem.

Community
  • 1
  • 1
  • when i click in the menu bar at the top form > view code i get the error message, i dont want the error i want the windows that show the windows with the code in c++ – pelos Jul 03 '16 at 08:10
0

Following some suggestions online, I found the "uic.exe" file in the bin directory as below: C:\ProgramData\Anaconda3\envs{environment_name}\Lib\site-packages\pyqt5_tools\Qt\bin

and then created a new directory there called "bin" and moved the uic.exe file into it.

enter image description here

And then it worked!

enter image description here

Jumanazar Said
  • 101
  • 1
  • 4
  • 9