| 1945 | } |
| 1946 | |
| 1947 | void MainWindow::syncPanelPreviewDisplay() { |
| 1948 | // A plugin toolbox panel (e.g. the Transform Editor plugin) embeds a real |
| 1949 | // PlotWidget inside its chart QFrame. It has no originating plot to mirror, so its |
| 1950 | // preview keeps the PlotWidget default curve style/width; only the global grid |
| 1951 | // toggle is pushed. Reach the plot generically as a child of the presented panel. |
| 1952 | if (current_panel_ == nullptr) { |
| 1953 | return; |
| 1954 | } |
| 1955 | for (auto* plot : current_panel_->findChildren<PlotWidget*>()) { |
| 1956 | // Stash the grid state on the chart frame so the dialog-host binding can re-apply |
| 1957 | // it on every preview rebuild (source/function changes recreate the curves). |
| 1958 | if (QWidget* frame = plot->parentWidget()) { |
| 1959 | frame->setProperty("_pj_view_set", true); |
| 1960 | frame->setProperty("_pj_view_grid", activate_grid_); |
| 1961 | } |
| 1962 | // Apply immediately too, so a grid toggle updates the preview without waiting for |
| 1963 | // the next chart tick. |
| 1964 | plot->setGridVisible(activate_grid_); |
| 1965 | plot->replot(); |
| 1966 | } |
| 1967 | } |
| 1968 | |
| 1969 | namespace { |
| 1970 | // SVG path for the legend button when the legend is at the given corner. |
nothing calls this directly
no test coverage detected