Hi, Konstantin, thanks for your reply, I have attached stack when QObject created first time, the problem is that UB is already exists in Qt, Q_CONSTRUCTOR_FUNCTION(initialize) and QBasicAtomicPointer<QThread> QCoreApplicationPrivate::theMainThread = Q_BASIC_ATOMIC_INITIALIZER(nullptr); should be called in next order, first should be initialized theMainThread and after should be called Q_CONSTRUCTOR_FUNCTION(initialize) but it is not guaranteed by standard, https://en.cppreference.com/w/cpp/language/siof
On Sat, Jul 1, 2023 at 8:09 AM Konstantin Shegunov <kshegu...@gmail.com> wrote: > On Fri, Jun 30, 2023 at 11:12 AM Yauheni Pervenenka via Interest < > interest@qt-project.org> wrote: > >> Hi community, >> I was faced with a warning QApplication was not created in the main() >> thread. on windows only, it is very rare happen, >> > > Almost certainly you're creating a static `QObject` instance that sets the > "main" thread, and whenever the application constructor runs it reports > this as error. >
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest