mapping correction

This commit is contained in:
Christophe Alexandre 2008-05-06 23:20:10 +00:00
parent ab1448a18f
commit 5d092e27c0
1 changed files with 2 additions and 1 deletions

View File

@ -83,12 +83,13 @@ void HInspectorWidget::keyPressEvent(QKeyEvent *event) {
if (event->matches(QKeySequence::MoveToNextChar)) {
QModelIndex index = slotsView->currentIndex();
if (index.isValid()) {
unsigned row = index.row();
QSortFilterProxyModel* sortModel =
static_cast<QSortFilterProxyModel*>(slotsView->model());
QModelIndex modelIndex = sortModel->mapToSource(index);
RecordModel* recordModel =
static_cast<RecordModel*>(sortModel->sourceModel());
Record* record = recordModel->getRecord();
unsigned row = modelIndex.row();
Slot* slot = record->getSlot(row);
if (slot) {
Record* newRecord = slot->getDataRecord();