Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
9 December 2020
Sometimes a view would like to have more data for a cell than what is in a cell. Examples include:
A view that offers special context menu entries if the cell contains an employee. The text in the cell itself might just be the employee's name, and from that alone, it would be very hard to come to the conclusion that the cell indeed holds an employee.
A delegate that shows an annotation symbol (think cut of corner like in excel) if the data behind the cell is annotated. Again the cell text does not reveal this information.
One way to implement this is for the view or delegate to reach out to the model in question using a regular function call, but that will break in case there are proxy models in between.
This video shows how to obtain the effect by using custom roles.
You can contact us regarding our services at info@kdab.com
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI