Qt Creator Crash With QWT Designer Plugin
-
I am using Mac OS X 10.9.
I installed QWT into Qt Creator with the following steps:
Downloaded QWT Source version 6.1.0
Ran "qmake" "make" and "sudo make install" fine (only a few warnings concerning unused methods)
Ran cp /usr/local/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.dylib Qt\ Creator.app/Contents/PlugIns/designer
Ran "install_name_tool -change qwt.framework/Versions/6/qwt /usr/local/qwt-6.1.0/lib/qwt.framework/Versions/6/qwt libqwt_designer_plugin.dylib" in order to make sure it could find the framework.
Qt opens fine; however, when I open a .ui file, which should take me into Design mode, Qt Creator crashes with the following message:
@
Process: Qt Creator [38445]
Path: /Users/USER/*/Qt Creator.app/Contents/MacOS/Qt Creator
Identifier: org.qt-project.qtcreator
Version: 3.0.1 (3.0.1)
Code Type: X86-64 (Native)
Parent Process: launchd [156]
Responsible: Qt Creator [38445]
User ID: 501Date/Time: 2014-03-28 23:21:49.787 -0400 OS Version: Mac OS X 10.9.2 (13C64) Report Version: 11 Anonymous UUID: C4C884A0-4C10-9FB4-9145-07097A2EBD67 Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Application Specific Information: abort() called Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib __pthread_kill + 10 1 libsystem_pthread.dylib pthread_kill + 92 2 libsystem_c.dylib abort + 125 3 QtCore qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&) + 9 4 QtCore QMessageLogger::fatal(char const*, ...) const + 161 5 QtGui qt_pixmap_thread_test() + 233 6 QtGui QPixmap::QPixmap(QString const&, char const*, QFlags<Qt::ImageConversionFlag>) + 51 7 libqwt_designer_plugin.dylib QwtDesignerPlugin::PlotInterface::PlotInterface(QObject*) + 113 8 libqwt_designer_plugin.dylib QwtDesignerPlugin::CustomWidgetCollectionInterface::CustomWidgetCollectionInterface(QObject*) + 86 9 libqwt_designer_plugin.dylib qt_plugin_instance + 154 10 QtCore QPluginLoader::instance() + 169 11 QtDesigner QDesignerPluginManager::ensureInitialized() + 922 12 QtDesigner QDesignerPluginManager::registeredCustomWidgets() const + 25 13 QtDesigner qdesigner_internal::WidgetDataBase::loadPlugins() + 458 14 QtDesigner 0x10c24e000 + 32782 15 libDesigner.dylib Designer::Internal::FormEditorW::fullInit() + 73 16 libDesigner.dylib Designer::Internal::FormEditorW::ensureInitStage(Designer::Internal::FormEditorW::InitializationStage) + 106 17 libDesigner.dylib Designer::Internal::FormEditorW::instance() + 14 18 libDesigner.dylib Designer::Internal::FormEditorFactory::createEditor(QWidget*) + 24 19 libCore.dylib Core::EditorManager::createEditor(Core::Id const&, QString const&) + 1158 20 libCore.dylib Core::EditorManager::openEditor(Core::Internal::EditorView*, QString const&, Core::Id const&, QFlags<Core::EditorManager::OpenEditorFlag>, bool*) + 785 21 libProjectExplorer.dylib ProjectExplorer::Internal::ProjectTreeWidget::openItem(QModelIndex const&) + 80 22 QtCore QMetaObject::activate(QObject*, int, int, void**) + 2550 23 QtWidgets QAbstractItemView::activated(QModelIndex const&) + 56 24 QtWidgets QTreeView::mouseDoubleClickEvent(QMouseEvent*) + 978 25 QtWidgets QWidget::event(QEvent*) + 1506 26 QtWidgets QFrame::event(QEvent*) + 183 27 QtWidgets QAbstractScrollArea::viewportEvent(QEvent*) + 122 28 QtWidgets QAbstractItemView::viewportEvent(QEvent*) + 1391 29 QtWidgets QTreeView::viewportEvent(QEvent*) + 520 30 QtWidgets 0x1001d3000 + 1837749 31 QtCore QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) + 156 32 QtWidgets QApplicationPrivate::notify_helper(QObject*, QEvent*) + 281 33 QtWidgets QApplication::notify(QObject*, QEvent*) + 8905 34 QtCore QCoreApplication::notifyInternal(QObject*, QEvent*) + 114 35 QtWidgets QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) + 952 36 QtWidgets 0x1001d3000 + 532405 37 QtWidgets 0x1001d3000 + 529119 38 QtWidgets QApplicationPrivate::notify_helper(QObject*, QEvent*) + 300 39 QtWidgets QApplication::notify(QObject*, QEvent*) + 6157 40 QtCore QCoreApplication::notifyInternal(QObject*, QEvent*) + 114 41 QtGui QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 3490 42 QtGui QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) + 97 43 QtGui QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 136
@
Is there something I did wrong, or is this a bug in QWT?
-
Hi and welcome to devnet,
Did you got a complain about the use of multiple Qt version ?
-
I see this line
@QMessageLogger::fatal(char const*, ...) const + 161@Were would this be logged to? I now have a feeling that is where the answer will be.
-
You might get it on the console, try starting Qt Creator from the terminal
-
Maybe
@
QPixmap: Must construct a QGuiApplication before a QPixmap
@That was the only thing that popped out at me, but maybe there is something I am missing. Here is all the output:
@
~: ./Applications/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator
Info: creating stash file /Users/carloabelli/Documents/qt/build-Simulation-Desktop_Qt_5_2_1_clang_64bit-Debug/.qmake.stash
objc[49652]: Class NotificationReceiver is implemented in both /Users/carloabelli/Applications/Qt/Qt Creator.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets and /Users/carloabelli/Applications/Qt/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets. One of the two will be used. Which one is undefined.
objc[49652]: Class QCocoaPageLayoutDelegate is implemented in both /Users/carloabelli/Applications/Qt/Qt Creator.app/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport and /Users/carloabelli/Applications/Qt/5.2.1/clang_64/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport. One of the two will be used. Which one is undefined.
objc[49652]: Class QCocoaPrintPanelDelegate is implemented in both /Users/carloabelli/Applications/Qt/Qt Creator.app/Contents/Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport and /Users/carloabelli/Applications/Qt/5.2.1/clang_64/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport. One of the two will be used. Which one is undefined.
QPixmap: Must construct a QGuiApplication before a QPixmap
zsh: abort ./Applications/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator
@ -
You qwt plugin doesn't use the same Qt as the one that comes with Qt Creator.
IIRC correctly when creating custom plugins you should also build Qt Creator yourself to ensure both uses the same Qt.
What you can try before that, is to use install_name_tool to point your qwt designer plugin to the Qt inside Qt Creator.
-
[quote author="SGaist" date="1396209488"]You qwt plugin doesn't use the same Qt as the one that comes with Qt Creator.
IIRC correctly when creating custom plugins you should also build Qt Creator yourself to ensure both uses the same Qt.
What you can try before that, is to use install_name_tool to point your qwt designer plugin to the Qt inside Qt Creator.[/quote]
Hi sgaist, Nice to see you in all Qt topics solving issues.
Long live!!! -
[quote author="ansifpi" date="1396773233"]
[quote author="SGaist" date="1396209488"]You qwt plugin doesn't use the same Qt as the one that comes with Qt Creator.IIRC correctly when creating custom plugins you should also build Qt Creator yourself to ensure both uses the same Qt.
What you can try before that, is to use install_name_tool to point your qwt designer plugin to the Qt inside Qt Creator.[/quote]
Hi sgaist, Nice to see you in all Qt topics solving issues.
Long live!!![/quote]Hi,
Thank you very much
-
I just wanted to say that I got my own Qt Designer plugin working with the 'stock' Qt Creator (simply downloaded from this site) using the install_name_tool.
So, I had my designer plugin working on Windows for a while before testing on OSX and the main thing to get it to work in the Qt Creator designer on Windows was to ensure that I used the 32 bit version of the Qt download (because I believe the packaged version of Qt Creator with all downloaded versions is 32-bit). I've not tried my dll with the 64-bit creator since, but 32-bit is fine for my little app.
The full application using my custom widget compiles and works fine in OSX, but I was having the same problems that you were using my own compiled .dylib files and the downloaded version of Qt Creator. Upon opening a .UI file in Designer Mode it would crash with the same error.
I fixed it (and I'm using my custom dylib designer plugin with the vanilla creator / designer) by doing the following;
-
Make sure you are compiling using the 'standard' compiler (and not C++ 11). I'm not 100% sure if this is required, but my spying with otool made me think it would be.
-
After running otool -L libMyLib.dylib, note down every line starting "/Users/<username>/Qt5.2.1/5.2.1/clang_64/". You will need to change it to a relative path using install_name_tool. I copied these paths from one of the designer plugins that came packaged with Qt Creator. Basically, my 'post-build' script to make my dylib work from within the Qt Creator bundle is...
@install_name_tool -change "/Users/johnwordsworth/Qt5.2.1/5.2.1/clang_64/lib/QtDesigner.framework/Versions/5/QtDesigner" "@loader_path/../../Frameworks/QtDesigner.framework/Versions/5/QtDesigner" libSFBWidgets.dylib
install_name_tool -change "/Users/johnwordsworth/Qt5.2.1/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets" "@loader_path/../../Frameworks/QtWidgets.framework/Versions/5/QtWidgets" libSFBWidgets.dylib
install_name_tool -change "/Users/johnwordsworth/Qt5.2.1/5.2.1/clang_64/lib/QtGui.framework/Versions/5/QtGui" "@loader_path/../../Frameworks/QtGui.framework/Versions/5/QtGui" libSFBWidgets.dylib
install_name_tool -change "/Users/johnwordsworth/Qt5.2.1/5.2.1/clang_64/lib/QtCore.framework/Versions/5/QtCore" "@loader_path/../../Frameworks/QtCore.framework/Versions/5/QtCore" libSFBWidgets.dylib
install_name_tool -change "/Users/johnwordsworth/Qt5.2.1/5.2.1/clang_64/lib/QtXml.framework/Versions/5/QtXml" "@loader_path/../../Frameworks/QtXml.framework/Versions/5/QtXml" libSFBWidgets.dylib
@Hope this helps!
-
-
I had the same problem. Here's how I got it working.
- download source code for qwt and Qt Creator
- build both with the suggested procedure using the same quake
- Open the Qt Creator package. There are several differences from the format shown in other posts. There is no /Contents/Framework folder, and the plugin folder is in /Contents/PlugIns.
- add the qwt plugin "libqwt_designer_plugin.dylib" to /Contents/PlugIns.
- using otool on the above dylib shows absolute paths to some qwt files. Don't change these. There is also a reference to qwt.framework without a path -- don't change that either.
- Add a symbolic link to the qwt.framework file in /Library/Frameworks. There is also an environment variable (DYLD_FRAMEWORK_PATH that can be used to set the path to frameworks, but I didn't try that).
-
Updating the library id to point it to the place where the file is not disallowed. However one must take care to update it if it's moved at some point