Abdelrazak Younes wrote:
> > Now the most severe bug is the crash on moving entries up/down.
>
> It should not be difficult, it used to work at one point but not
> anymore. I can't fix it because it make gdb crash under windows. But if
> you can post a backtrace of the crash, I might have some idea.
I'm sure the backtrace will help. Apparently, QTreeWidgetItem * current is
invalid. I had a quick look, but I'm stuck mainly because I don't understand
where the signals have gone ...
Meanwhile, I have applied the attached patch that gets rid of the row header
again.
Jürgen
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1090246016 (LWP 18597)]
lyx::frontend::QTocDialog::on_tocTW_currentItemChanged (this=0x8a39350,
current=0x0,
previous=0x8a3f708) at qtreewidget.h:66
66 { return data(column, Qt::DisplayRole).toString(); }
(gdb) bt
#0 lyx::frontend::QTocDialog::on_tocTW_currentItemChanged (this=0x8a39350,
current=0x0,
previous=0x8a3f708) at qtreewidget.h:66
#1 0x08424d44 in lyx::frontend::QTocDialog::qt_metacall (this=0x8a39350,
_c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbff2ea58) at
QTocDialog_moc.C:79
#2 0x40b0c2a7 in QMetaObject::activate ()
from /usr/local/qt4/lib/libQtCore.so.4
#3 0x40b0c6f3 in QMetaObject::activate ()
from /usr/local/qt4/lib/libQtCore.so.4
#4 0x40785e5c in QTreeWidget::currentItemChanged ()
from /usr/local/qt4/lib/libQtGui.so.4
#5 0x4078b6d1 in QTreeWidgetItem::QTreeWidgetItem ()
from /usr/local/qt4/lib/libQtGui.so.4
#6 0x4078d07b in QTreeWidget::qt_metacall ()
from /usr/local/qt4/lib/libQtGui.so.4
#7 0x40b0c2a7 in QMetaObject::activate ()
from /usr/local/qt4/lib/libQtCore.so.4
#8 0x40b0c6f3 in QMetaObject::activate ()
from /usr/local/qt4/lib/libQtCore.so.4
#9 0x407a9bbc in QItemSelectionModel::currentChanged ()
from /usr/local/qt4/lib/libQtGui.so.4
#10 0x4076d3a9 in QItemSelectionModel::clear ()
from /usr/local/qt4/lib/libQtGui.so.4
#11 0x4078cd98 in QTreeWidget::clear () from /usr/local/qt4/lib/libQtGui.so.4
#12 0x08411c80 in lyx::frontend::QTocDialog::updateToc (this=0x8a39350,
newdepth=false)
at QTocDialog.C:167
#13 0x08363169 in lyx::frontend::QToc::update_contents (this=0x8868d90) at
QToc.C:48
#14 0x08363013 in lyx::frontend::QToc::moveUp (this=0x8868d90) at QToc.C:73
#15 0x08410d31 in lyx::frontend::QTocDialog::on_moveUpPB_clicked
(this=0x8a39350)
at QTocDialog.C:101
#16 0x08424da1 in lyx::frontend::QTocDialog::qt_metacall (this=0x8a39350,
_c=QMetaObject::InvokeMetaMethod, _id=5, _a=0xbff2f65c) at
QTocDialog_moc.C:84
#17 0x40b0c2a7 in QMetaObject::activate ()
from /usr/local/qt4/lib/libQtCore.so.4
#18 0x40b0c4ea in QMetaObject::activate ()
from /usr/local/qt4/lib/libQtCore.so.4
#19 0x407a29fe in QAbstractButton::clicked ()
from /usr/local/qt4/lib/libQtGui.so.4
Index: src/frontends/qt4/QTocDialog.C
===================================================================
--- src/frontends/qt4/QTocDialog.C (Revision 13687)
+++ src/frontends/qt4/QTocDialog.C (Arbeitskopie)
@@ -19,6 +19,7 @@
#include "debug.h"
+#include <QHeaderView>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QPushButton>
@@ -50,9 +51,9 @@ QTocDialog::QTocDialog(QToc * form)
tocTW->setColumnCount(1);
// hide the pointless QHeader
-// QWidget * w = static_cast<QWidget*>(tocTW->child("list view header"));
-// if (w)
-// w->hide();
+ QHeaderView * w = static_cast<QHeaderView*>(tocTW->header());
+ if (w)
+ w->hide();
// connect(closePB, SIGNAL(clicked()),
// form, SLOT(slotClose()));
@@ -65,7 +66,7 @@ QTocDialog::~QTocDialog()
}
void QTocDialog::on_tocTW_currentItemChanged(QTreeWidgetItem * current,
- QTreeWidgetItem * previous)
+ QTreeWidgetItem * previous)
{
form_->select(fromqstr(current->text(0)));
}