[Qt-creator] mainwindow.cpp has unexpectedly finished.

Diego Iastrubni diegoiast at gmail.com
Sun Jul 1 15:19:18 UTC 2012


On Sun, Jul 1, 2012 at 5:38 PM, Heena Mahur <hena18 at rocketmail.com> wrote:

> Hey,
> Please have a look at mainwindow.cpp
>
> #include "mainwindow.h"
>
> #include "ui_mainwindow.h"
>
> #include <QSplitter>
>
>
>
> MainWindow::MainWindow(QWidget *parent) :
>
>
>     QMainWindow(parent),
>
>
>     ui(new Ui::MainWindow)
>
> {    QSplitter *splitter1 = new QSplitter(parent);
>
>      QSplitter *splitter2 = new QSplitter(parent);
>
>
ui->treeWidget is null. It is constructed in setupUi()



>      ui->setupUi(this);
>
>
Move this line to the beginning  of the method.

PS: use a debugger - or valgrind. It will help you find those bugs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20120701/cb0db0c4/attachment.html>


More information about the kde-edu mailing list