Fix a potential crash when destroying ProxyModels
parent
3a4639aff0
commit
0725622f55
|
|
@ -565,6 +565,12 @@ bool ThingsProxy::lessThan(const QModelIndex &left, const QModelIndex &right) co
|
|||
leftThing = m_engine->thingManager()->things()->get(left.row());
|
||||
rightThing = m_engine->thingManager()->things()->get(right.row());
|
||||
}
|
||||
if (!leftThing || !rightThing) {
|
||||
// This should never happen, but apparently some very rare stack traces indicate it does happen. Bug in Qt?
|
||||
qCWarning(dcThingManager()) << "Thing not found in source model!" << leftThing << rightThing << m_parentProxy << m_parentProxy->rowCount() << left << right;
|
||||
Q_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
State *leftState = leftThing->stateByName(m_sortStateName);
|
||||
State *rightState = rightThing->stateByName(m_sortStateName);
|
||||
QVariant leftStateValue = leftState ? leftState->value() : 0;
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ Page {
|
|||
clip: true
|
||||
source: "mainviews/" + model.source + ".qml"
|
||||
// visible: SwipeView.isCurrentItem
|
||||
active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem
|
||||
// active: SwipeView.isCurrentItem || SwipeView.isNextItem || SwipeView.isPreviousItem
|
||||
|
||||
Binding {
|
||||
target: mainViewLoader.item
|
||||
|
|
|
|||
Loading…
Reference in New Issue