Qt MSSQL check box
-
I am using MSSQL and have a field for if the record is currently active or not that is bit data type. How can I make this show up as a check box instead of it wanting the user to type in a number?
Also, I am using QSqlTableModel and QTableView if that matters.
-
Well, the code for my own "checkable proxy model":/wiki/QSortFilterProxyModel_subclass_to_add_a_checkbox contains a complete example on how to use it. Did you take a look at that? It will show you where to put what piece of code. Using the "CheckableSortFilterProxyModel":/wiki/QSortFilterProxyModel_subclass_for_readonly_columns_columns_with_checkboxes_and_password_columns isn't all that different.
On using a bitfield instead of a boolean: if you only need a single bit from that bitfield (integer, I guess) to display a single checkbox, then that would be a simple change. Creating several columns of checkboxes (one for each bit in the field) is going to be more involved... Which do you need?
-
I had seen your code but only that 1st page I just now found the sample project. I dont have a tree though I am just pulling in a database from SQL so hopefully that will make it simpler and I currently have the field I need to be the checkbox set as a bit type.