why UI will freeze when using the api createWindowContainer qt5.15.2, but other version of QT have no problem
-
1 i build QT5.15.2 source using VS2017 64bit,and sucess. the configure is like this "configure.bat -opensource -confirm-license -verbose -prefix "C:\Qt\Qt5.15.2\5.15.2\msvc2017_64" -debug-and-release -force-debug-info -separate-debug-info -nomake tests -nomake examples -opengl dynamic -plugin-sql-sqlite -platform win32-msvc -qt-zlib -force-debug-info -mp -skip qtwebengine -skip qtconnectivity "
2 when i use the QT5.15.2 to rebuild my project ,i found that once using this api QWidget::createWindowContainer(m_window),the app will freeze . and when i use previous qt version(QT5.13.2 QT5.12.0 ...), it doesnot have this problem
3 who can help me ? thanks -
Hi,
Can you trigger that with a minimal compilable example ?
-
#include <Qt3DExtras/Qt3DWindow>
void function1(QObject* receiver, int isrun, int b)
{
while (1)
{
Qtmsleep(1000);
}
}
#include <QApplication>
void maintest(int argc, char* argv[])
{
QApplication a(argc, argv);
Qt3DExtras::Qt3DWindow*_windows = new Qt3DExtras::Qt3DWindow();
QWidget *pv = QWidget::createWindowContainer(_windows );
QtConcurrent::run( function1, pv, 0, 0);
pv->show( );
int result1 = a.exec();
}
only when comment QWidget *pv = QWidget::createWindowContainer(_windows );,it will show the window,otherwise it will not show. and i found after pv->show( ), QThreadPool::globalInstance()->activeThreadCount() will goes from 1 to 16. but in QT5.13.2 ,it alway keep value 1. and QT5.13.2 doesnot have the same problem -
What do you get if you trigger your QtConcurrent run through a QTimer ?
-
Can you show the latest version of your code ?