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

ASSERT error?!



  • Hi,
    My running code (without problem!) just started to give below error. What is the reason?

    ASSERT: "uint(i) < uint(size())" in file c:\users\qt\work\qt\qtbase\src\corelib\tools\qstring.h, line 920
    How can I solve or investigate it?...
    Qt 5.11.2
    Qt Creator 4.7.1

    regards,
    Mucip:)


  • Moderators

    @Mucip
    seems like you try to acsess chars, in a QString, that don't exist. Most likly via const QChar QString::at(int position) const
    or something similar.

    Hard to tell without stacktrace and/or code.



  • Hi,
    Yes. You were right.

    if(modelTableHareket->rowCount()>0){
            ui->tVDetay->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Stretch);
            ui->tVDetay->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Stretch);
        }
    

    I was trying to use above code without row count check. Now it's ok. Thanks.

    Regargds,
    Mucip:)


  • Lifetime Qt Champion

    Hi @Mucip,

    I'm glad you solved the problem.

    So please close this topic as SOLVED. Thanks!


Log in to reply