Solved Qt app crashes
-
Hello everyone, I'm currently making an app in Qt and now, I have updated to Qt 6.2.0 version and when I try to run it, it crashes immediatly.
I tried to debug it and this is what it showed:
and it opens the qstring.h file:
do you guys know why it's telling this? -
@HenkCoder Oh wait, i know the error, I opened a JSON file in the location of the exe +
/settings.json
but now that I have updated it, it changed.
Thank you guys for the help tho.
Sorry for my misunderstanding and for wasting your time. -
@HenkCoder Without seeing your code my crystal ball tells me you do operations on the QString that went out of scope or something. Do you try to assign the value to the object/member of who has already been deleted or not initialised?
-
@artwaw Hello, I can send the code if you want but it's really long, more than 2000 lines in only one file.
-
@artwaw I don't know tho, with Qt 6.1.3 version it all worked properly, but now i don't even know where the problem is.
-
@HenkCoder
Your screenshot shows the final source code line of the crash. What you/we need to see is the stack trace window in the debugger, which should show a list of calls leading back from that to somewhere in your code. -
@JonB
Here's the full window -
@HenkCoder
The bottom-left pane is what we are interested in. It shows the crash is coming in someQFontComboBox
, apparently in response to someQComboBox
'sQLineEdit
's text being changed. You do not show the full stack trace, scroll down in that pane to see where it ultimately emanates from in your code, e.g. inmain()
or whatever. You might check whether your code uses aQFontComboBox
anywhere.As for why, or what has changed when maybe it worked in a previous Qt version, I do not know. Somebody else may comment....
-
@JonB Mhh let me search.
-
@JonB
here it is the full thing -
@JonB Hello, found out the problem was in here
But i still don't know how to resolve this.
In Qt 6.1.3 the code worked fine but now it doesn't.
This is the JSON file:{ "font": { "family": "Calibri", "pointSize": 11, "bold": false, "italics": false, "underline": false, "foregroundColor": { "red": 0, "green": 0, "blue": 0 }, "backgroundColor": { "red": 255, "green": 255, "blue": 255 } }, "toolBarColor": { "red": 154, "green": 244, "blue": 230 }, "defaultSavingLocation": "Documents", "defaultOpenLocation": "Documents", "defaultPictureLocation": "Pictures", "darkTheme": false }
-
@HenkCoder Oh wait, i know the error, I opened a JSON file in the location of the exe +
/settings.json
but now that I have updated it, it changed.
Thank you guys for the help tho.
Sorry for my misunderstanding and for wasting your time. -
@HenkCoder learning opportunity, even if you have to go round in circles for some time, is a time never wasted. Happy you got around to fix it!