如何安装 PyQt 演示和 Qt 工具的 Qt 文档
我使用 python 2.6 在 Windows 7 上安装了 PyQt,当尝试执行演示时,我收到以下警告:
经过一番研究,我可以获得一份 .qch 格式的 Qt4 文档副本,该文档可与 Qt Assistant 一起使用。
必须如何安装文档才能在 PyQt4 演示中获取它并消除警告?
我与 Qt Assistant 一起使用的 qt.qch 文档对此有效吗?或者有一个用于演示的特定文档。如果有的话从哪里可以下载?
我已经在网上搜索了一段时间,发现其他人也在问同样或类似的问题,但对我来说没有有用的答案。
I installed PyQt on windows 7 with python 2.6 and when trying to execute the demo I got the following warning:
After some research I could obtain a copy of the Qt4 documentation in .qch format that works with Qt Assistant.
How documentation has to be installed in order to get it on the PyQt4 demo and eliminate the warning?
Is the qt.qch documentation I am using with Qt Assistant valid for this or there is a specific document for the demo. If yes, where can it be downloaded from?
I have been searching the net for some time and found other people asking the same or similar questions, also in SO, but with no useful answer for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
.qch 文件必须位于 pyqt 文档文件夹中,演示才能正常工作。如果您在安装 python 和 pyqt 时接受默认路径,则可能是 C:\Python27\Lib\site-packages\PyQt4\doc。
在移动 .qch 文件之前,请打开 Qt Assistant 并删除之前添加的文档。然后关闭Qt Assistant并将所有.qch文件移动到pyqt doc文件夹中的
qch
文件夹中:例如C:\Python27\Lib\site-packages\PyQt4\doc\qch
代码>.所需的 .qch 文件为qt.qch
、designer.qch
和linguist.qch
。当您重新打开 Qt Assistant 时,它应该会自动找到所有文档并开始重新索引。完成后,关闭 Qt Assistant 并打开 PyQt 演示。
有几个重要的事情需要注意:首先,即使文档已正确安装,警告消息框也始终会出现在 Windows 上(这确实是一个错误 - 启动脚本可以轻松地进行必要的检查)。其次,并非所有演示都有描述,因此您仍然会看到警告
无法加载描述。确保在许多地方(例如 Demonstrations\Minehunt)构建了 Qt 文档
。但是,如果您已正确安装,则“对话框”部分中的所有演示都应具有说明和屏幕截图等。The .qch files have to be in the pyqt documentation folder for the demos to work correctly. If you accepted the default paths when you installed python and pyqt, this will probably be
C:\Python27\Lib\site-packages\PyQt4\doc
.Before you move the .qch files, open up Qt Assistant and remove the documentation you added previously. Then close Qt Assistant and move all the .qch files into a
qch
folder in the pyqt doc folder: e.g.C:\Python27\Lib\site-packages\PyQt4\doc\qch
. The required .qch files areqt.qch
,designer.qch
andlinguist.qch
.When you re-open Qt Assistant it should automatically find all the documentation and start re-indexing it. After that finishes, close down Qt Assistant and open up the PyQt demos.
There are a couple of important things to note: firstly, the warning message box will always appear on Windows even if the documentation has been installed correctly (which is really a bug - the startup script could easily make the necessary checks). Secondly, not all of the demos have descriptions, so you will still see the warning
Could not load description. Ensure that the documentation for Qt is built
in many places (e.g. Demonstrations\Minehunt). However, if you've installed things correctly, all the demos in the Dialogs section should have both descriptions and screenshots, for instance.不幸的是,下载网站 http://download.qt.io/archive/qt 不似乎有 .qct 格式的文档。 .tar.gz 和 .zip 格式的下载包含 QT 软件的安装程序,但下载文件中的 doc 文件夹仅包含 .html 格式的文档。这与 PyQt 安装中的 doc 文件夹的格式相同。 Qt Assistant 无法读取 .html 格式。 PyQt 安装还在 doc 文件夹中包含一个名为 sphinx 的子文件夹,其中包含 .rst 文件,Qt Assistant 也无法读取这些文件
Unfortunately, the download site http://download.qt.io/archive/qt does NOT appear to have the documentation in .qct format. The downloads in .tar.gz and .zip format contain installers for the QT software, but the doc folder in the download files only contains documentation in .html format. This is the same format as the doc folder in the PyQt installation. The .html format is not readable by Qt Assistant. The PyQt installation also contains a subfolder in the doc folder called sphinx, which contains .rst files, which are also not readable by Qt Assistant