[Qt-interest] Upcasting to Derived Widget crashes

Neel Basu neel.basu.z at gmail.com
Mon Apr 20 07:57:51 CEST 2009


I've designed a QDockWidget Ui and made a QDockWidget Derived Class that wraps 
that ui.
and while designing the main window in designer I make its a QDockWidget and 
latter in the Constructor I again assign a new DerivedQDockWidget to it.

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new 
Ui::MainWindowClass){
  //delete ui->folderDock;
  ui->folderDock = new FolderPane(this);
  //delete ui->mailWidget;
  ui->mailWidget = new MailListWidget(this);
  ui->setupUi(this);
}

But the above crashes.
then I added corresponding delete s but it is still crashing

actual type of ui->folderDock is QDockWidget* and FolderPane inherits 
QDockWidget

Thanks





More information about the Qt-interest-old mailing list