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
I'm having difficulty getting the QtitanDataGrid to display icons using Qt::DecorationRole when connected to a QAbstractItemModel and to get the column functions working (sum, average, etc.)
I've created a working example of the problem which I've attached - it's called "icondecoration". It's based on the demo project fixedcolumns. You should be able to drop it into the "demos/grid" directory, add it to qtitangrid.pro and put an icon in place.
I wasn't able to include the icon I was using as it's copyrighted, but you should be able to drop any icon in place (in the working directory where you execute from) and it should work. Just change the code to refer to the correct icon name. If you don't see your icon in the top left corner (see the yellow box in the attached screenshot), then your icon isn't working properly.
In the screenshot you'll see a QtitanDataGrid with a QTableView below it - both are pointing at the same model, which is in window.h and is called CDummyModel (inherits from QAbstractItemModel).
You'll notice in the screenshot that the QTableView is displaying the icons, but the QtitanDataGrid isn't. Also I wasn't able to get the column functions to work (like sum, average) - only count seems to work. The model is just returning "10".
I'm on Windows 7, Qt 4.7.4, QtitanDataGrid 2.4 (custom build against Qt4.7.4, MSVC2008 using QtCreator 2.1.0).
I'm sure that I'm doing something wrong. I would be very interested to hear if anyone can get my example working and if they see the same or different behaviour.
This is causing my app not to display icons in the tables (at least 3 now) and it's going to start becoming a problem soon. I really don't want to go back to QTableView!
We have received your demo sample by email a few days ago, and this error (icons) has been corrected. Fix will be available in the nearest version (most likely in Monday).
About summaries - your model has not provide edit role, so the column has string editor instead of integer editor which can operate with Sum, Avg and etc. algorithms. Therefore to assign to the column integer editor directly you need call this code:
In the next version we have changed this behavior so that the automatic determination of the editor's type has worked for models that do not support edit role.