-
Notifications
You must be signed in to change notification settings - Fork 22
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
New TreeModel [WIP] #201
New TreeModel [WIP] #201
Conversation
Builds, but a bunch of signals and field ties are broken.
…tion, not SubPath(1)
Each Data()/SetData() was individually tracing the FieldPath before. Now they delegate to GetSubModel(), which should allow simpler access to other helpers, like GetDisplayIcon(), as well.
Also extract some methods from PrimitiveModel.h into a new PrimitiveModel.cpp before it gets out of hand.
Apparently there's no convenient way to tell a list view not to display the text along with the image, so adds a boilerplate header with a delegate class to do just that.
a1a9961
to
d370865
Compare
if (node->IsRepeated()) { | ||
//return node->mapFromSource(node->repeated_model->duplicate(mapToSource(index))); | ||
} | ||
Node *parent = IndexToNode(index.parent()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PLEASE check these; each one of these is capable of returning null, and the safety checks I added only work if you actually verify that I didn't return null.
return QModelIndex(); | ||
QModelIndex TreeModel::duplicateNode(const QModelIndex & index) { | ||
Node *node = IndexToNode(index); | ||
if (node->IsRepeated()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this change. But please just leave the if() commented if it's not being used.
7d433e5
to
cb5f3ce
Compare
This commit breaks almost everything. Successor to #144.
Redoes the ProtoModel family of classes to not know about our specific protos. Disclaimer: some references may still exist, but are unnecessary for the resource tree to function. If I missed any references, they're used by, eg, one of the editor classes.
I am basically finished modifying the Model classes and need to start updating the editors to use zero-based field indexing rather than field numbers. I believe Robert has done this work already, so I decided to stop where I was and create this pull request.
I believe we should be able to consolidate this with Robert's PR and have something pretty close to the finished product.
Currently broken: