QtitanDataGridModel-view DataGrid component with rich functionality for Qt.C++ and PySideQtitanRibbonReplicates Microsoft RibbonUI interface for Qt.C++ and PySideQtitanNavigationDesignUIReplicates Microsoft Navigation Design interface for Qt.C++ and PySideQtitanChartCharts and Diagrams component for Qt.C++ and PySideQtitanDockingDockable Panels and Tool Bars for Qt.C++ and PySideQtitanFastInfosetXML Compressed format FastInfoset implementation for Qt.C++ and PySideRoadmap Development 2023
FireDataGridPowerful, modern, fast, DB-Aware Grid for Delphi-FiremonkeyFireDockingDelphi IDE/Visual Studio implementation of dock panels for Delphi-Firemonkey
How can i make a cell readonly? I try to set the flags for this cell to Qt::NoItemFlags or only to Qt::ItemIsSelectable but when i doubleclick into the cell i get an exception, because i have not define editdata for these cell.
Thanks
This asert means that at the beginning of the cell editing grid was unable to convert the value obtained from your model to the type that your cell editor is expected.
You need to ensure that the value obtained from the model using the EditRole role to be the same type as the QVariant returned by GridEditorRepository::defaultValue(EditRole).
P.S. The defaultValue is used when you add row to the grid (for example) and grid fills known cells by default values.
So there is no data for editing. I found in your code in QtnGridTableView in line 2538 the check,
if (!column->editorRepository()->isEditable())
return true;
but you didn't check the flag. So I can't make an individual cell readonly.
Therefore I make a derived class of your class Grid. I overwrite the method cellClicked and insert the following code: