Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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:
    67c147b0-cb1d-4132-a9c7-ed2c6163b59d-image.png
    and it opens the qstring.h file:
    ab652ba8-1e44-404d-9890-cbbf8c881482-image.png
    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
    ae8d718c-9db4-448e-bf05-ade78f3210b0-image.png
    Here's the full window



  • @HenkCoder
    The bottom-left pane is what we are interested in. It shows the crash is coming in some QFontComboBox, apparently in response to some QComboBox's QLineEdit'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. in main() or whatever. You might check whether your code uses a QFontComboBox 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
    001705bf-f377-4ba0-9cc7-da329b96b759-image.png
    here it is the full thing



  • @JonB Hello, found out the problem was in here
    fabbccd6-2d21-488e-a076-69ff507bca82-image.png
    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!


Log in to reply