| 164 | } |
| 165 | |
| 166 | bool 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 | |
| 185 | bool WorksheetElement::isVisible() const { |
| 186 | Q_D(const WorksheetElement); |
nothing calls this directly
no test coverage detected