我无法在Mac上安装qwt designer插件。 我已经下载了v 6.1.3,并成功完成了qmake,make和sudo make install。
问题是在/usr/local/qwt-6.1.3/lib下我只有文件qwt.framework,而不像libqwt.5.dylib,正如安装指南所说。因此我不遵循指南......
答案 0 :(得分:0)
首先,Qwt 6现在使用框架。这意味着不再有qwt.dylib
个文件。如果您想要链接到它,只需将其添加到.pro
文件中:
include ( /usr/local/opt/qwt/features/qwt.prf )
CONFIG += qwt
或者你的qwt安装文件夹在哪里。
原则上,您只需设置一个环境变量,例如
QT_PLUGIN_PATH="/usr/local/opt/qwt/lib/qt5/plugins:$QT_PLUGIN_PATH"
export QT_PLUGIN_PATH
但无论出于何种原因,这对我都没有用。
发了一些头发,但这是我如何通过自制软件工作。
1)brew install qt5 qwt
2)brew cask install qt-creator
3)将插件dylib复制到Qt Creator插件文件夹:
sudo cp /usr/local/opt/qwt/lib/qt5/plugins/designer/libqwt_designer_plugin.dylib /Applications/Qt Creator.app/Contents/PlugIns/designerlibqwt_designer_plugin.dylib
4)将框架(递归地)复制到App的Frameworks文件夹中:
sudo cp -R /usr/local/Cellar/qwt/6.1.3_1/lib/qwt.framework /Applications/Qt\ Creator.app/Contents/Frameworks/
5)尝试打开表单设计器时,尝试运行Qt Creator并发现它崩溃。嘘声。
6)在插件dylib上运行otool -L
:
> otool -L libqwt_designer_plugin.dylib
/usr/local/opt/qwt/lib/qt5/plugins/designer/libqwt_designer_plugin.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/Cellar/qwt/6.1.3_1/lib/qwt.framework/Versions/6/qwt (compatibility version 6.1.0, current version 6.1.3)
/usr/local/opt/qt5/lib/QtDesigner.framework/Versions/5/QtDesigner (compatibility version 5.7.0, current version 5.7.0)
/usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.7.0, current version 5.7.0)
/usr/local/opt/qt5/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.7.0, current version 5.7.0)
/usr/local/opt/qt5/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.7.0, current version 5.7.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/local/opt/qt5/lib/QtXml.framework/Versions/5/QtXml (compatibility version 5.7.0, current version 5.7.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
此时,您可以与实际有效的插件进行比较,qtquick:
libqquickwidget.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/QtDesigner.framework/Versions/5/QtDesigner (compatibility version 5.7.0, current version 5.7.0)
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.7.0, current version 5.7.0)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.7.0, current version 5.7.0)
@rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.7.0, current version 5.7.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@rpath/QtXml.framework/Versions/5/QtXml (compatibility version 5.7.0, current version 5.7.0)
@rpath/QtQuickWidgets.framework/Versions/5/QtQuickWidgets (compatibility version 5.7.0, current version 5.7.0)
@rpath/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.7.0, current version 5.7.0)
@rpath/QtQml.framework/Versions/5/QtQml (compatibility version 5.7.0, current version 5.7.0)
@rpath/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.7.0, current version 5.7.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
好的,我们需要链接到Qt的本地版本。您需要注意查找Qt框架的每个引用。在这种情况下,有两个地方:
1)在插件dylib中
2)在框架库中
这是我跑的地方:
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtGui.framework/Versions/5/QtGui" "@rpath/Frameworks/QtGui.framework/Versions/5/QtGui" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtCore.framework/Versions/5/QtCore" "@rpath/Frameworks/QtCore.framework/Versions/5/QtCore" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets" "@rpath/Frameworks/QtWidgets.framework/Versions/5/QtWidgets" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtDesigner.framework/Versions/5/QtDesigner" "@rpath/Frameworks/QtDesigner.framework/Versions/5/QtDesigner" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtXml.framework/Versions/5/QtXml" "@rpath/Frameworks/QtXml.framework/Versions/5/QtXml" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/Cellar/qwt/6.1.3_1/lib/qwt.framework/Versions/6/qwt" "@rpath/Frameworks/qwt.framework/Versions/6/qwt" libqwt_designer_plugin.dylib
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport" "@rpath/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport" qwt
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets" "@rpath/Frameworks/QtWidgets.framework/Versions/5/QtWidgets" qwt
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtCore.framework/Versions/5/QtCore" "@rpath/Frameworks/QtCore.framework/Versions/5/QtCore" qwt
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtGui.framework/Versions/5/QtGui" "@rpath/Frameworks/QtGui.framework/Versions/5/QtGui" qwt
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtSvg.framework/Versions/5/QtSvg" "@rpath/Frameworks/QtSvg.framework/Versions/5/QtSvg" qwt
sudo install_name_tool -change "/usr/local/opt/qt5/lib/QtConcurrent.framework/Versions/5/QtConcurrent" "@rpath/Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent" qwt
请注意,在qwt中,有QtOpenGL
的引用。但是这个框架并没有包含在我的Qt Creator版本中,因此我将其指向/usr/local/opt/ ...
。似乎没有什么区别。
最后,我的otool
的结果是:
otool -L qwt
qwt:
/usr/local/opt/qwt/lib/qwt.framework/Versions/6/qwt (compatibility version 6.1.0, current version 6.1.3)
@rpath/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.7.0, current version 5.7.0)
@rpath/Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.7.0, current version 5.7.0)
@rpath/Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.7.0, current version 5.7.0)
@rpath/Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.7.0, current version 5.7.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@rpath/Frameworks/QtSvg.framework/Versions/5/QtSvg (compatibility version 5.7.0, current version 5.7.0)
/usr/local/opt/qt5/lib/QtOpenGL.framework/Versions/5/QtOpenGL (compatibility version 5.7.0, current version 5.7.0)
@rpath/Frameworks/QtConcurrent.framework/Versions/5/QtConcurrent (compatibility version 5.7.0, current version 5.7.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
和
otool -L libqwt_designer_plugin.dylib
libqwt_designer_plugin.dylib:
/usr/local/opt/qwt/lib/qt5/plugins/designer/libqwt_designer_plugin.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/Frameworks/qwt.framework/Versions/6/qwt (compatibility version 6.1.0, current version 6.1.3)
@rpath/Frameworks/QtDesigner.framework/Versions/5/QtDesigner (compatibility version 5.7.0, current version 5.7.0)
@rpath/Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.7.0, current version 5.7.0)
@rpath/Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.7.0, current version 5.7.0)
@rpath/Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.7.0, current version 5.7.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@rpath/Frameworks/QtXml.framework/Versions/5/QtXml (compatibility version 5.7.0, current version 5.7.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
然后当你打开Qt Creator时,你应该看到: