comparison view/View.cpp @ 268:70537b0434c4

* Use a command for adding layer measurements
author Chris Cannam
date Tue, 26 Jun 2007 11:08:21 +0000
parents 4ed1446ad604
children 7b58c5e91f20
comparison
equal deleted inserted replaced
267:4ed1446ad604 268:70537b0434c4
464 464
465 connect(layer, SIGNAL(layerParametersChanged()), 465 connect(layer, SIGNAL(layerParametersChanged()),
466 this, SLOT(layerParametersChanged())); 466 this, SLOT(layerParametersChanged()));
467 connect(layer, SIGNAL(layerParameterRangesChanged()), 467 connect(layer, SIGNAL(layerParameterRangesChanged()),
468 this, SLOT(layerParameterRangesChanged())); 468 this, SLOT(layerParameterRangesChanged()));
469 connect(layer, SIGNAL(layerMeasurementRectsChanged()),
470 this, SLOT(layerMeasurementRectsChanged()));
469 connect(layer, SIGNAL(layerNameChanged()), 471 connect(layer, SIGNAL(layerNameChanged()),
470 this, SLOT(layerNameChanged())); 472 this, SLOT(layerNameChanged()));
471 connect(layer, SIGNAL(modelChanged()), 473 connect(layer, SIGNAL(modelChanged()),
472 this, SLOT(modelChanged())); 474 this, SLOT(modelChanged()));
473 connect(layer, SIGNAL(modelCompletionChanged()), 475 connect(layer, SIGNAL(modelCompletionChanged()),
779 void 781 void
780 View::layerParameterRangesChanged() 782 View::layerParameterRangesChanged()
781 { 783 {
782 Layer *layer = dynamic_cast<Layer *>(sender()); 784 Layer *layer = dynamic_cast<Layer *>(sender());
783 if (layer) emit propertyContainerPropertyRangeChanged(layer); 785 if (layer) emit propertyContainerPropertyRangeChanged(layer);
786 }
787
788 void
789 View::layerMeasurementRectsChanged()
790 {
791 Layer *layer = dynamic_cast<Layer *>(sender());
792 if (layer) update();
784 } 793 }
785 794
786 void 795 void
787 View::layerNameChanged() 796 View::layerNameChanged()
788 { 797 {
1629 } 1638 }
1630 1639
1631 void 1640 void
1632 View::drawMeasurementRect(QPainter &paint, const Layer *topLayer, QRect r) const 1641 View::drawMeasurementRect(QPainter &paint, const Layer *topLayer, QRect r) const
1633 { 1642 {
1643 // std::cerr << "View::drawMeasurementRect(" << r.x() << "," << r.y() << " "
1644 // << r.width() << "x" << r.height() << ")" << std::endl;
1645
1634 if (r.x() + r.width() < 0 || r.x() >= width()) return; 1646 if (r.x() + r.width() < 0 || r.x() >= width()) return;
1635 1647
1636 int fontHeight = paint.fontMetrics().height(); 1648 int fontHeight = paint.fontMetrics().height();
1637 int fontAscent = paint.fontMetrics().ascent(); 1649 int fontAscent = paint.fontMetrics().ascent();
1638 1650