-
-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playground QskDataControlMapper #394
Conversation
Your class seems to work with QObject - not only for QskControl. What do you think about being more expressive with the class name. Model might be better than Data. I'm also not sure about "mapper" - the term "binding" has been established with QML and - since Qt6 - we also have property bindings for C++. The class is inspired from QDataWidgetMapper and its implementation will have similarities with the code from qdatawidgetmapper.cpp. However the code in this pull request is obviously copied in parts. Please replace these parts by your own implementation - otherwise the complete project would be affected by the rules of the GPL. I created #395 for the missing USER attribute. Pull requests are welcome. |
Please check the commits in your branch. The mail address being used needs to be known to github - otherwise the CLA check of github fails. |
I completely forgot I copied some parts, sorry for that, was a few years ago. Now I rewrote most things and improved the code in various ways. I renamed the class to QskModelObjectBinder... What do you think? |
I did some adjustments and moved the code to a feature branch: https://github.com/uwerat/qskinny/tree/features/modelobjectbinder. ( I missed your last commit - please do it once more for the modified code ). I also created a pull request for the feature branch ( #397 ) that is intended to have further discussions and/or reviews. Please rebase your working environment. |
This new class resembles the equivalent in Qt Widgets of
QDataWidgetMapper
It is useful when working with forms with database records with multiple fields.
One thing I've noticed is that QskTextInput & co. don't have the
Q_PROPERTY
optionUSER true
for the value or text property, I've set them in this pull request but maybe not necessary.I added a small example in the playground that could be further expanded with other goodies. I'm using some other controls in production like ListView and ComboBox with QAbstractItemModel support. Not sure how I could propose them here since they need some customization to the skins.