Bug 496874

Summary: column size is not the same after saving and reopening the project
Product: [Applications] calligraplan Reporter: miko <mickael.sergent>
Component: usabilityAssignee: Dag Andersen <dag.andersen>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description miko 2024-11-30 18:18:53 UTC
SUMMARY

columns size are not kept when reopened a project 

STEPS TO REPRODUCE
1. open a project 
2. in task editor resize a column (for example allocation one)
2. save project.
3. reopen project 

OBSERVED RESULT

column size for allocation is not the same

EXPECTED RESULT

column size for allocation is  kept


SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  on Debian 12
KDE Plasma Version: 5.103
KDE Frameworks Version: 5.103
Qt Version: 5.15.8

ADDITIONAL INFORMATION
It is 'master' branch, compiled in debug mode (7e8350e8)
Comment 1 miko 2024-11-30 23:25:13 UTC
it seems issue come from wrong index used to stored size, view index is used instead of logicial
Here a possible fix:
diff --git a/src/libs/ui/kptviewbase.cpp b/src/libs/ui/kptviewbase.cpp
index ceff8fe3..82399d97 100644
--- a/src/libs/ui/kptviewbase.cpp
+++ b/src/libs/ui/kptviewbase.cpp
@@ -1790,7 +1790,7 @@ void TreeViewBase::saveContext(const QMetaEnum &map, QDomElement &element, bool
                 QString n = QLatin1String(map.key(h->logicalIndex(i)));
                 if (! n.isEmpty()) {
                     e.setAttribute(QStringLiteral("section-%1").arg(i), n);
-                    e.setAttribute(QStringLiteral("size-%1").arg(i), h->sectionSize(h->logicalIndex(i)));
+                    e.setAttribute(QStringLiteral("size-%1").arg(h->logicalIndex(i)), h->sectionSize(h->logicalIndex(i)));
                 }
             }
         }
Comment 2 Albert Astals Cid 2025-12-17 22:28:08 UTC
Git commit bf1d0f68ebe7b3a89c6c844e683896434bfd9c24 by Albert Astals Cid, on behalf of Mickael Sergent.
Committed on 17/12/2025 at 22:15.
Pushed by aacid into branch 'master'.

M  +1    -1    src/libs/ui/kptviewbase.cpp

https://invent.kde.org/office/calligraplan/-/commit/bf1d0f68ebe7b3a89c6c844e683896434bfd9c24