QwtLinearScaleEngine::setAtribute
C++ (Qt)QwtLinearScaleEngine *scale = new QwtLinearScaleEngine;scale->setAttribute(QwtLinearScaleEngine::IncludeReference);scale->setReference(min);...
C++ (Qt) d_thermo = new QwtThermo(this); d_thermo->setOrientation(Qt::Horizontal); d_thermo->setScalePosition(QwtThermo::LeadingScale); double min = 1e-10; double max = 1e-8; QwtLinearColorMap *colorMap = new QwtLinearColorMap(); colorMap->setMode(QwtLinearColorMap::FixedColors); colorMap->addColorStop(0.0,QColor("green")); colorMap->addColorStop((0.8*max)/(max-min),QColor("yellow")); colorMap->addColorStop((0.98*max)/(max-min),QColor("red")); d_thermo->setColorMap(colorMap); QwtLinearScaleEngine *scale = new QwtLinearScaleEngine; scale->setAttribute(QwtLinearScaleEngine::IncludeReference); scale->setAttribute(QwtLinearScaleEngine::Inverted); scale->setReference(0.0); d_thermo->setScaleEngine(scale);//d_thermo->setScaleEngine(new QwtLinearScaleEngine); d_thermo->setScaleMaxMinor(5); d_thermo->setScaleMaxMajor(2); d_thermo->setScale(min,max); d_thermo->setValue(start_value); d_wheel = new QwtWheel(this); d_wheel->setRange(-11,-4); d_wheel->setValue(-8); d_wheel->setOrientation(Qt::Horizontal); d_wheel->setSingleStep(1); d_label = new QLabel(this); setNum(d_wheel->value()); connect(d_wheel,SIGNAL(valueChanged(double)),this,SLOT(setNum(double))); connect(d_wheel,SIGNAL(valueChanged(double)),this,SLOT(setScale(double))); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(d_thermo); layout->addWidget(d_wheel); layout->addWidget(d_label);