Closed Lishen1 closed 6 years ago
I was able to build and run your example using Qt5.9.3, VS2017 debug mode. Couldn't reproduce any assert.
Could you please send a stack trace of the assert.
@lexxmark maybe it will helps
Qt5Cored.dll!qt_message_fatal(QtMsgType __formal=QtFatalMsg, const QMessageLogContext & context={...}, const QString & message={...}) Line 1710
at c:\users\qt\work\qt\qtbase\src\corelib\global\qlogging.cpp(1710)
Qt5Cored.dll!QMessageLogger::fatal(const char * msg=0x00007ff9c8e0d9b8, ...) Line 822
at c:\users\qt\work\qt\qtbase\src\corelib\global\qlogging.cpp(822)
Qt5Cored.dll!qt_assert(const char * assertion=0x00007ff9c905bc70, const char * file=0x00007ff9c905bc58, int line=152) Line 3126
at c:\users\qt\work\qt\qtbase\src\corelib\global\qglobal.cpp(3126)
Qt5Cored.dll!stringData(const QMetaObject * mo=0x00007ff60b0ec350, int index=0) Line 153
at c:\users\qt\work\qt\qtbase\src\corelib\kernel\qmetaobject.cpp(153)
Qt5Cored.dll!rawStringData(const QMetaObject * mo=0x00007ff60b0ec350, int index=0) Line 161
at c:\users\qt\work\qt\qtbase\src\corelib\kernel\qmetaobject.cpp(161)
Qt5Cored.dll!objectClassName(const QMetaObject * m=0x00007ff60b0ec350) Line 307
at c:\users\qt\work\qt\qtbase\src\corelib\kernel\qmetaobject.cpp(307)
Qt5Cored.dll!QMetaObject::className() Line 317
at c:\users\qt\work\qt\qtbase\src\corelib\kernel\qmetaobject.cpp(317)
proplib-qt-gui.exe!QtnPropertyDelegateFactory::registerDelegateDefault(struct QMetaObject const *,class QtnPropertyDelegate * (*)(class QtnPropertyBase &),class QByteArray const &)
proplib-qt-gui.exe!regEnumDelegates(void)
proplib-qt-gui.exe!initQtnPropertyWidgetLibrary(class QIcon *)
proplib-qt-gui.exe!QtnPropertyBoolBase::fromStrImpl(class QString const &)
ucrtbased.dll!_initterm(void(*)() * first=0x00007ff60b086000, void(*)() * last=0x00007ff60b086858) Line 22
at minkernel\crts\ucrt\src\appcrt\startup\initterm.cpp(22)
proplib-qt-gui.exe!__scrt_common_main_seh() Line 253
at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl(253)
proplib-qt-gui.exe!__scrt_common_main() Line 326
at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl(326)
proplib-qt-gui.exe!mainCRTStartup() Line 17
at f:\dd\vctools\crt\vcstartup\src\startup\exe_main.cpp(17)
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
i see you uses your Demo for check this issue. so, probably your project include Demo.peg.cpp and Demo.peg.h. more clean checking should exclude this files from compiling.
I have reproduced the ASSERT, you were right it's related to initQtnPropertyWidgetLibrary function. I rewrote the code to eliminate this function. Now default property delegate factory is created indirectly when using QtnPropertyWidget or QtnPropertyView classes.
So you are good now while not using these widgets during static variables initialization, that is very rare cases.
Please check and close issue if everything is OK.
thanks for fast solving.
if uncomment //QtnPropertyEnum* EnumProperty = new QtnPropertyEnum(nullptr); it will works. if exclude all enums from Demo.pef, it will give the same exeption. I think something wrong with initQtnPropertyWidgetLibrary in PropertyDelegateFactory.cpp. I use visual studio 2017 x64 and Qt 5.10.1.