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

Multiple QPair in QList crashes application



  • Hello,

    I have an application where I'm storing some data for processing it further
    example: QList<QPair<QString, QList<QPair<QString, QList<QPair<QString, QList<QPair<QString, int>>>>>>>>

    For less data it's working but when I have more data in the above QList then it's crashing.

    So the question is, does use such QList is a good programming style, or is there any better alternative for this?

    Please suggest me, thanks.



  • @npatil15 said in Multiple QPair in QList crashes application:

    QList<QPair<QString, QList<QPair<QString, QList<QPair<QString, QList<QPair<QString, int>>>>>>>>

    Are you even serious with this? :D

    There is no reason to create a list like this. Better think about how to re-organize your data in a better way.

    How does your data look like? What data do you want to store in such a list?



  • This creates a structure like:

    • QList<QPair<Filename, QList<QPair<FrameName, QList<QPair<ClassName QList<QPair<Description, Query>>>>>>>

    Here, I have multiple files (FileName) which has multiple frames (FrameName) which has multiple classes (ClassName) which has data called Description and its query.

    So I'm reading multiple Json files and gathering some data out of it, and storing in this above variable to process it later to show in tables, charts and then again store this sorted data in Excel sheet.

    Can you please suggest me if I have such type of data then how I should go ahead?


  • Lifetime Qt Champion

    Use a debugger and see where it crashes.



  • @npatil15 said in Multiple QPair in QList crashes application:

    So I'm reading multiple Json files and gathering some data out of it, and storing in this above variable to process it later to show in tables, charts and then again store this sorted data in Excel sheet.

    To do this, you don't need to have one list, that stores everything.


Log in to reply