mainwindow.cpp has unexpectedly finished.

Kevin Krammer krammer at kde.org
Sun Jul 1 14:48:51 UTC 2012


Hi Heena,

On Sunday, 2012-07-01, Heena Mahur 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(newUi::MainWindow)
> {QSplitter*splitter1=newQSplitter(parent);
> QSplitter*splitter2=newQSplitter(parent);
> splitter1->addWidget(ui->treeWidget);
> splitter1->addWidget(ui->groupBox);
> 
> splitter2->addWidget(ui->groupBox);splitter2->addWidget(ui->scrollArea);
> 
> 
> 
> 
> ui->setupUi(this);

You need to call this before accessing the widget in the class "ui" points to.
Try moving this to the first line of the constructor.

> Using qt creator I am getting this error -Starting
> /home/heena/Documents/untitled3/untitled3... The program has unexpectedly
> finished.

This usually means that the application crashed. If you run in debug mode this 
should result in a backtrace, a list of function calls showing what the 
application was doing at the point of crash, usually including file name and 
line number of the code that triggered the crash.

Cheers,
Kevin

P.S.: I'd recommend to not cross-post to that many lists, some people discard 
such messages without looking, effectively reducing the chance of getting an 
answer.

If you are working on something KDE Edu this list is just fine. Alternatively 
any KDE related development question is always welcome on kde-devel
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20120701/19758196/attachment.sig>


More information about the kde-edu mailing list