Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm 4 wont open Qt Designer on double click of .ui file. (Linux)

PyCharm and Qt Designer are both installed and running. PyCharm shows .ui files as Qt designer files, but nothing happens when I click on them, or double click on them. In order to edit them, I have to right click --> show in open folder with Thunar [I'm on Xfce] and then double click the file from the file manager which will open it in Qt Designer.

I dont see any options in the settings for changing this behavior. Any ideas on how to make Qt Designer get launched from PyCharm?

like image 304
Frac Avatar asked Dec 21 '14 16:12

Frac


People also ask

How do I create a GUI in PyCharm using Qt Designer?

In the QT Designer interface, a GUI creation interface will pop up for the first time, click on create to automatically generate a GUI interface. Save the interface as Untitled.ui file. Back to the PyCharm project interface, there is an extra .ui file under the project list.

How do I open a PyCharm project in a separate window?

Opening files in a separate window. To open a file in a separate PyCharm window. Do one of the following: Drag and drop an editor tab outside of the current PyCharm window. Press Shift+F4 for a file selected in the Project tool window. Shift+mouse double click on a file name in the Project tool window.

How to install PyQt5 in PyCharm?

Stay in the Project Interpreter interface, click on the +, find and install pyqt5. pyqt5-sip, pyqt5-tools. After successful installation, the interface should look like this. You can start designer directly from PyCharm. Make sure designer is installed first.

Why does PyCharm open files opened in associated applications instead of editor?

If the file type is registered under the category Files opened in associated applications, it will be opened in its associated application, rather than in the PyCharm editor. By default, PyCharm suggests a number of such file types, for example .doc, .chm, or .pdf.


1 Answers

There is no off-the-shelf solution as PyCharm does not seem to be aware of the extension type in question (.ui), but I guess using the Register New File Type Association Dialog would suffice as a workaround:

  • Open matching files in PyCharm

When this option is selected, PyCharm treats the type of the file to be opened as one of the recognized file types. Choose the relevant type from the list box below, that displays all the file types recognized by PyCharm.

  • File Pattern

In this text box, specify the file pattern to be associated with the selected file type. By default, the text box shows the following pattern: *.<current file full extension>.

  • Open matching files in associated application

When this option is selected, PyCharm attempts to open the selected file using its native application, if this application is available.

You could also look into this documention if you wish, but admittedly, editing ui files with an xml editor, while it is possible, is not ideal!

To associate a file type with extensions

  • Open the File Types settings page.
  • From the Recognized File Types list, select the desired type.
  • In the Registered Patterns area, complete the list of patterns that define the file > extensions to indicate that the corresponding files belong to the selected type. Do one of the following:
  • To register a new pattern, click add (Alt+Insert) and enter the desired extension pattern in the Add Wildcard dialog box that opens.
  • To update a pattern, select it in the list, click the Edit button edit1 and make the necessary changes in the Edit Wildcard dialog box that opens.
  • To remove a pattern from the list, select it and click delete (Alt+Delete).

Therefore, you could basically associate the *.ui pattern with XML as UI files are implemented as XML for better or worse.

like image 90
lpapp Avatar answered Oct 11 '22 20:10

lpapp