forked from quickshell/quickshell
core/objectmodel: fix objectInserted signal indexes
This commit is contained in:
parent
e23923d9a2
commit
c4cc662bcc
1 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ QObject* UntypedObjectModel::valueAt(QQmlListProperty<QObject>* property, qsizet
|
|||
|
||||
void UntypedObjectModel::insertObject(QObject* object, qsizetype index) {
|
||||
auto iindex = index == -1 ? this->valuesList.length() : index;
|
||||
emit this->objectInsertedPre(object, index);
|
||||
emit this->objectInsertedPre(object, iindex);
|
||||
|
||||
auto intIndex = static_cast<qint32>(iindex);
|
||||
this->beginInsertRows(QModelIndex(), intIndex, intIndex);
|
||||
|
@ -47,7 +47,7 @@ void UntypedObjectModel::insertObject(QObject* object, qsizetype index) {
|
|||
this->endInsertRows();
|
||||
|
||||
emit this->valuesChanged();
|
||||
emit this->objectInsertedPost(object, index);
|
||||
emit this->objectInsertedPost(object, iindex);
|
||||
}
|
||||
|
||||
void UntypedObjectModel::removeAt(qsizetype index) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue