mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
apply upstream commits to item models and widgets
that includes the following upstream commits:b58631ce47
f6eb3c220b
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
54ea9176aa
commit
64e5df8405
4 changed files with 11 additions and 6 deletions
|
@ -68,6 +68,7 @@ QListModel::~QListModel()
|
|||
|
||||
void QListModel::clear()
|
||||
{
|
||||
beginResetModel();
|
||||
for (int i = 0; i < items.count(); ++i) {
|
||||
if (items.at(i)) {
|
||||
items.at(i)->d->theid = -1;
|
||||
|
@ -76,7 +77,7 @@ void QListModel::clear()
|
|||
}
|
||||
}
|
||||
items.clear();
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
QListWidgetItem *QListModel::at(int row) const
|
||||
|
|
|
@ -2086,13 +2086,14 @@ QStandardItemModel::~QStandardItemModel()
|
|||
void QStandardItemModel::clear()
|
||||
{
|
||||
Q_D(QStandardItemModel);
|
||||
beginResetModel();
|
||||
d->root.reset(new QStandardItem);
|
||||
d->root->d_func()->setModel(this);
|
||||
qDeleteAll(d->columnHeaderItems);
|
||||
d->columnHeaderItems.clear();
|
||||
qDeleteAll(d->rowHeaderItems);
|
||||
d->rowHeaderItems.clear();
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -759,6 +759,7 @@ void QTableModel::clear()
|
|||
|
||||
void QTableModel::clearContents()
|
||||
{
|
||||
beginResetModel();
|
||||
for (int i = 0; i < tableItems.count(); ++i) {
|
||||
if (tableItems.at(i)) {
|
||||
tableItems.at(i)->view = 0;
|
||||
|
@ -766,7 +767,7 @@ void QTableModel::clearContents()
|
|||
tableItems[i] = 0;
|
||||
}
|
||||
}
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void QTableModel::itemChanged(QTableWidgetItem *item)
|
||||
|
|
|
@ -156,6 +156,7 @@ QTreeModel::~QTreeModel()
|
|||
void QTreeModel::clear()
|
||||
{
|
||||
SkipSorting skipSorting(this);
|
||||
beginResetModel();
|
||||
for (int i = 0; i < rootItem->childCount(); ++i) {
|
||||
QTreeWidgetItem *item = rootItem->children.at(i);
|
||||
item->par = 0;
|
||||
|
@ -164,7 +165,7 @@ void QTreeModel::clear()
|
|||
}
|
||||
rootItem->children.clear();
|
||||
sortPendingTimer.stop();
|
||||
reset();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -2133,10 +2134,11 @@ QVariant QTreeWidgetItem::childrenCheckState(int column) const
|
|||
default:
|
||||
return Qt::PartiallyChecked;
|
||||
}
|
||||
}
|
||||
|
||||
if (uncheckedChildren && checkedChildren)
|
||||
return Qt::PartiallyChecked;
|
||||
}
|
||||
|
||||
if (uncheckedChildren)
|
||||
return Qt::Unchecked;
|
||||
else if (checkedChildren)
|
||||
|
|
Loading…
Add table
Reference in a new issue