我在让 qwt 小部件与 Qt-Creator 一起正常工作时遇到问题 [英] I'm having issues getting the qwt widget to work correctly with Qt-Creator

查看:59
本文介绍了我在让 qwt 小部件与 Qt-Creator 一起正常工作时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在让 qwt 6.1.0 与 Qt-Creator 5.1.0 一起正常工作时遇到问题.当我启动 Qt-Designer 的独立版本时它可以正常工作,并且当我使用 Qt-Creator 时一切都可以正确编译和运行.然而,内置于 Qt-Creator 中的设计器无法在任何表单上正确显示 qwt 小部件,也无法让我选择添加新的 qwt 小部件.

I'm having issues getting qwt 6.1.0 to work correctly with Qt-Creator 5.1.0. It works correctly when I launch the stand alone version of Qt-Designer and everything compiles and runs correctly when I use Qt-Creator. However the designer that is built into Qt-Creator does not display the qwt widgets correctly on any forms nor give me the option to add new qwt widgets.

我将 Qt Creator 5.1.0 用于 Windows 64 位(带有 OpenGL 的 VS2012).我还通过简单地打开 qwt.pro 文件并编译它,使用上述 Qt-Creator 下载并编译了 Qwt 6.1.0.编译完成后,我按照 Qwt 说明 (http://qwt.sourceforge.net/qwtinstall.html).然后我将 qwt_designer_plugin.dll 复制到 C:\Qt\Qt5.1.0\Tools\QtCreator\bin\plugins\designer\ 和 C:\Qt\Qt5.1.0\5.1.0\msvc2012_64_opengl\plugins\designer\ 目录.

I'm using Qt Creator 5.1.0 for Windows 64-bit (VS2012 with OpenGL). I've also downloaded and compiled Qwt 6.1.0 with the aforementioned Qt-Creator, by simply opening the qwt.pro file and compiling it. Once it was compiled I used the 'nmake' and 'nmake install' commands from the visual studio command prompt as directed in the Qwt instructions (http://qwt.sourceforge.net/qwtinstall.html). I then copied the qwt_designer_plugin.dll to the C:\Qt\Qt5.1.0\Tools\QtCreator\bin\plugins\designer\ and C:\Qt\Qt5.1.0\5.1.0\msvc2012_64_opengl\plugins\designer\ directories.

有人有什么建议吗?我可以手动启动 Qt-Designer 并仅使用 Qt-Creator 进行编译,但是必须不断来回切换并且无法使用捆绑在 Qt-Creator 中的设计器,这有点烦人.

Does anyone have any suggestions? I can manually launch Qt-Designer and just compile with Qt-Creator, but it is kind of annoying to have to constantly switch back and forth and not be able to use the designer that is bundled into Qt-Creator.

编辑#1:我还按照 qwt 安装文档中的说明将路径环境变量设置为 C:\Qwt-6.1.0\lib\.此外,我在我正在测试的 Qt 项目文件 (.pro) 中设置了以下内容:

EDIT #1: I've also set the path environment variable to C:\Qwt-6.1.0\lib\ as instructed in the qwt installation documenation. Additionally I've set the following in the Qt project file (.pro) that I'm testing with:

CONFIG  += qwt
INCLUDEPATH += C:\Qwt-6.1.0\include\
LIBS += C:\Qwt-6.1.0\lib\

推荐答案

原因可能在于您的 QTCreator 与您构建 QWT 所针对的 ACTUAL QT 框架的兼容性.

The reason might be on the compatibility of your QTCreator with the the ACTUAL QT framework you built QWT against.

QT-Project.org/Download 中提供的 适用于 Windows 64 位(VS 2012,OpenGL,522 MB)的 Qt 5.1.1 包具有 QT 库针对 MSVCR110 (C++ 2012) 64 位 构建,而实际的 QTCreator.exe 是针对 MSCVR100 (C++ 2010) 构建的.这就是为什么 QWT 插件加载成功形成了 QT 框架中的独立 QT 设计器,而不是 Tools/目录中的 QT 创建者.要检查这一点,请在 Dependency Walker 中加载 QTCreator 可执行文件,您将看到.

The Qt 5.1.1 for Windows 64-bit (VS 2012, OpenGL, 522 MB) package provided in QT-Project.org/Download has the QT libraries built against MSVCR110 (C++ 2012) 64 bits where as the actual QTCreator.exe is built against MSCVR100 (C++ 2010). That's why the QWT plugin load successfully form the stand-alone QT Designer that comes in the QT framework, but not on the QT creator that comes in the Tools/ directory. To check this, load the QTCreator executable in Dependency Walker and you'll see.

我的建议是您下载 QT 的源代码,使用您的编译器构建它,然后使用相同的编译器编译 QWT.有点乏味,但至少你可以确定你的插件会加载.

My recommendation is that you download the source code of QT, build it with your compiler and then compile the QWT using the same compiler. A bit tedious but at least you'll be sure that your plugins will load.

这篇关于我在让 qwt 小部件与 Qt-Creator 一起正常工作时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆