Во-первых, 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
Но по моей причине это не сработало для меня.
Tore несколько волос, но вот как я получил работу через доморощенный.
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) Скопировать структуру (рекурсивно) в фреймвоков приложения папка:
sudo cp -R /usr/local/Cellar/qwt/6.1.3_1/lib/qwt.framework /Applications/Qt\ Creator.app/Contents/Frameworks/
5) Попытка запустите Qt Creator и найдите его сбой при попытке открыть конструктор форм. Бу.
6) Запустите otool -L
на плагин dylib:
> 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 вы должны увидеть это: