HamedMasafi / Nut

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

Add optional parent argument to Query::toModel #62

Closed martonmiklos closed 4 years ago

martonmiklos commented 4 years ago

Hi @HamedMasafi

During the usage of the Query::toModel I was wondering if it would be helpful to pass a QObject *parent = nullptr argument to it to make that object to be the parent of the created model here: https://github.com/HamedMasafi/Nut/blob/master/src/query.h#L592

This would make the created model destruction easily manageable through the QObject destruction process. What do you think about this idea? If you like it I can came up with a PR.

HamedMasafi commented 4 years ago

Hi @martonmiklos ATM I have no idea for toModel part, I have no plan for using QSqlQueryModel or Nut::SqlModel So I've keep it to later. I'm busy with new commit of nut that many Table macros will gone. In new model user can create regular qobject based class with Q_PROPERTY. You are free to PR but model scenario may be changed later