Segmentation fault QCoreApplication::cs_isRealGuiApp()

Discuss anything related to product development
Post Reply
seasoned_geek
Posts: 246
Joined: Thu Jun 11 2020 12:18 pm

Segmentation fault QCoreApplication::cs_isRealGuiApp()

Post by seasoned_geek »

All,

(gdb) go
Command requires an argument.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff43f5234 in QCoreApplication::cs_isRealGuiApp() () from /usr/local/lib/libCsCore1.7.so
(gdb)

In the .cpp file for my Overlord class I had decided to be a good little programmer and near the top of the file.

Code: Select all

static const QSize DEFAULT_SIZE(450, 600);
static const QPoint DEFAULT_POSITION(0, 0);
static const QFont DEFAULT_FONT("Monospace", 12);
It's late and I'm tired, so I haven't dug much deeper. I know one of these, if not all three of these must have a call to QCoreApplication::cs_isRealGuiApp() in the constructor. My guess is it is QFont and I'm guessing whoever did it meant well, but now you can't have a static const outside of a class so it is only visible within a single .cpp file. It gets initialized before the QApplication in main.cpp.
ansel
Posts: 150
Joined: Fri Apr 10 2015 8:23 am

Re: Segmentation fault QCoreApplication::cs_isRealGuiApp()

Post by ansel »

seasoned_geek wrote: Tue Sep 14 2021 12:11 am My guess is it is QFont and I'm guessing whoever did it meant well, but now you can't have a static const outside of a class so it is only visible within a single .cpp file. It gets initialized before the QApplication in main.cpp.
There is no way to construct a QFont object before the QApplication object has been created. One of the things that happens during the QApplication constructor is loading the GUI platform plugin, which is responsible for handling fonts.
Ansel Sermersheim
CopperSpice Cofounder
Post Reply