KJanusWidget problem (also with noatun/kopete): showstopper?

Ravikiran Rajagopal ravi at ee.eng.ohio-state.edu
Fri Nov 8 19:04:20 GMT 2002


Hello,
  I am reposting this here following the advice of Martijn Klingens:
    http://lists.kde.org/?l=kde-devel&m=103678129321270&w=2

  There seems to be a problem in qSmartMinisize in Qt-copy or kdelibs HEAD 
that affects quite a few applications. Specifically this triggers a crash on 
exit in noatun & kopete atleast. I cannot verify whether this is KDE-related 
or Qt-related. Here is example code that works perfectly with Qt-3.0.5 and 
KDE-3.0.3 but crashes & burns on Qt-copy and CVS HEAD:
--------------------------------------------------------------------------------
#include <kapplication.h>
#include <kdebug.h>
#include <kjanuswidget.h>
#include <qhbox.h>
#include <qstringlist.h>
#include <qtextedit.h>

int main( int argc, char **argv )
{
  KApplication *app = new KApplication( argc, argv, "Testing" );

  KJanusWidget *wid = new KJanusWidget(0,0,KJanusWidget::TreeList);
  app->setMainWidget( wid );

  QStringList list1, list2;
  list1 << "level1" << "page";
  list2 << "level2" << "page";
  QHBox *box1, *box2;
  box1 = wid->addHBoxPage(list1);
  new QTextEdit(box1);
  box2 = wid->addHBoxPage(list2);
  new QTextEdit(box2);

  wid->show();
  delete box1;
  wid->hide();
  wid->show();
  kdDebug() << "After deletion" << endl;

  return app->exec();
}
--------------------------------------------------------------------------------
Valgrinding gives the output posted at:
  http://lists.kde.org/?l=kde-devel&m=103677913418828&w=2

It is interesting to note that the call that fails is actually the first one 
that attempts to access the data members of the widget. I think that the 
widget has already been deleted, and the parent's layout has probably not 
updated the list of children.

I can produce a similar backtrace from noatun & kopete crashes on exit.

Ravi





More information about the kde-core-devel mailing list