git-svn-id: svn://db.shs.com.ru/libs@237 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2017-06-15 14:31:12 +00:00
parent 10f8898d2e
commit 4e90eef9bc

View File

@@ -1350,10 +1350,12 @@ void Graphic::on_checkGuides_toggled(bool checked) {
void Graphic::updateLegend(bool es) {
if (!ui->widgetLegend->isVisible()) {
emit graphicSettingsChanged();
if (!ui->widgetLegend->isVisibleTo(this)) {
if (es) emit graphicSettingsChanged();
// qDebug() << "skip updateLegend";
return;
}
// qDebug() << "updateLegend" << graphics.size();
leg_update = false;
int ps = 100;
for (int i = 0; i < graphics.size(); i++) {
@@ -1386,16 +1388,17 @@ void Graphic::updateLegend(bool es) {
}
int maxcol = qMax<int>(ui->widgetLegend->width() / ps - 1, 1);
int row = 0, col = 0;
bool lv = ui->widgetLegend->isVisible();
bool lv = ui->widgetLegend->isVisibleTo(this);
ui->widgetLegend->hide();
for (int i = 0; i < graphics.size(); i++) {
ui->layoutLegend->addWidget(graphics[i].pb,row,col);
graphics[i].pb->show();
col++;
if (col > maxcol) {col = 0; row++;}
}
ui->widgetLegend->setVisible(lv);
leg_update = true;
emit graphicSettingsChanged();
if (es) emit graphicSettingsChanged();
}
@@ -1492,8 +1495,9 @@ void Graphic::load(QByteArray ba) {
s >> a; setAntialiasing(a);
s >> a; setBorderInputsVisible(a);
s >> a; setStatusVisible(a);
s >> a; setLegendVisible(a);
s >> a;
s >> graphics;
setLegendVisible(a);
}