10

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?

László Papp
  • 51,870
  • 39
  • 111
  • 135
Frac
  • 321
  • 5
  • 13

1 Answers1

6

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.

Community
  • 1
  • 1
László Papp
  • 51,870
  • 39
  • 111
  • 135
  • Yeah there is no off the shelf solution. I think I will just stick with the option to "show in open folder" and then open Qt Designer from there. – Frac Dec 21 '14 at 22:40