首页| 论坛| 消息

标题:Chart和QtGraphicalEffects静态编译的问题
作者:adadadda
日期:2017-01-13 22:48
内容:

一直想静态编译代码,但是在代码中使用了Chart和QtGraphicalEffects模块。Chart模块无法在别的电脑运行,QtGraphicalEffects无法编译。

因为我想使用Control 2,所以我用的Qt 5.8,顺便吐槽一句Qt 5.7的Control 2的BUG实在有点多,并且莫名其妙。

工程文件代码如下:
QT += qml quick
QT += core gui widgets
QT += charts
CONFIG += c++11
SOURCES += main.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000# disables all the APIs deprecated before Qt 6.0.0
# Default rules for deployment.
qnx: target.path = /tmp/${TARGET}/bin
else: unix:!android: target.path = /opt/${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
chart需要用到Widget里面的东西,所以必须添加Widget,并且在main.c的代码里面要app类型为QApplication
main.c文件代码如下:
#include
#include
#include
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QLatin1String("qrc:/main.qml")) ..


#1 [adadadda 01-14 07:20]
没人么?大神呢?
#2 [adadadda 01-18 18:33]
最后一个问题为我解决了,删除在注册表中删除红色的部分即可
#3 [adadadda 01-19 21:01]
求大神指导
#4 [adadadda 01-28 12:14]
不要沉啊,求大神帮助
#5 [adadadda 02-19 09:38]
求指导

<< 1 2 >> (1/2)

回复 发表
主题 版块