Brief description of class still missing. More...
#include <DoubleSpinBox.h>
Public Member Functions | |
| DoubleSpinBox (QWidget *parent=0) | |
| double | value (double expectedValue) const |
| double | value () const |
Protected Member Functions | |
| virtual void | wheelEvent (QWheelEvent *event) |
Brief description of class still missing.
Full description of class still missing
| QGpGuiTools::DoubleSpinBox::DoubleSpinBox | ( | QWidget * | parent = 0 | ) |
Description of constructor still missing
References QGpCoreTools::tr(), and TRACE.
: QDoubleSpinBox(parent)
{
TRACE;
switch(rand()%3) {
default:
setToolTip(tr("Need more precision? Press ALT while rolling wheel button."));
break;
case 1:
setToolTip(tr("Need a smaller step? Press SHIFT while rolling wheel button."));
break;
case 2:
setToolTip(tr("Need a temporary bigger step? Press CTRL while rolling wheel button."));
break;
}
}
| double QGpGuiTools::DoubleSpinBox::value | ( | double | expectedValue | ) | const |
Return the current value. If expectedValue is within the current precision of current value, the expected value is returned rather than the rounded current value.
References value().
Referenced by ToolHRFK::parameters(), SciFigs::NameLineDelegate::setModelData(), SourceDelegate::setModelData(), SciFigs::LegendTableDelegate::setModelData(), GeopsyGui::RingEditorDelegate::setModelData(), and SciFigs::LayerPropertiesDelegate::setModelData().
| double QGpGuiTools::DoubleSpinBox::value | ( | ) | const [inline] |
Referenced by value().
{return QDoubleSpinBox::value();}
| void QGpGuiTools::DoubleSpinBox::wheelEvent | ( | QWheelEvent * | event | ) | [protected, virtual] |
Let user change the precision and step (alt and shift, respectively)
References QGpCoreTools::tr(), and TRACE.
{
TRACE;
if(event->modifiers() & Qt::ShiftModifier) {
if(event->delta() > 0) {
setSingleStep(singleStep()*10.0);
} else {
if(singleStep()>=pow(0.1,decimals()-1)) {
setSingleStep(singleStep()*0.1);
}
}
showToolTip(tr("Step=%1").arg(singleStep()));
event->accept();
} else if(event->modifiers() & Qt::AltModifier) {
if(event->delta() > 0) {
setDecimals(decimals()+1);
} else {
setDecimals(decimals()-1);
}
showToolTip(tr("Decimals=%1").arg(decimals()));
event->accept();
} else {
QDoubleSpinBox::wheelEvent(event);
}
}