xml - PyCharm 4 不会在双击 .ui 文件时打开 Qt Designer。 (Linux)

标签 xml linux qt pycharm qt-designer

PyCharm 和 Qt Designer 都已安装并正在运行。 PyCharm 将 .ui 文件显示为 Qt 设计器文件,但当我单击它们或双击它们时没有任何反应。为了编辑它们,我必须右键单击 --> show in open folder with Thunar [我在 Xfce 上],然后双击文件管理器中的文件,这将在 Qt Designer 中打开它。

我在设置中看不到任何更改此行为的选项。关于如何使 Qt Designer 从 PyCharm 启动的任何想法?

最佳答案

没有现成的解决方案,因为 PyCharm 似乎不知道有问题的扩展类型 ( .ui ),但我想使用 Register New File Type Association Dialog作为解决方法就足够了:

  • 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.

您还可以查看 this documention如果您愿意,但不可否认,使用 xml 编辑器编辑 ui 文件虽然可行,但并不理想!

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).

因此,您基本上可以关联 *.ui XML 模式,因为无论好坏,UI 文件都作为 XML 实现。

关于xml - PyCharm 4 不会在双击 .ui 文件时打开 Qt Designer。 (Linux),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27591207/

相关文章:

qt - 部署 Qt 共享库时替换 RPATH

c++ - QML 中的设置值保存在哪里?

c# - 将 XML 提要读入 XElement

java - 需要有关将元素属性转换为元素的 xslt 逻辑的帮助

php - 将大量数据从 XML 存储到 MYSQL 数据库以获取 PDF

linux - 期待 bash 脚本中的命令

linux - 在 shell 脚本中传递 N 个参数

linux - 使用网络开发语言与系统命令交互

c++ - 我如何在 QML 中设置样式表?(只有 QML 没有 C++)

java - 为什么我不能删除我创建的 XML 文件?