aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/treemodel.cpp
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-03-19 12:42:53 +0100
committerhjk <hjk@theqtcompany.com>2015-03-20 08:36:57 +0000
commitb3f88df41df29f8a20e7ddf6fd8b83100a75740d (patch)
treed4ba0fc1071fafd8c7ba9c5b6c87ecf674519ae6 /src/libs/utils/treemodel.cpp
parentb08e5a9bc3dd04e6630f43c459753731e87eda1a (diff)
Debugger: Remove most remaining occurrences of WatchData
... in WatchHandler and DebuggerEngine interface. Adjust using code. Change-Id: I6371f3e96ba46a783e23a5767cdde24a10d3fce7 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/libs/utils/treemodel.cpp')
-rw-r--r--src/libs/utils/treemodel.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libs/utils/treemodel.cpp b/src/libs/utils/treemodel.cpp
index 249c5e875e2..dda0d6f2e6c 100644
--- a/src/libs/utils/treemodel.cpp
+++ b/src/libs/utils/treemodel.cpp
@@ -725,6 +725,17 @@ void TreeItem::removeChildren()
}
}
+void TreeItem::sortChildren(const std::function<bool(const TreeItem *, const TreeItem *)> &cmp)
+{
+ if (m_model) {
+ m_model->layoutAboutToBeChanged();
+ std::sort(m_children.begin(), m_children.end(), cmp);
+ m_model->layoutChanged();
+ } else {
+ std::sort(m_children.begin(), m_children.end(), cmp);
+ }
+}
+
void TreeItem::update()
{
if (m_model) {