Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt: Assertion Failure error given on a project which was working perfectly
Forum Update on Monday, May 27th 2025

Qt: Assertion Failure error given on a project which was working perfectly

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 870 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    magurmach
    wrote on last edited by
    #1

    I had my project running perfectly. Updated my project on "bitbucket":https://bitbucket.org/ and then added some comments. Ran my project again. And strangely, this error given.
    @ASSERT failure in QVector<T>::operator[]: "index out of range", file ....\include/QtCore/../../src/corelib/tools/qvector.h, line 385@
    I thought I may have messed something up during commenting, so immediately looked for error, found none. Okay, I may have missed something. So, logged in to bitbucket and downloaded the project. Deleted the old project and ran the new one. SAME PROBLEM WITH SAME ERROR. Whats the problem?

    Sample Demonstration:

    @MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    //QHBoxLayout *layout=new QHBoxLayout;
    WeekAndDailyView *view=new WeekAndDailyView(this);
    //layout->addWidget(view);
    qDebug()<<"Came here"<<endl;
    setCentralWidget(view);
    }@

    Output:
    @
    Came here

    ASSERT failure in QVector<T>::operator[]: "index out of range", file ....\include/QtCore/../../src/corelib/tools/qvector.h, line 385
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.@

    And little more strange, my main.cpp:

    @#include "mainwindow.h"
    #include <QApplication>
    #include <QDebug>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;

    qDebug()<<"Came Here"<<endl;
    w.show();
    qDebug()<<"Came Here"<<endl;
    return a.exec&#40;&#41;;
    

    }@

    Application output:
    @
    Came Here

    ASSERT failure in QVector<T>::operator[]: "index out of range", file ....\include/QtCore/../../src/corelib/tools/qvector.h, line 385
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    G:\Programming\Projects\QT try\build-CasePage-Desktop_Qt_5_3_0_MinGW_32bit-Debug\debug\CasePage.exe exited with code 3@

    Note: I am using Qt 3.1.1 absed on Qt 5.2.1(MSVC 2010, 32 bit) on Windows. I have only one MINGW installed. And I have already restarted the machine and re installed Qt.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved