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

[Solved]Test89.exe stop working



  • Hi
    In my Qt Application i had button to genarate tab dyanamically but i clicked that button it disply that error message ->Test89.exe stop working please anyone can suggest solution for that specailly why that error message occured common reason ?

    thanks


  • Lifetime Qt Champion

    Hi,

    Without any code it's essentially crystal ball guessing:

    • Invalid pointer ?
    • Memory Access Error ?
    • Memory Leak ?
    • Others ?

    Did you run your application through a debugger ?



  • My code

    @
    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    QObject::connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(tabGenarate()));
    

    }

    void MainWindow::tabGenarate()
    {

    tab = new QWidget;
    
    tabWidget->addTab(tab,"New");
    
    ui->verticalLayout->addWidget(tabWidget);
    

    }
    @


  • Lifetime Qt Champion

    what is tabWidget ? Were is it initialized ?

    Are you sure that your ui has a member verticalLayout ?



  • Ohoooo Really missing initialized tabWidget

    thanks Lot


Log in to reply