我在Mac OS上设置Qwt软件包的Qt Designer插件时遇到麻烦,我在这里写这篇文章是为了寻求有关执行Qt Designer,Qt5和Qwt的有效安装的帮助。 (OS X 10.13.6,Qt 5.12.0,Qwt 6.1.3)
虽然之前曾问过其他类似的问题,但它们要么引用其他平台,要么以某种方式过时,例如。 Install and use QWT under Mac OS X的答案似乎不再起作用,在usr/local
中创建符号链接会在当前版本的Mac OS中引发权限错误。
在官方Qwt install guide中的一些步骤上,我也很费力,它解释了如何使Qt Designer插件正常工作。对于如何在系统上设置环境变量,或者该指令是否适用,我尚不完全清楚。此外,Qwt文档链接到似乎已过时的Qt documentation page,从5.12.0版开始,Qt Creator应用程序捆绑包的结构与所提供命令中使用的结构不同。除了设置环境变量之外,我是否还需要执行这些步骤?或者这是两种选择吗?
遇到这些问题后,我通过Homebrew创建了Qt,Qwt和Qt Creator的全新安装,并按照here所述进行了设置。答案实质上是对Qt文档中提供的说明的更新。
我遵循了此答案中提供的步骤,但在我的情况下,在现有插件上运行otool -L
返回的路径略有不同,(@loader_path/../../Frameworks/
而非@rpath/Frameworks/
)-我相应地修改了命令。
此时,Qt Designer在打开表单文件时崩溃。
下面是我使用的可重复性命令的清单:
brew install qt qwt
brew cask install qt-creator
sudo cp /usr/local/Cellar/qwt/6.1.3_4/lib/qt/plugins/designer/libqwt_designer_plugin.dylib /Applications/Qt\ Creator.app/Contents/PlugIns/designer
sudo cp -r /usr/local/Cellar/qwt/6.1.3_4/lib/qwt.framework /Applications/Qt\ Creator.app/Contents/Frameworks
cd /Applications/Qt\ Creator.app/Contents/PlugIns/designer
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui" "@loader_path/../../Frameworks/QtGui.framework/Versions/5/QtGui" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore" "@loader_path/../../Frameworks/QtCore.framework/Versions/5/QtCore" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets" "@loader_path/../../Frameworks/QtWidgets.framework/Versions/5/QtWidgets" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtDesigner.framework/Versions/5/QtDesigner" "@loader_path/../../Frameworks/QtDesigner.framework/Versions/5/QtDesigner" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtXml.framework/Versions/5/QtXml" "@loader_path/../../Frameworks/QtXml.framework/Versions/5/QtXml" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/Cellar/qwt/6.1.3_4/lib/qwt.framework/Versions/6/qwt" "@loader_path/../../Frameworks/qwt.framework/Versions/6/qwt" libqwt_designer_plugin.dylib
cd /Applications/Qt\ Creator.app/Contents/Frameworks/qwt.framework
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport" "@loader_path/../../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport" qwt
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets" "@loader_path/../../Frameworks/QtWidgets.framework/Versions/5/QtWidgets" qwt
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore" "@loader_path/../../Frameworks/QtCore.framework/Versions/5/QtCore" qwt
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui" "@loader_path/../../Frameworks/QtGui.framework/Versions/5/QtGui" qwt
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtSvg.framework/Versions/5/QtSvg" "@loader_path/../../Frameworks/QtSvg.framework/Versions/5/QtSvg" qwt
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtConcurrent.framework/Versions/5/QtConcurrent" "@loader_path/../../Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent" qwt
sudo install_name_tool -change "/usr/local/opt/qt/lib/QtOpenGL.framework/Versions/5/QtOpenGL" "@loader_path/../../Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL" qwt
此时运行otool -L
确认已进行更改,但是Qt Designer在启动时崩溃(Qt Creator本身正常打开)。
我想念什么?任何想法将不胜感激。
谢谢您的帮助!