HamedMasafi / Nut

Advanced, Powerful and easy to use ORM for Qt
GNU Lesser General Public License v3.0
294 stars 75 forks source link

Support for column alias in the toModel #73

Closed martonmiklos closed 4 years ago

martonmiklos commented 4 years ago

Hi @HamedMasafi

Having a toModel method is very conveinent for creating queries which is displayed in a QTableView. However I think having ability to customize the column headers is necessary in the most cases.

I am thinking about implementing an intermediate class (derived from the QSqlQueryModel) which would override the headerData method, and the overridden header data could be set through the Query::setColumnName(Field, alias).

How does this sounds for you?

HamedMasafi commented 4 years ago

Custom header text can be done with NUT_DISPLAY_NAME But the modal scenario will be changed in later