You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The official API documentation for KDGantt suggests using ItemDataRole::ItemTypeRole as the role when setting the ItemType through the QStandardItemModel::setData(). However, when implementing this in practice, setting ItemType with ItemTypeRole does not work as expected and leads to rendering errors in the Gantt chart as below:
Steps to Reproduce
Open the example file <PathToKDChart>\examples\Gantt\legend_example\mainwindow.cpp and modify line 236 to:
Items with Task/Event/Summary type should be rendered correctly in the graphics scene when setting the role with KDGantt::ItemTypeRole.
Or if I misunderstood the documentation and this is a by-design behavior? If so, please provide more detailed explanation why we should assign role with other values (as far as I know, Qt::DisplayRole and Qt::EditRole work well) instead of the more semantics KDGantt::ItemTypeRole.
Actually, I found it necessary to set role as KDGantt::StartTimeRole or KDGantt::EndTimeRole when setting data for start/end time of a task item. So it's weired and apparently inconsistent if the same API is designed to be used in different ways.
The text was updated successfully, but these errors were encountered:
Description
The official API documentation for KDGantt suggests using
ItemDataRole::ItemTypeRole
as the role when setting theItemType
through theQStandardItemModel::setData()
. However, when implementing this in practice, settingItemType
withItemTypeRole
does not work as expected and leads to rendering errors in the Gantt chart as below:Steps to Reproduce
Open the example file
<PathToKDChart>\examples\Gantt\legend_example\mainwindow.cpp
and modify line 236 to:Run the example application and add any new Entry through the dialog.
Expected Behavior
Items with Task/Event/Summary type should be rendered correctly in the graphics scene when setting the role with KDGantt::ItemTypeRole.
Or if I misunderstood the documentation and this is a by-design behavior? If so, please provide more detailed explanation why we should assign
role
with other values (as far as I know,Qt::DisplayRole
andQt::EditRole
work well) instead of the more semanticsKDGantt::ItemTypeRole
.Actually, I found it necessary to set
role
asKDGantt::StartTimeRole
orKDGantt::EndTimeRole
when setting data for start/end time of a task item. So it's weired and apparently inconsistent if the same API is designed to be used in different ways.The text was updated successfully, but these errors were encountered: