From 744b88e627c594759d7227917d76a3add42c9e1e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Jun 2013 22:54:08 +0200 Subject: [PATCH] CComponentsForm: fix position of inserted item It's not enough to insert an item object only. Also properties like parent and index must be defined to inserted item to ensure that positions are calculated correctly. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/75fe48043ecf64a160c954643950f8427cad3d63 Author: Thilo Graf Date: 2013-06-23 (Sun, 23 Jun 2013) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 7cba3c969..1cf9ff3ca 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -231,8 +231,13 @@ void CComponentsForm::insertCCItem(const uint& cc_item_id, CComponentsItem* cc_I #ifdef DEBUG_CC printf("[CComponentsForm] %s insert cc_Item not possible, v_cc_items is empty, cc_Item added\n", __FUNCTION__); #endif - }else + }else{ v_cc_items.insert(v_cc_items.begin()+cc_item_id, cc_Item); + cc_Item->setParent(this); + //assign item index + int index = genIndex(); + cc_Item->setIndex(index); + } } void CComponentsForm::removeCCItem(const uint& cc_item_id)