Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, March 2007
[Qt 4.3.0] Rapid clicks on sortable QTableWidget


Message 1 in thread

I have a window with a QTableWidget containing a couple of columns
which are sortable. Using a QTimer this table is periodically
refreshed updating the entries, (note: it is possible for rows to be
deleted or inserted in this refresh call). This is all done on the
same thread, the main UI thread.

However if I rapidly click the sorting headers, after a short time an
exception is thrown from the memmove() line in the file
corelib/tools/qvector.h. Upon examination the d->size = 10 and l = 11,
so (d->size-l) = -1. this is then passed to memmove as the size
parameter, which throws an appropriate exception.

I can't see that I'm doing anything wrong and the call stack is deep
inside the QTCore. Many thanks in advance.

Regards,
Simon Bourne

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

File: corelib/tools/qvector.h

Q_TYPENAME QVector<T>::iterator QVector<T>::erase(iterator abegin,
iterator aend)
{
   ...
   if (QTypeInfo<T>::isComplex) {
      ...
   } else {
      memmove(d->array + f, d->array + l, (d->size-l)*sizeof(T));
   }
   ...
}

Callstack:

msvcr71d.dll!memmove()
Q_TYPENAME QVector<T>::iterator QVector<T>::erase(iterator abegin,
iterator aend)
inline iterator erase(iterator pos) { return erase(pos, pos+1); }
void QAbstractItemModel::changePersistentIndexList(const
QModelIndexList &from, const QModelIndexList &to)
void QTableModel::sort(int column, Qt::SortOrder order)
void QTableView::sortByColumn(int column)
int QTableView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
int QTableWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
void QMetaObject::activate(QObject *sender, int from_signal_index, int
to_signal_index, void **argv)
void QMetaObject::activate(QObject *sender, const QMetaObject *m, int
local_signal_index, void **argv)
void QHeaderView::sectionClicked(int _t1)
void QHeaderView::mouseReleaseEvent(QMouseEvent *e)
.....
.....

To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx