ZoomWidget::ZoomWidget(QWidget *parent)
: QWidget(parent),
+ zoom(new QDoubleSpinBox),
max_zoom_size(10000)
{
- zoom.setRange(0.01, max_zoom_size);
- zoom.setSingleStep(0.1);
- connect(&zoom, SIGNAL(valueChanged(double)), this, SLOT(setValue(double)));
+ zoom->setRange(0.01, max_zoom_size);
+ zoom->setSingleStep(0.1);
+ connect(zoom, SIGNAL(valueChanged(double)), this, SLOT(setValue(double)));
- auto_ptr<QLabel> zoomLabel(new QLabel());
+ QLabel *zoomLabel = new QLabel();
zoomLabel->setPixmap(QIcon(":/icons/viewmag.png").pixmap(16, 16));
QHBoxLayout *layout = new QHBoxLayout;
- layout->addWidget(zoomLabel.get());
- layout->addWidget(&zoom);
+ layout->addWidget(zoomLabel);
+ layout->addWidget(zoom);
layout->addWidget(new QLabel("bp/pix"));
setLayout(layout);
if (cur_value != value)
{
cur_value = value;
- zoom.setValue(cur_value);
+ zoom->setValue(cur_value);
emit valueChanged(cur_value);
}
}
void ZoomWidget::setRange(double min, double max)
{
- zoom.setRange(min, max);
+ zoom->setRange(min, max);
}
void ZoomWidget::setSingleStep(double val)
{
- zoom.setSingleStep(val);
+ zoom->setSingleStep(val);
}
double ZoomWidget::singleStep() const
{
- return zoom.singleStep();
+ return zoom->singleStep();
}
double ZoomWidget::minimum() const
{
- return zoom.minimum();
+ return zoom->minimum();
}
double ZoomWidget::maximum() const
{
- return zoom.maximum();
+ return zoom->maximum();
}