MCPcopy Create free account
hub / github.com/KDE/labplot / swapVisible

Method swapVisible

src/backend/worksheet/WorksheetElement.cpp:166–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166bool WorksheetElementPrivate::swapVisible(bool on) {
167 bool oldValue = isVisible();
168
169 // When making a graphics item invisible, it gets deselected in the scene.
170 // In this case we don't want to deselect the item in the project explorer.
171 // We need to supress the deselection in the view.
172 auto* worksheet = static_cast<Worksheet*>(q->parent(AspectType::Worksheet));
173 if (worksheet) {
174 worksheet->suppressSelectionChangedEvent(true);
175 setVisible(on);
176 worksheet->suppressSelectionChangedEvent(false);
177 } else
178 setVisible(on);
179
180 Q_EMIT q->changed();
181 Q_EMIT q->visibleChanged(on);
182 return oldValue;
183}
184
185bool WorksheetElement::isVisible() const {
186 Q_D(const WorksheetElement);

Callers

nothing calls this directly

Calls 2

parentMethod · 0.45

Tested by

no test coverage detected