Introduce a signal slot for tree item highlight change.
This commit is contained in:
committed by
GitHub
parent
1028345ae6
commit
219a2e0104
@@ -223,6 +223,7 @@ public:
|
||||
Connection connectIcon;
|
||||
Connection connectTool;
|
||||
Connection connectStat;
|
||||
Connection connectHl;
|
||||
|
||||
DocumentObjectData(DocumentItem* docItem, ViewProviderDocumentObject* vpd)
|
||||
: docItem(docItem)
|
||||
@@ -236,6 +237,8 @@ public:
|
||||
std::bind(&DocumentObjectData::slotChangeToolTip, this, sp::_1));
|
||||
connectStat = viewObject->signalChangeStatusTip.connect(
|
||||
std::bind(&DocumentObjectData::slotChangeStatusTip, this, sp::_1));
|
||||
connectHl = viewObject->signalChangeHighlight.connect(
|
||||
std::bind(&DocumentObjectData::slotChangeHighlight, this, sp::_1, sp::_2));
|
||||
//NOLINTEND
|
||||
|
||||
removeChildrenFromRoot = viewObject->canRemoveChildrenFromRoot();
|
||||
@@ -359,6 +362,11 @@ public:
|
||||
for (auto item : items)
|
||||
item->setStatusTip(0, tip);
|
||||
}
|
||||
|
||||
void slotChangeHighlight(bool set, Gui::HighlightMode mode) {
|
||||
for (auto item : items)
|
||||
item->setHighlight(set, mode);
|
||||
}
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <Base/BoundBox.h>
|
||||
#include <Base/Vector3D.h>
|
||||
|
||||
#include "TreeItemMode.h"
|
||||
|
||||
class SbVec2s;
|
||||
class SbVec3f;
|
||||
@@ -359,6 +360,8 @@ public:
|
||||
boost::signals2::signal<void (const QString&)> signalChangeToolTip;
|
||||
/// signal on status tip change
|
||||
boost::signals2::signal<void (const QString&)> signalChangeStatusTip;
|
||||
/// signal on highlight change
|
||||
boost::signals2::signal<void (bool, Gui::HighlightMode)> signalChangeHighlight;
|
||||
//@}
|
||||
|
||||
/** update the content of the ViewProvider
|
||||
|
||||
@@ -62,7 +62,7 @@ void ViewProviderSuppressibleExtension::extensionUpdateData(const App::Property*
|
||||
//update the tree item
|
||||
bool suppressed = ext->Suppressed.getValue();
|
||||
setSuppressedIcon(suppressed);
|
||||
vp->getDocument()->signalHighlightObject(*vp, Gui::HighlightMode::StrikeOut, suppressed, owner, 0);
|
||||
getExtendedViewProvider()->signalChangeHighlight(suppressed, Gui::HighlightMode::StrikeOut);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user