Hi Am Son, 2003-09-21 um 18.23 schrieb George Staikos: > This is incorrect code. Please fix it. If you are sure that dynamic_cast<> > will never return 0 then please use static_cast<>. If you aren't sure, then > you are writing code that is guaranteed to crash. > > On Friday 19 September 2003 17:54, Joseph Wenninger wrote: > > } > > - if (obj->d->isContainer) > > dynamic_cast(obj->widget)->save(c); + if > > (obj->d->isContainer) > > dynamic_cast(obj->widget)->save(c,group); > > Bzzzt. dynamic_cast()-> is always wrong. You must check for null. static_cast doesn't work here. The inheritance looks like class Something : public SomeQWidgetClass, public KDockContainer. It is ensured by the if statement that the widget really inherits from KDockWidget, but a static cast doesn't work in this case: kdockwidget.cpp: In member function `void KDockManager::writeConfig(KConfig*, QString)': kdockwidget.cpp:2366: error: invalid static_cast from type `QWidget*' to type ` KDockContainer*' Kind regards Joseph Wenninger