Python mac + Anaconda 上的 Qt 设计器应用程序在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26226730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is Qt designer app on mac + Anaconda?
提问by Dennis Sakva
Can you guys help me find Qt designer app on mac. I installed anaconda package and conda reports that qt, sip, and pyqt are installed. Still I couldn't find the designer app in any of the folders. My python app that uses pyqt works perfectly. I'm very new to macs and probably missing something very simple. I did search folder tree for anything named designer. I found QtDesigner.so (supposed to be executable?) at /Users/XXXX/anaconda/pkgs/pyqt-4.10.4-py27_0/lib/python2.7/site-packages/PyQt4 but it won't even run saying "cannot execute binary file" anaconda/bin doesn't have it there's a folder anaconda/include/QtDesigner but noting I can run /anaconda/pkgs/qt-4.8.5-3/bin - no designer I'm totally confused now.
你们能帮我在 mac 上找到 Qt 设计器应用程序吗?我安装了 anaconda 包,conda 报告安装了 qt、sip 和 pyqt。我仍然无法在任何文件夹中找到设计器应用程序。我使用 pyqt 的 python 应用程序运行良好。我对 macs 很陌生,可能缺少一些非常简单的东西。我为任何名为设计师的东西搜索了文件夹树。我在 /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 - 没有设计师我现在完全糊涂了。
采纳答案by TheDarkKnight
I expect it's Qt Creator that you should be looking for. Note here: -
我希望您应该寻找 Qt Creator。请注意: -
the integration of Qt Designer under Qt Creator is first mentioned at least as early as Qt 4.7 (ca. late 2011)
Qt Creator includes a code editor and integrates Qt Designer for designing and building graphical user interfaces (GUIs) from Qt widgets.
至少早在 Qt 4.7(大约 2011 年末)就首次提到了 Qt Designer 在 Qt Creator 下的集成
Qt Creator 包括一个代码编辑器并集成了 Qt Designer,用于从 Qt 小部件设计和构建图形用户界面 (GUI)。
If it's not in your distribution, you can download it separately here.
如果它不在您的发行版中,您可以在此处单独下载。
回答by Alex Jadczak
I can't answer you question definitively as I don't have OSX installed anywhere, but perhaps I can help lead you in the right direction.
我无法明确回答您的问题,因为我没有在任何地方安装 OSX,但也许我可以帮助您朝着正确的方向前进。
1) you are going to want to be looking for Designer, not QT Creator, as Designer is what comes bundled with PyQt4 (PyQt4 is what Anaconda comes packaged with)
1) 您将要寻找 Designer,而不是 QT Creator,因为 Designer 是与 PyQt4 捆绑在一起的(PyQt4 是 Anaconda 随附的)
2) in linux when you install Anaconda 2.1 to the default location, designer is going to be placed in home/user_name/anaconda/bin/
2)在linux中,当你安装Anaconda 2.1到默认位置时,designer会被放置在home/user_name/anaconda/bin/
3) typing 'designer' from a terminal launches designer in linux, so you may not have to bother searching around for it.
3) 从终端输入“designer”会在 linux 中启动设计器,因此您可能不必费心四处寻找它。
Hopefully there is some consistency between linux and osx (windows designer is located in \Anaconda\Lib\site-packages\PyQt4).
希望 linux 和 osx 之间有一些一致性(windows 设计器位于 \Anaconda\Lib\site-packages\PyQt4)。
Best of luck.
祝你好运。
回答by Drsn
I downloaded the latest Qt4 version for Mac (and SIP), from https://riverbankcomputing.com/software/pyqt/download/python configure.py make && make install and my qt designer is here. /usr/local/Cellar/qt/4.8.7/Designer.app
我从https://riverbankcomputing.com/software/pyqt/download/pythonconfigure.py make && make install下载了适用于 Mac(和 SIP)的最新 Qt4 版本,我的 qt 设计器就在这里。/usr/local/Cellar/qt/4.8.7/Designer.app
Hope it helps!
希望能帮助到你!
回答by 7stud
OSX Yosemite 10.10.5Qt 5.6QtCreator 3.6.1
OSX Yosemite 10.10.5Qt 5.6QtCreator 3.6.1
QtDesigner is part of my QtCreator. To use QtDesigner:
QtDesigner 是我的 QtCreator 的一部分。使用 QtDesigner:
Launch QtCreator, and from the menu bar (outside QtCreator), click on:
File>New File or ProjectYou will be presented with a
New File or Projectdialog window. In theFiles And Classessection, selectQt. In the middle pane, selectQtDesigner Form. Then click on theChoosebutton in the lower right corner.You will be presented with a
QtDesigner Formdialog window. Then you can selectMain WindoworDialog with Buttons Bottom, etc. Then click on theContinuebutton in the lower right corner.In the
Locationdialog window, use a name like mainwindow1.ui, and for the path you might want to step aside and create a directory called forms, e.g.$ mkdir /Users/7stud/qt_projects/forms, then enter that as the path.Enter any other details and click on
Done. That will land you in QtCreator with the Design button selected (which I guess means you are in QtDesigner), and you will be able to drag and drop widgets onto your window.To convert the
.uifile to a.pyfile that you can import into your python program:$ pyuic5 mainwindow1.ui -o mainwindow1.py-o => output file (default is stdout)
启动 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)
That command converts the .ui file mainwindow1.ui to a .py file named mainwindow1.py.
该命令将 .ui 文件 mainwindow1.ui 转换为名为 mainwindow1.py 的 .py 文件。
To re-open the file: File>Open File or Project. If you select a file with a .ui extension, it will be opened with QtCreator's Design button pre-selected, i.e. you will be inside QtDesigner.
重新打开文件:File>Open File or Project. 如果您选择一个带有 .ui 扩展名的文件,它将在预选 QtCreator 的设计按钮的情况下打开,即您将在 QtDesigner 中。
回答by ken
You can try open -a Designerfrom your terminal to launch Qt Designer that comes with Anaconda (version 4.x).
您可以尝试open -a Designer从终端启动 Anaconda(版本 4.x)附带的 Qt Designer。
If you have Qt5.x, you may want to launch a newer version of Designer by open -a Designer-qt5.
如果您有 Qt5.x,您可能希望通过open -a Designer-qt5.
回答by ramakrishna yerramsetty
I found it in this location in my mac
我在我的 mac 中的这个位置找到了它
/Users/ramakrishna/Qt/5.11.1/clang_64/bin/Designer.app
/用户/ramakrishna/Qt/5.11.1/clang_64/bin/Designer.app
command "open -a designer" also works on mac shell
命令“open -a Designer”也适用于 mac shell
command + space bar and invoke spot light search and typing designer also find the designer app
命令 + 空格键和调用聚光灯搜索和输入设计器也可以找到设计器应用程序
回答by RWorden
Qt has a dmg installer for Mac which includes everything.
Qt 有一个适用于 Mac 的 dmg 安装程序,其中包含所有内容。

