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



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.