[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: not a qt bug [ was: Re: Qt-copy updated]
From:       Michael =?iso-8859-1?q?H=E4ckel?= <haeckel () kde ! org>
Date:       2002-01-28 19:01:14
[Download RAW message or body]

On Monday 28 January 2002 16:05, Matthias Ettrich wrote:
>
> I don't know what KMail (in kmheaders) or KDE (in klistview) is doing, but
> what you describe doesn't see to occur with Qt alone.
>
> On clear, key() is _not_ called in the items like the comment in kmheaders
> cleaims.
>
> Michael, do you have a small example that reproduces the problem?

I said myself, that I can't reproduce the issue with key(), but I once 
recieved a bug report that prooved that this happened at least in a certain 
case, see attached backtrace #29 and #7, (I think that was with Qt-3.0.0) and 
there was never a problem with Qt-2.3.x. Maybe it happens only sometimes with 
nested items, I don't know. Therefore I added the workaround, since the 
submitter said it prevented the crash.

But the one with paintCell() is reproducable with Qt alone and is new in the 
snapshot. I think, I've see this also once in a beta of Qt-3, but later it 
was fixed.

My example definitely doesn't link against any KDE library. See it attached 
again.

Regards,
Michael Häckel

----------  Forwarded Message  ----------

Subject: Items repainted in QListView::clear()
Date: Sun, 27 Jan 2002 16:06:08 +0100
From: Michael Häckel <haeckel@kde.org>
To: qt-bugs@trolltech.com

Hi,

Apply attached patch to the listviews example.
Start it.
Sub Sub Folder 1 is selected.
Scroll the headers down and select the last item on the bottom.
Click the push button.
Some console output demonstrates, that paintCell is called when clearing the
list view which IMHO shouldn't happen for performance reasons.
In a special case this caused an application crash because the application
wasn't prepared for this behaviour.

This is with 3.0.2-snapshot-20020126 on X11 and didn't happen in Qt-3.0.1.

BTW: I have also already seen (however unreproducable and not with this
version), that QListViewItem::key() was called from QListView::clear().

Regards,
Michael Häckel

-------------------------------------------------------

["paintCell.diff" (text/x-diff)]

Index: listviews.cpp
===================================================================
RCS file: /home/kde/qt-copy/examples/listviews/listviews.cpp,v
retrieving revision 1.36
diff -u -3 -p -r1.36 listviews.cpp
--- listviews.cpp	2002/01/26 20:31:44	1.36
+++ listviews.cpp	2002/01/27 15:03:17
@@ -17,6 +17,7 @@
 #include <qpopupmenu.h>
 #include <qheader.h>
 #include <qregexp.h>
+#include <qpushbutton.h>
 
 // -----------------------------------------------------------------
 
@@ -88,6 +89,7 @@ MessageListItem::MessageListItem( QListV
 void MessageListItem::paintCell( QPainter *p, const QColorGroup &cg,
 				 int column, int width, int alignment )
 {
+    qWarning("MessageListItem::paintCell: " + myMessage->header().subject());
     QColorGroup _cg( cg );
     QColor c = _cg.text();
 
@@ -132,8 +134,8 @@ ListViews::ListViews( QWidget *parent, c
 	    this, SLOT( slotRMB( QListViewItem *, const QPoint &, int ) ) );
     vsplitter->setResizeMode( messages, QSplitter::KeepSize );
 
-    message = new QLabel( vsplitter );
-    message->setAlignment( Qt::AlignTop );
+    message = new QPushButton( vsplitter );
+//    message->setAlignment( Qt::AlignTop );
     message->setBackgroundMode( PaletteBase );
 
     connect( folders, SIGNAL( selectionChanged( QListViewItem* ) ),
@@ -142,6 +144,8 @@ ListViews::ListViews( QWidget *parent, c
 	     this, SLOT( slotMessageChanged() ) );
     connect( messages, SIGNAL( currentChanged( QListViewItem * ) ),
 	     this, SLOT( slotMessageChanged() ) );
+    connect( message, SIGNAL(clicked()),
+             messages, SLOT(clear()) );
 
     messages->setSelectionMode( QListView::Extended );
     // some preperationes
@@ -152,7 +156,7 @@ ListViews::ListViews( QWidget *parent, c
 
     messages->setSelected( messages->firstChild(), TRUE );
     messages->setCurrentItem( messages->firstChild() );
-    message->setMargin( 5 );
+//    message->setMargin( 5 );
 
     QValueList<int> lst;
     lst.append( 170 );
Index: listviews.h
===================================================================
RCS file: /home/kde/qt-copy/examples/listviews/listviews.h,v
retrieving revision 1.36
diff -u -3 -p -r1.36 listviews.h
--- listviews.h	2002/01/26 20:31:46	1.36
+++ listviews.h	2002/01/27 15:03:18
@@ -24,6 +24,7 @@ class QPainter;
 class QColorGroup;
 class QObjectList;
 class QPopupMenu;
+class QPushButton;
 
 // -----------------------------------------------------------------
 
@@ -152,7 +153,7 @@ protected:
     void setupFolders();
 
     QListView *messages, *folders;
-    QLabel *message;
+    QPushButton *message;
     QPopupMenu* menu;
 
     QPtrList<Folder> lstFolders;

["keyBacktrace" (text/plain)]

[New Thread 1024 (LWP 7249)]
0x413db5a9 in __wait4 () from /lib/libc.so.6
#0  0x413db5a9 in __wait4 () from /lib/libc.so.6
#1  0x41443ad8 in __DTOR_END__ () from /lib/libc.so.6
#2  0x40041e37 in waitpid () from /lib/libpthread.so.0
#3  0x4120afc2 in KCrash::defaultCrashHandler (signal=11) at kcrash.cpp:219
#4  0x4003f89d in pthread_sighandler () from /lib/libpthread.so.0
#5  <signal handler called>
#6  0x81ba186 in KMHeaderItem::generate_key (id=3986, headers=0x84c3358, 
    msg=0x0, paintInfo=0x84c34e0, sortOrder=2) at kmheaders.cpp:332
#7  0x81bad01 in KMHeaderItem::key (this=0x869d218, column=2)
    at kmheaders.cpp:377
#8  0x405cb7f1 in QListViewItem::compare ()
   from /usr/local/qt/lib/libqt-mt.so.3
#9  0x405cba5a in QListViewItem::sortChildItems ()
   from /usr/local/qt/lib/libqt-mt.so.3
#10 0x405cc45d in QListViewItem::enforceSortOrder ()
   from /usr/local/qt/lib/libqt-mt.so.3
#11 0x405cfb70 in QListView::buildDrawableList ()
   from /usr/local/qt/lib/libqt-mt.so.3
#12 0x405ce89e in QListView::drawContentsOffset ()
   from /usr/local/qt/lib/libqt-mt.so.3
#13 0x405f8b1e in QScrollView::viewportPaintEvent ()
   from /usr/local/qt/lib/libqt-mt.so.3
#14 0x41003458 in KListView::viewportPaintEvent (this=0x84c3358, e=0xbfffe264)
    at klistview.cpp:1665
#15 0x405f86d7 in QScrollView::eventFilter ()
   from /usr/local/qt/lib/libqt-mt.so.3
#16 0x405d1d1b in QListView::eventFilter ()
   from /usr/local/qt/lib/libqt-mt.so.3
#17 0x4050a9c8 in QObject::activate_filters ()
   from /usr/local/qt/lib/libqt-mt.so.3
#18 0x4050a881 in QObject::event () from /usr/local/qt/lib/libqt-mt.so.3
#19 0x405388c5 in QWidget::event () from /usr/local/qt/lib/libqt-mt.so.3
#20 0x404b30b2 in QApplication::internalNotify ()
   from /usr/local/qt/lib/libqt-mt.so.3
#21 0x404b2f64 in QApplication::notify () from /usr/local/qt/lib/libqt-mt.so.3
#22 0x4116f6c5 in KApplication::notify (this=0xbffff368, receiver=0x84c3f30,
    event=0xbfffe264) at kapplication.cpp:541
#23 0x40492a83 in QWidget::repaint () from /usr/local/qt/lib/libqt-mt.so.3
#24 0x40494656 in QWidget::scroll () from /usr/local/qt/lib/libqt-mt.so.3
#25 0x404942c5 in QWidget::scroll () from /usr/local/qt/lib/libqt-mt.so.3
#26 0x405f99e0 in QScrollView::moveContents ()
   from /usr/local/qt/lib/libqt-mt.so.3
#27 0x405f93aa in QScrollView::setContentsPos ()
   from /usr/local/qt/lib/libqt-mt.so.3
#28 0x405d01e2 in QListView::setContentsPos ()
   from /usr/local/qt/lib/libqt-mt.so.3
#29 0x405cff8b in QListView::clear () from /usr/local/qt/lib/libqt-mt.so.3
#30 0x80df9f7 in KMHeaders::readSortOrder (this=0x84c3358, set_selection=true)
    at kmheaders.cpp:2852
#31 0x80dcec4 in KMHeaders::updateMessageList (this=0x84c3358,
    set_selection=true) at kmheaders.cpp:2185
#32 0x80d5ae6 in KMHeaders::setFolder (this=0x84c3358, aFolder=0x82b97a0,
    jumpToFirst=true) at kmheaders.cpp:797
#33 0x808dc43 in KMMainWin::folderSelected (this=0x8442da0, aFolder=0x82b97a0,
    jumpToUnread=false) at kmmainwin.cpp:1272
#34 0x808d92c in KMMainWin::folderSelected (this=0x8442da0, aFolder=0x82b97a0)
    at kmmainwin.cpp:1226
#35 0x8086b2d in KMMainWin::qt_invoke (this=0x8442da0, _id=70, _o=0xbfffe844)
    at kmmainwin.moc:349
#36 0x4050c594 in QObject::activate_signal ()
   from /usr/local/qt/lib/libqt-mt.so.3
#37 0x80c9d5b in KMFolderTree::folderSelected (this=0x8505f88, t0=0x82b97a0)
    at kmfoldertree.moc:180
#38 0x80c6ff0 in KMFolderTree::doFolderSelected (this=0x8505f88,
    qlvi=0x82ac148) at kmfoldertree.cpp:720
#39 0x80ca01f in KMFolderTree::qt_invoke (this=0x8505f88, _id=75,
    _o=0xbfffe974) at kmfoldertree.moc:232
#40 0x4050c594 in QObject::activate_signal ()
   from /usr/local/qt/lib/libqt-mt.so.3
#41 0x407bcf56 in QListView::currentChanged ()
   from /usr/local/qt/lib/libqt-mt.so.3
#42 0x405d5c20 in QListView::setCurrentItem ()
   from /usr/local/qt/lib/libqt-mt.so.3
#43 0x405d2728 in QListView::contentsMousePressEventEx ()
   from /usr/local/qt/lib/libqt-mt.so.3
#44 0x405d1ff3 in QListView::contentsMousePressEvent ()
   from /usr/local/qt/lib/libqt-mt.so.3
#45 0x80c9835 in KMFolderTree::contentsMousePressEvent (this=0x8505f88,
    e=0xbfffeb84) at kmfoldertree.cpp:1194
#46 0x405f8be7 in QScrollView::viewportMousePressEvent ()
   from /usr/local/qt/lib/libqt-mt.so.3
#47 0x405f86d7 in QScrollView::eventFilter ()
   from /usr/local/qt/lib/libqt-mt.so.3
#48 0x405d1d1b in QListView::eventFilter ()
   from /usr/local/qt/lib/libqt-mt.so.3
#49 0x4050a9c8 in QObject::activate_filters ()
   from /usr/local/qt/lib/libqt-mt.so.3
#50 0x4050a881 in QObject::event () from /usr/local/qt/lib/libqt-mt.so.3
#51 0x405388c5 in QWidget::event () from /usr/local/qt/lib/libqt-mt.so.3
#52 0x404b30b2 in QApplication::internalNotify ()
   from /usr/local/qt/lib/libqt-mt.so.3
#53 0x404b2a07 in QApplication::notify () from /usr/local/qt/lib/libqt-mt.so.3
#54 0x4116f6c5 in KApplication::notify (this=0xbffff368, receiver=0x8507918, 
    event=0xbfffef70) at kapplication.cpp:541
#55 0x40467b18 in QETWidget::translateMouseEvent ()
   from /usr/local/qt/lib/libqt-mt.so.3
#56 0x40465235 in QApplication::x11ProcessEvent ()
   from /usr/local/qt/lib/libqt-mt.so.3
#57 0x40463f06 in QApplication::processNextEvent ()
   from /usr/local/qt/lib/libqt-mt.so.3
#58 0x404b43d1 in QApplication::enter_loop ()
   from /usr/local/qt/lib/libqt-mt.so.3
#59 0x40463e6b in QApplication::exec () from /usr/local/qt/lib/libqt-mt.so.3
#60 0x818d0db in main (argc=7, argv=0xbffff4e4) at main.cpp:261
#61 0x41352baf in __libc_start_main () from /lib/libc.so.6


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic