Implement support for further grouping by category in Library (HVAC, Schedules, etc)#713
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
1. implement OSCategoryPlaceholder class for further grouping inside OSCollapsibleItemList 2. Modification to search bar to use category in addition to type and name.
jmarrec
left a comment
There was a problem hiding this comment.
Alright, this is neat, thanks a lot @manuvarkey
I do question whether we shouldn't use an actual OSCollapsibleItemHeader directly, so we can expand it or not.
Here is a demo of the current code:
| void OSCollapsibleItemList::addCategoryPlaceholderItem(OSCategoryPlaceholder* categoryPlaceholderItem) { | ||
|
|
||
| m_placeholderItems.push_back(categoryPlaceholderItem); | ||
| m_vLayout->insertWidget(0, categoryPlaceholderItem); | ||
| } |
There was a problem hiding this comment.
@macumber This makes me realize we have a std::vector<OSCollapsibleItem*> m_collapsibleItems; but our void OSCollapsibleItemList::addCollapsibleItem(OSCollapsibleItem* collapsibleItem) does not add to it... even though other functions loop on it...
There was a problem hiding this comment.
Hmm, yeah looks like we never add anything to m_collapsibleItems so it's kind of useless.
|
We did discuss adding a second level of expanding headers in #123 but I steered @manuvarkey towards the solution he implemented because I thought the multiple levels of collapsable headers would get complicated. I updated the code to compile, changed the style of the placeholder, and added categories to all the tabs. What do you think? |
|
The style looks great. And I can understand the rationale behind too much grouping = confusing. LGTM, feel free to merge at will! |
| this->setProperty("style", "0"); | ||
| this->setStyleSheet("QWidget#OSCategoryPlaceholder[style=\"0\"] { background-color: #95B3DE; border-bottom: 1px solid black; }"); |
There was a problem hiding this comment.
More of a side note than anything, but I wonder when we should just inline styles versus using the qss stylesheet. @macumber do you have rules for this?
OpenStudioApplication/src/openstudio_lib/openstudiolib.qss
Lines 989 to 995 in a9b492b
There was a problem hiding this comment.
I'm always torn between trying to write documentation and rules for what exists vs burn it all down and start over. I think it would make the most sense to have all styes in qss files, but that would require a sensible naming hierarchy everywhere. It gets hard when a name changes and the styles don't apply to some tab anymore.


OSCategoryPlaceholderclass for further grouping insideOSCollapsibleItemList