| 874 | } |
| 875 | |
| 876 | void InfoElement::updateValid() { |
| 877 | Q_D(InfoElement); |
| 878 | bool valid = false; |
| 879 | for (const auto& mp : markerpoints) { |
| 880 | if (mp.curve && mp.curve->xColumn() && mp.curve->yColumn()) |
| 881 | valid = true; // at least one valid curve |
| 882 | } |
| 883 | |
| 884 | d->valid = valid; |
| 885 | |
| 886 | Lock lock(m_suppressVisibleChange); |
| 887 | m_title->setUndoAware(false); |
| 888 | m_title->setVisible(valid); |
| 889 | m_title->setUndoAware(true); |
| 890 | |
| 891 | if (valid) { |
| 892 | for (auto& mp : markerpoints) { |
| 893 | if (mp.curve && mp.curve->xColumn() && mp.curve->yColumn()) { |
| 894 | mp.customPoint->setUndoAware(false); |
| 895 | mp.customPoint->setVisible(mp.visible); |
| 896 | mp.customPoint->setUndoAware(true); |
| 897 | } |
| 898 | } |
| 899 | } else { |
| 900 | for (auto& mp : markerpoints) { |
| 901 | mp.customPoint->setUndoAware(false); |
| 902 | mp.customPoint->setVisible(false); |
| 903 | mp.customPoint->setUndoAware(true); |
| 904 | } |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | // ############################################################################## |
| 909 | // ###### SLOTs for changes triggered via QActions in the context menu ######## |
no test coverage detected