-
Notifications
You must be signed in to change notification settings - Fork 44
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
Use SplitView from QtQuick.Controls 2 for GzSplit #651
Conversation
The one from QtQuick.Controls 1 has been deprecated for a while and has been removed from Qt6. This change is a stepping stone for migrating to Qt6. The new SplitView is significantly different from the previous one and so major changes had to be made. The original GzSplit component was also designed with more capabilities in mind for the future, which complicated the code. This has been simplified: * Instead of determining whether to add a new split for each card added, two splits are hard coded: (1) the main view port (2) the side panel. For every new card added, the code simply checks adds the card to the main view port if its empty. Otherwise, it puts it in the side panel. * Animations have been removed. It was difficult to get consistent behavior with different split sizes. * Card items are returned instead of their names when calling `addCard`. This simplifies the code that searches for items by name * Logic to detect if cards have been collapsed manually by resizing the card has been removed. It's not clear if it is even possible to do this with any of the cards/plugins in Gazebo since the `minimumHeight` constraint would prevent resizing the cards that small. Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
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.
Nice! works great for me. Not sure if it's possible to make the split view handle thinner or change its color to gray but those are minor details that can come later.
src/Application.cc
Outdated
|
||
// Add card to main window | ||
cardItem->setParentItem(splitItem); | ||
// gzdbg << "Adding to:" << splitItem.toString().toStdString() << std::endl; |
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.
remove?
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.
Removed.
/** | ||
* Minimum width of the card pane | ||
*/ | ||
property int cardMinimumWidth: 250; | ||
property alias cardMinimumWidth: content.minimumWidth; |
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 think this we need to update the test for this change:
/github/workspace/src/Plugin_TEST.cc:304: Failure
Expected equality of these values:
propElem->Attribute("type")
Which is: "double"
pluginTypes[propElem->Attribute("key")]
Which is: "int"
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.
Fixed in 2570a75
I opted to ignore card*
properties from being parsed from XML since that wasn't working anyway. Looking at the implementation, I don't think they were intended to be exposed since they are updated internally to collapse/expand the card.
It's possible to change the color and make it thinner, but it causes the mouse area to become thinner as well, which makes it really hard to use. The previous version had a wider mouse area with a thin (1px wide) rectangle display. With the SplitView in QtQuick.Control2, it's not possible to control the mouse area and the displayed rectangle independently. 2570a75 also fixes a failing test in gz-gui/include/gz/gui/qml/Main.qml Lines 30 to 31 in 2570a75
|
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
the noble build picked up some weird warnings:
|
Not sure wht's going on. I can't reproduce this locally. I'm going to try to retrigger the job to see if it happens consistently. |
There's a bug reported on this (https://bugreports.qt.io/browse/QTBUG-122929), and there's a workaround in qt6, so will take a look again after we migrate. |
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #651 +/- ##
==========================================
+ Coverage 68.49% 68.70% +0.21%
==========================================
Files 38 38
Lines 5567 5532 -35
==========================================
- Hits 3813 3801 -12
+ Misses 1754 1731 -23 ☔ View full report in Codecov by Sentry. |
Fixed in c5ea53f |
🎉 New feature
Toward #586
Summary
The SplitView from QtQuick.Controls 1 has been deprecated for a while and has been removed from Qt6. This change is a stepping stone for migrating to Qt6.
The new SplitView is significantly different from the previous one and so major changes had to be made. The original GzSplit component was also designed with more capabilities in mind for the future, which complicated the code. This has been simplified:
Instead of determining whether to add a new split for each card added, two splits are hard coded: (1) the main view port (2) the side panel. For every new card added, the code simply checks adds the card to the main view port if its empty. Otherwise, it puts it in the side panel.
Animations have been removed. It was difficult to get consistent behavior with different split sizes.
Card items are returned instead of their names when calling
addCard
. This simplifies the code that searches for items by nameLogic to detect if cards have been collapsed manually by resizing the card has been removed. It's not clear if it is even possible to do this with any of the cards/plugins in Gazebo since the
minimumHeight
constraint would prevent resizing the cards that small.New SplitView

Old SplitView

Test it
gz gui -c examples/config/layout.config
gz sim camera_sensor.sdf
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.