-
Notifications
You must be signed in to change notification settings - Fork 202
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
MAYA-102330 Add UI to display the number of selected prims and changed variants #675
Conversation
… of modified variants in both the Hierarchy View and the Import dialog options UI. MAYA-102330 Add reset button to the file dialog MAYA-105783 Adding Help menu for the Hierarchy View
rowLayout -numberOfColumns 3 -cw 1 $cw1 -cat 1 "right" 0 -cal 1 "right" mayaUsd_NBPrimsInScopeRL; | ||
text -label ""; | ||
text -label $nbPrimsInScopeLabel; | ||
text -label "---" mayaUsd_NBPrimsInScopeLabel; | ||
setParent ..; |
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.
I added an empty text label at the start of these rowLayouts because it was just easier to line up with the UI above it.
@@ -118,6 +118,7 @@ void ItemDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, cons | |||
if (nullptr != treeItem) | |||
{ | |||
treeItem->setVariantSelectionModified(); | |||
Q_EMIT variantModified(); |
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.
I guess I could have cast the model pointer that is passed into this function to a TreeModel and told it directly to update its count (which is what this signal will end up triggering), but I was already hooking up signal/slots to make sure all the UI gets updated correctly so also doing this with a signal made sense.
Help menu in the Hierarchy View dialog.
Might not be called from anywhere, but noticed a typo in ImportData::hasVariantSelections that I fixed.
I think we were leaking every ItemDelegate we created. Qt docs say that QAbstractItemView::setItemDelegate does not take ownership of the delegate you pass to it but we were calling it like it would.
Made the checkbox column not resizable.
Main part:
Adding UI to display a couple counts as information to the user. One is the total number of prims that are checked, and the other is the number of variants that have been modified and are checked. This info is displayed both in the Hierarchy View and also the file dialog import options after exiting the HV.
In the file dialog import options we also added a button to reset the import data.
The model is responsible for doing all of the counting.
The model sends signals to the dialog when it has updated the counts and the dialog will update the labels that display the info.
The delegate is where the editing of the variants happens so I connect it to the model with a signal/slot so that updating a variant will trigger the model to update the count.
The file dialog options UI just needs to display the same #’s that the Hierarchy View was displaying, so I store those two #’s in the ImportData and then added a couple query flags to the command so the options UI can get at it.