Den*_*kva 12 python macos qt pyqt anaconda
你能帮我找到Mac上的Qt设计器应用吗?我安装了anaconda包,conda报告安装了qt,sip和pyqt.我仍然无法在任何文件夹中找到设计器应用程序.我使用pyqt的python应用程序完美运行.我对mac很新,可能会遗漏一些非常简单的东西.我在搜索文件夹树时搜索了名为designer的内容.我在/Users/XXXX/anaconda/pkgs/pyqt-4.10.4-py27_0/lib/python2.7/site-packages/PyQt4找到了QtDesigner.so(应该是可执行文件?),但它甚至不会说"不能执行二进制文件"anaconda/bin没有它有一个文件夹anaconda/include/QtDesigner但注意到我可以运行/anaconda/pkgs/qt-4.8.5-3/bin - 没有设计师我现在完全糊涂了.
ken*_*ken 13
您可以尝试open -a Designer
从终端启动Anaconda(版本4.x)附带的Qt Designer.
如果您有Qt5.x,则可能需要启动较新版本的Designer open -a Designer-qt5
.
OSX Yosemite 10.10.5
Qt 5.6
QtCreator 3.6.1
QtDesigner 是我的 QtCreator 的一部分。使用 QtDesigner:
启动 QtCreator,然后从菜单栏(在 QtCreator 外)单击:
File>New File or Project
您将看到一个New File or Project
对话窗口。在该Files And Classes
部分中,选择Qt
。在中间窗格中,选择QtDesigner Form
。然后点击Choose
右下角的按钮。
您将看到一个QtDesigner Form
对话窗口。然后可以选择Main Window
或Dialog with Buttons Bottom
等,然后点击Continue
右下角的按钮。
在Location
对话窗口中,使用类似 mainwindow1.ui 的名称,对于路径,您可能希望搁置并创建一个名为 forms 的目录,例如$ mkdir /Users/7stud/qt_projects/forms
,然后输入该路径作为路径。
输入任何其他详细信息,然后单击Done
。这将使您进入 QtCreator 并选择设计按钮(我猜这意味着您在 QtDesigner 中),并且您将能够将小部件拖放到您的窗口上。
要将.ui
文件转换为.py
可以导入 Python 程序的文件:
$ pyuic5 mainwindow1.ui -o mainwindow1.py
-o => output file (default is stdout)
该命令将 .ui 文件 mainwindow1.ui 转换为名为 mainwindow1.py 的 .py 文件。
重新打开文件:File>Open File or Project
. 如果您选择一个带有 .ui 扩展名的文件,它将在预选 QtCreator 的设计按钮的情况下打开,即您将在 QtDesigner 中。