Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Problem with Static Qt
AhmedAlshawi last edited by AhmedAlshawi
Hi. I have built a static version of Qt which compiles and runs just fine. However, when I execute a particular function, I get this error message:
QWidget: Must construct a QApplication before a QWidget
This is quite strange because it does not occur when I compile and run the function using the dynamically linked build - only the static. Also, I am pretty sure that I have not made a widget before calling QApplication. I call the QApp right at the start and this error occurs in a function much later on in my code.
Any initial ideas? The only difference between the two is that I add
CONFIG += static
when doing the static build.
Do you have any static QWidget around in your code ?
I would run it in the debugger and set a breakpoint on the output. Then simply look at the backtrace to see where it comes from.
AhmedAlshawi last edited by
What is a static QWidget?
The error occurs when I run a function that takes some data, produces a chart using qtcharts and using qwt charts then returns a QPixmap.
A static variable of the type QWidget.
But as @Christian-Ehrlicher, run your application through the debugger.