From 4717e8e8de1ddfe988e2487ef107517cbb6bab58 Mon Sep 17 00:00:00 2001 From: peri4 Date: Thu, 21 Oct 2021 18:48:55 +0300 Subject: [PATCH] graphic fix --- libs/graphic/graphic.cpp | 9 +++++++++ libs/graphic/graphic.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/graphic/graphic.cpp b/libs/graphic/graphic.cpp index ab7ec7a..8c6096c 100644 --- a/libs/graphic/graphic.cpp +++ b/libs/graphic/graphic.cpp @@ -2064,6 +2064,15 @@ void Graphic::setCaption(const QString & str) { } +void Graphic::setGraphicVisible(bool visible, int index) { + graphics[index].visible = visible; + updateLegendChecks(); + if (isFit) on_graphic_buttonAutofit_clicked(); + else if (aupdate) + update(); +} + + void Graphic::setGridEnabled(bool enabled) { ui->graphic_checkGrid->setChecked(enabled); } diff --git a/libs/graphic/graphic.h b/libs/graphic/graphic.h index 32f2581..7145380 100644 --- a/libs/graphic/graphic.h +++ b/libs/graphic/graphic.h @@ -248,7 +248,7 @@ public slots: void setGraphicStyle(const Qt::PenStyle & style) {setGraphicStyle(style, curGraphic);} void setGridStyle(const Qt::PenStyle & style) {grid_pen.setStyle(style); if (aupdate) update();} void setSelectionStyle(const Qt::PenStyle & style) {selpen.setStyle(style);} - void setGraphicVisible(bool visible, int index) {graphics[index].visible = visible; updateLegendChecks(); if (aupdate) update();} + void setGraphicVisible(bool visible, int index); void setGraphicVisible(bool visible) {setGraphicVisible(visible, curGraphic);} void setGraphicLineWidth(double w, int index) {if (qRound(w) == w) graphics[index].pen.setWidth(qRound(w)); else graphics[index].pen.setWidthF(w); updateLegend(); if (aupdate) update();} void setGraphicLineWidth(double w) {setGraphicLineWidth(w, curGraphic);}