-
Notifications
You must be signed in to change notification settings - Fork 63
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
Implements Tri-State checkboxes on Tailoring screen. #113
Conversation
Closes #112 Signed-off-by: Wesley Ceraso Prudencio <wcerasop@redhat.com>
@openscap-jenkins retest this please |
@openscap-jenkins retest this please |
This is pretty cool and seems to be working well. It is however very slow. Could we make it faster? I suspect it's probably the repeated wasted redraws that's making it slow. If we can't make it faster we should at least show a busy cursor to let the user know we are doing something and the app hasn't crashed. |
@yuumasato I would appreciate your review here as well. This is a big change. |
@mpreisler I haven't noticed how slow it was when painting big trees. In fact it was really slow when a big part of the tree is expanded and you check/uncheck the most top item. It's now fixed. |
src/TailoringWindow.cpp
Outdated
@@ -268,6 +268,7 @@ void TailoringWindow::synchronizeProfileItem() | |||
void TailoringWindow::synchronizeTreeItem() | |||
{ | |||
synchronizeTreeItemSelections(mBenchmarkItem); | |||
return; |
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.
?
src/TailoringWindow.cpp
Outdated
@@ -315,6 +322,7 @@ void TailoringWindow::synchronizeTreeItemSelections(QTreeWidgetItem* treeItem) | |||
treeItem->setCheckState(0, Qt::Unchecked); | |||
} | |||
break; | |||
|
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.
?
It's faster now but when I select/deselect it screws up the scroll position and scrolls all the way up. |
It's much better to just disable repainting while you change the tree. That's easier than collapsing and expanding parts of the tree. I think it's setUpdatesEnabled or something like that. |
@mpreisler Yeah, I'll take take a better look at this. |
@mpreisler The problem was not exactly with the painting event, as it can be postponed by setUpdatesEnabled(bool enable), instead, if the treewidget was visible, for each data changed it would recalculate its geometry. |
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.
These checkboxes are really cool.
I noticed that the default profile shows empty groups as selected, I think they should be not selected.
src/TailoringWindow.cpp
Outdated
// https://github.com/qt/qt/blob/4.8/src/gui/itemviews/qabstractitemview.cpp#L3190 | ||
mUI.itemsTree->setVisible(false); | ||
synchronizeTreeItemSelections(mBenchmarkItem); | ||
mUI.itemsTree->setVisible(true); |
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, make it clearer that we are making it invisible and visible again due to perceived slowness when changing state of long trees.
@yuumasato Empty groups are checked by default so that their parents can be checked, instead of partially checked, in the case all their siblings are checked as well. |
@WesleyCeraso That makes sense. |
Closes #112
Signed-off-by: Wesley Ceraso Prudencio wcerasop@redhat.com