Bug 496874 - column size is not the same after saving and reopening the project
Summary: column size is not the same after saving and reopening the project
Status: RESOLVED FIXED
Alias: None
Product: calligraplan
Classification: Applications
Component: usability (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dag Andersen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-30 18:18 UTC by miko
Modified: 2025-12-17 22:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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