Skip to content
Snippets Groups Projects
Commit 236c22be authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Fix types not showing in memory tree widget

parent 8680885e
No related branches found
No related tags found
2 merge requests!192Fix bugs in ArMem and make disk loading and storing nicer,!188ArMem Updates
......@@ -299,16 +299,18 @@ namespace armarx::armem::gui::memory
(void) level, (void) item;
}
template <class... T>
void TreeWidget::updateContainerItem(
const base::detail::MemoryContainerBase<T...>& container, QTreeWidgetItem* item)
template <class ContainerT>
void TreeWidget::updateContainerItem(const ContainerT& container, QTreeWidgetItem* item)
{
ARMARX_IMPORTANT << "Updating container " << container.id();
updateItemItem(container, item);
item->setText(int(Columns::SIZE), QString::number(container.size()));
if constexpr(std::is_base_of_v<base::detail::AronTyped, base::detail::MemoryContainerBase<T...>>)
// Does not work
if constexpr(std::is_base_of_v<base::detail::AronTyped, ContainerT>)
{
const base::detail::AronTyped& cast = dynamic_cast<const base::detail::AronTyped&>(container);
ARMARX_IMPORTANT << "Updating type of container " << container.id();
const base::detail::AronTyped& cast = static_cast<const base::detail::AronTyped&>(container);
std::string typeName;
if (cast.aronType())
{
......
......@@ -71,8 +71,8 @@ namespace armarx::armem::gui::memory
QTreeWidgetItem* makeItem(const std::string& key, const std::string& levelName, const MemoryID& id);
void updateItemItem(const armem::base::detail::MemoryItem& level, QTreeWidgetItem* item);
template <class... T>
void updateContainerItem(const armem::base::detail::MemoryContainerBase<T...>& container, QTreeWidgetItem* item);
template <class ContainerT>
void updateContainerItem(const ContainerT& container, QTreeWidgetItem* item);
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment