##// END OF EJS Templates
Remove unused pending request of worker since it's already in the VC....
Remove unused pending request of worker since it's already in the VC. Fix bug with progress asynchrone computation

File last commit:

r1375:8614c945da0f
r1395:b136e07f06a8
Show More
VisualizationSelectionZoneManager.cpp
54 lines | 1.6 KiB | text/x-c | CppLexer
/ gui / src / Visualization / VisualizationSelectionZoneManager.cpp
multi selection of zones
r1089 #include "Visualization/VisualizationSelectionZoneManager.h"
#include "Visualization/VisualizationSelectionZoneItem.h"
struct VisualizationSelectionZoneManager::VisualizationSelectionZoneManagerPrivate {
QVector<VisualizationSelectionZoneItem *> m_SelectedItems;
};
VisualizationSelectionZoneManager::VisualizationSelectionZoneManager()
: impl{spimpl::make_unique_impl<VisualizationSelectionZoneManagerPrivate>()}
{
}
void VisualizationSelectionZoneManager::select(
const QVector<VisualizationSelectionZoneItem *> &items)
{
clearSelection();
for (auto item : items) {
setSelected(item, true);
}
}
void VisualizationSelectionZoneManager::setSelected(VisualizationSelectionZoneItem *item,
bool value)
{
if (value != item->selected()) {
item->setSelected(value);
Add action to remove the selected zone with the "del" buttons
r1117 item->parentPlot()->replot(QCustomPlot::rpQueuedReplot);
multi selection of zones
r1089 }
if (!value && impl->m_SelectedItems.contains(item)) {
impl->m_SelectedItems.removeAll(item);
}
else if (value) {
impl->m_SelectedItems << item;
}
}
void VisualizationSelectionZoneManager::clearSelection()
{
for (auto item : impl->m_SelectedItems) {
item->setSelected(false);
Fix bug with null parent of selectedItem
r1375 auto parentPlot = item->parentPlot();
if (parentPlot) {
parentPlot->replot(QCustomPlot::rpQueuedReplot);
}
multi selection of zones
r1089 }
impl->m_SelectedItems.clear();
}
QVector<VisualizationSelectionZoneItem *> VisualizationSelectionZoneManager::selectedItems() const
{
return impl->m_SelectedItems;
}