framelesshelper
framelesshelper copied to clipboard
编译问题
你好, framelesshelper\src\quick\framelessquickmodule.cpp(93): error C3861: “qmlRegisterAnonymousType”: 找不到标识符
你Qt什么版本?编译器呢?
大佬您好,编译器我用的是vs2022,qt用的是5.15.2
袁琦 @.***
------------------ 原始邮件 ------------------ 发件人: "wangwenx190/framelesshelper" @.>; 发送时间: 2023年3月8日(星期三) 上午9:43 @.>; @.@.>; 主题: Re: [wangwenx190/framelesshelper] 编译问题 (Issue #207)
你Qt什么版本?编译器呢?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
你是不是没装qml
应该是你的环境哪里不对。正常情况下不会找不到这个的
好的,多谢回复, 我再研究研究
袁琦 @.***
------------------ 原始邮件 ------------------ 发件人: "wangwenx190/framelesshelper" @.>; 发送时间: 2023年3月21日(星期二) 下午3:47 @.>; @.@.>; 主题: Re: [wangwenx190/framelesshelper] 编译问题 (Issue #207)
应该是你的环境哪里不对。正常情况下不会找不到这个的
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
找到问题了吗?确实是FramelessHelper自己的问题吗?
Qt5.12没有这个方法
行,我看看怎么代替一下
#if QT_DEPRECATED_SINCE(5, 14)
template<typename T>
QT_DEPRECATED_VERSION_X_5_14("Use qmlRegisterAnonymousType instead") int qmlRegisterType()
{
return qmlRegisterAnonymousType<T>("", 1);
}
#endif
另外,Qt5.12下,sysapiloader.cpp第118行QVarLengthArray<wchar_t, MAX_PATH> buf = {};
这样会报错,改成QVarLengthArray<wchar_t, MAX_PATH> buf = {0};
可以通过
非常感谢博主,我最近还要做一个项目,我等用qt5.15试下
袁琦 @.***
------------------ 原始邮件 ------------------ 发件人: "wangwenx190/framelesshelper" @.>; 发送时间: 2023年4月17日(星期一) 下午4:12 @.>; @.@.>; 主题: Re: [wangwenx190/framelesshelper] 编译问题 (Issue #207)
另外,Qt5.12下,sysapiloader.cpp第118行QVarLengthArray<wchar_t, MAX_PATH> buf = {};这样会报错,改成QVarLengthArray<wchar_t, MAX_PATH> buf = {0};可以通过
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Qt5.12加入这个模板后,编译通过,example里面不知道为啥quick要求Qt6以上,openglwidget注释了
template<typename T>
int qmlRegisterAnonymousType(const char *uri, int versionMajor)
{
QML_GETTYPENAMES
QQmlPrivate::RegisterType type = {
0,
qRegisterNormalizedMetaType<T *>(pointerName.constData()),
qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()),
0,
nullptr,
QString(),
uri, versionMajor, 0, nullptr, &T::staticMetaObject,
QQmlPrivate::attachedPropertiesFunc<T>(),
QQmlPrivate::attachedPropertiesMetaObject<T>(),
QQmlPrivate::StaticCastSelector<T,QQmlParserStatus>::cast(),
QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(),
QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(),
nullptr, nullptr,
nullptr,
0
};
return QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type);
}
要求Qt6是因为有些我用到的类Qt5没有导出,但核心功能是不受影响的,但我为了保险起见,在Qt5直接禁用了
x64-debug模式编译通过, x64-RelWithDebInfo 编译出现这个问题, 用的是qt5.15.2 编译器是vs2019
袁琦 @.***
------------------ 原始邮件 ------------------ 发件人: "wangwenx190/framelesshelper" @.>; 发送时间: 2023年4月17日(星期一) 晚上6:01 @.>; @.@.>; 主题: Re: [wangwenx190/framelesshelper] 编译问题 (Issue #207)
要求Qt6是因为有些我用到的类Qt5没有导出,但核心功能是不受影响的,但我为了保险起见,在Qt5直接禁用了
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
With Qt6.5.2 LTS, the same bug occurs.