mapping correction
This commit is contained in:
parent
ab1448a18f
commit
5d092e27c0
|
@ -83,12 +83,13 @@ void HInspectorWidget::keyPressEvent(QKeyEvent *event) {
|
||||||
if (event->matches(QKeySequence::MoveToNextChar)) {
|
if (event->matches(QKeySequence::MoveToNextChar)) {
|
||||||
QModelIndex index = slotsView->currentIndex();
|
QModelIndex index = slotsView->currentIndex();
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
unsigned row = index.row();
|
|
||||||
QSortFilterProxyModel* sortModel =
|
QSortFilterProxyModel* sortModel =
|
||||||
static_cast<QSortFilterProxyModel*>(slotsView->model());
|
static_cast<QSortFilterProxyModel*>(slotsView->model());
|
||||||
|
QModelIndex modelIndex = sortModel->mapToSource(index);
|
||||||
RecordModel* recordModel =
|
RecordModel* recordModel =
|
||||||
static_cast<RecordModel*>(sortModel->sourceModel());
|
static_cast<RecordModel*>(sortModel->sourceModel());
|
||||||
Record* record = recordModel->getRecord();
|
Record* record = recordModel->getRecord();
|
||||||
|
unsigned row = modelIndex.row();
|
||||||
Slot* slot = record->getSlot(row);
|
Slot* slot = record->getSlot(row);
|
||||||
if (slot) {
|
if (slot) {
|
||||||
Record* newRecord = slot->getDataRecord();
|
Record* newRecord = slot->getDataRecord();
|
||||||
|
|
Loading…
Reference in New Issue