Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QTableVew + QsqlTableModel + Edition of date and double values
bulant last edited by
Hi all Qt gurus and fans,
I'm new in the Qt world, and very exiting to start developing on it, this is my first post, but not my last...
Here is my problem:
I have QTableVew with an QsqlTableModel of one table in my DB that has 4 columns, the first one is foreing key, the second is a text, the third is a date and the last one is a double value.
For editing this table i have extended QSqlRelationalDelegate with my own class (MyDelegate), in order to use a combo box to edit the second column, and to have out of the box editing functionality for the foreign key edition, as well as the last two columns, the application is running well, but there is a litle detail that is not letting me sleep at night...
- The editor of the double value (last column), only allows me to put 2 decimals, and i need to put more
- The editor of the date value (third column), only allows me to enter values in the fixed format of dd/mm/yy which is a problem because if I enter 5/5/55 (for example), it automatically thins that the year is 2055, but I want it to be 1955, or 1855... I need that edition would be done with dd/mm/yyyy format...
Is it some set function of the delegators I could use in order to change the behavior of default editors for date and double values? or I have to overwrite the methods (as i did for the combo box) in order to get the behavior i want?
It would be nice the first option, because the default editors allready ignore invalid key, like letters or symbols that are not numbers...
Thanks in advance!