Skip to content
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

Closed
wants to merge 9 commits into from
Closed

Conversation

ovenpasta
Copy link
Contributor

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 option USER 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.

@CLAassistant
Copy link

CLAassistant commented Feb 22, 2024

CLA assistant check
All committers have signed the CLA.

@uwerat
Copy link
Owner

uwerat commented Feb 23, 2024

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.

@uwerat
Copy link
Owner

uwerat commented Feb 23, 2024

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.

@ovenpasta
Copy link
Contributor Author

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?

@uwerat
Copy link
Owner

uwerat commented Feb 25, 2024

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.

@uwerat uwerat closed this Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants