Rename QAbstractItemModel.parent() to parentModelIndex()
The signature on `QAbstractItemModel.parent()` conflicts with `QObject.parent()`. Maybe in C++ you can get away with that, but in TS it is a huge PITA.
This commit is contained in:
parent
7dcbc32540
commit
9faf63d5d3
@ -22,9 +22,9 @@ export class QAbstractItemModel extends QObject<any> {
|
||||
|
||||
case 'parent':
|
||||
try {
|
||||
return this.parent(new QModelIndex(args[0])).native;
|
||||
return this.parentModelIndex(new QModelIndex(args[0])).native;
|
||||
} catch (e) {
|
||||
console.log(`An exception was thrown while dispatching to method 'parent':`);
|
||||
console.log(`An exception was thrown while dispatching to method 'parentModelIndex':`);
|
||||
console.log(e);
|
||||
}
|
||||
return new QModelIndex().native;
|
||||
@ -154,7 +154,10 @@ export class QAbstractItemModel extends QObject<any> {
|
||||
// TODO: bool moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild)
|
||||
// TODO: virtual bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
|
||||
|
||||
parent(child: QModelIndex): QModelIndex {
|
||||
/**
|
||||
* Note: This corresponds to `QAbstractItemModel::parent(QModelIndex)`. It has been given a different name in TS.
|
||||
*/
|
||||
parentModelIndex(child: QModelIndex): QModelIndex {
|
||||
return new QModelIndex();
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ export class QAbstractTableModel extends QAbstractItemModel {
|
||||
return this.hasIndex(row, column, parent) ? this.createIndex(row, column) : new QModelIndex();
|
||||
}
|
||||
|
||||
parent(child: QModelIndex): QModelIndex {
|
||||
parentModelIndex(child: QModelIndex): QModelIndex {
|
||||
return new QModelIndex();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user