Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Models#215

Open
sowelipililimute wants to merge1 commit intoqmlnet:develop
base:develop
Choose a base branch
Loading
fromsowelipililimute:work/cblack/qmodels

Conversation

sowelipililimute
Copy link

@sowelipililimutesowelipililimute commentedAug 3, 2020
edited
Loading

This PR implements the minimum recommended APIs necessary to implement read-only models in C# that can interop with QML, handling 90% of usecases for models.

Depends onqmlnet/qmlnet-native#1.

vadi2 reacted with thumbs up emoji
@sowelipililimutesowelipililimute marked this pull request as ready for reviewAugust 16, 2020 03:24
@sowelipililimutesowelipililimute changed the titleWIP ModelsModelsAug 16, 2020
@sowelipililimute
Copy link
Author

Ping?

@pauldotknopf
Copy link
Member

Oh, sorry, I didn't realize this was ready for review. I will try to get to it this week, this weekend at the latest.

@pauldotknopf
Copy link
Member

It's not required on your part, but if you have time, I'd like to see some unit tests that both test and demonstrate what you've done.

By the way, good work!

@pauldotknopf
Copy link
Member

It looks like the native code is failing a build on Windows.

@pauldotknopf
Copy link
Member

NetAbstractItemModelRoleNames.cpp..\QmlNet\QmlNet\qml\NetAbstractItemModelRoleNames.cpp(3): error C7555: use of designated initializers requires at least '/std:c++latest'..\QmlNet\QmlNet\qml\NetQModelIndex.cpp(7): error C7555: use of designated initializers requires at least '/std:c++latest'..\QmlNet\QmlNet\qml\NetQModelIndex.cpp(12): error C7555: use of designated initializers requires at least '/std:c++latest'NetAbstractItemModel.cppC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(87): warning C4100: 'idx': unreferenced formal parameterC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(94): warning C4100: 'idx': unreferenced formal parameter..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(7): error C7555: use of designated initializers requires at least '/std:c++latest'..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(43): warning C4190: 'net_abstract_item_model_get_flags' has C-linkage specified, but returns UDT 'std::function<int (ModelIdx)>' which is incompatible with CC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(13): note: see declaration of 'std::function<int (ModelIdx)>'..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(44): warning C4190: 'net_abstract_item_model_get_data' has C-linkage specified, but returns UDT 'std::function<Variant (ModelIdx,int)>' which is incompatible with CC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(16): note: see declaration of 'std::function<Variant (ModelIdx,int)>'..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(45): warning C4190: 'net_abstract_item_model_get_header_data' has C-linkage specified, but returns UDT 'std::function<Variant (int,int,int)>' which is incompatible with CC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(19): note: see declaration of 'std::function<Variant (int,int,int)>'..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(46): warning C4190: 'net_abstract_item_model_get_row_count' has C-linkage specified, but returns UDT 'std::function<int (ModelIdx)>' which is incompatible with CC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(13): note: see declaration of 'std::function<int (ModelIdx)>'..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(47): warning C4190: 'net_abstract_item_model_get_column_count' has C-linkage specified, but returns UDT 'std::function<int (ModelIdx)>' which is incompatible with CC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(13): note: see declaration of 'std::function<int (ModelIdx)>'..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(48): warning C4190: 'net_abstract_item_model_get_index' has C-linkage specified, but returns UDT 'std::function<ModelIdx (int,int,ModelIdx)>' which is incompatible with CC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(28): note: see declaration of 'std::function<ModelIdx (int,int,ModelIdx)>'..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(49): warning C4190: 'net_abstract_item_model_get_parent' has C-linkage specified, but returns UDT 'std::function<ModelIdx (ModelIdx)>' which is incompatible with CC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(31): note: see declaration of 'std::function<ModelIdx (ModelIdx)>'..\QmlNet\QmlNet\qml\NetAbstractItemModel.cpp(50): warning C4190: 'net_abstract_item_model_get_role_names' has C-linkage specified, but returns UDT 'std::function<NetHashTypeContainer *(void)>' which is incompatible with CC:\projects\qmlnet\src\native\QmlNet\QmlNet\qml\NetAbstractItemModel.h(34): note: see declaration of 'std::function<NetHashTypeContainer *(void)>'Generating Code...jom: C:\projects\qmlnet\src\native\build\Makefile.Release [release\NetQModelIndex.obj] Error 2jom: C:\projects\qmlnet\src\native\build\Makefile.Release [release\NetAbstractItemModelRoleNames.obj] Error 2jom: C:\projects\qmlnet\src\native\build\Makefile [release-install] Error 2

@sowelipililimute
Copy link
Author

@pauldotknopf
Copy link
Member

Merged.

@sowelipililimute
Copy link
Author

looks like this builds now

@vadi2
Copy link
Contributor

How does this change the API of working with models?

@sowelipililimute
Copy link
Author

How does this change the API of working with models?

This exposes the usual slew of Qt model classes, which allows them to be used from C#. I would recommend reading Qt docs:https://doc.qt.io/qt-5/model-view-programming.html

@vadi2
Copy link
Contributor

I've been using those for a decade so I'm pretty familiar, but there is no documentation here - add examples how it would look?

@sowelipililimutesowelipililimuteforce-pushed thework/cblack/qmodels branch 2 times, most recently from585f8d9 to841ad96CompareOctober 7, 2021 08:24
@sowelipililimute
Copy link
Author

I've been using those for a decade so I'm pretty familiar, but there is no documentation here - add examples how it would look?

doc comments added

@vadi2
Copy link
Contributor

thank you

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@sowelipililimute@pauldotknopf@vadi2

[8]ページ先頭

©2009-2025 Movatter.jp