casa
5.7.0-16
|
Base class for QtAutoGui slider interface elements. More...
#include <QtGuiEntry.qo.h>
Signals | |
void | itemValueChanged (QString name, QString value, int action, bool apply) |
Main output signal. More... | |
void | errMsg (casacore::String errmsg) |
class user may wish to connect to and display these. More... | |
Public Member Functions | |
void | setLabelText (QString txt) |
Set interface label text ('listname'). More... | |
QString | name () |
Internal name ('dlformat') More... | |
void | reSet (QDomElement &ele) |
Set up main state (value, etc.) and external appearance of this widget, according to options record (passed as a QDomElement). More... | |
Protected Slots | |
virtual void | slChg (int slval) |
slider changed by user More... | |
virtual void | release () |
virtual void | setOriginal () |
'revert-to-original' selected in menu. More... | |
Protected Member Functions | |
QtSliderBase (QWidget *parent=0) | |
Only for use by derived classes. More... | |
~QtSliderBase () | |
void | constructBase (QDomElement &ele, QSlider *slider, QLabel *nameLabel, QToolButton *menuBtn) |
Derived class should call this within its constructor, after it has a valid QSlider, name QLabel and menu QToolButton (usually, after calling setUi()), passing them down in the parameters below. More... | |
void | getAttr (const QDomElement &ele, QString attnm, double &val) |
Fetch numeric value of attribute of ele named attnm, into val. More... | |
virtual void | updateText ()=0 |
Derived class should implement: set value text box or label (if any) to (normalized) current value. More... | |
int | round (double val) |
double | externalVal (int sldVal) |
Integer values with in [0, slMax_] on the internal slider are scaled to external values within [dMin_, dMax_]. More... | |
int | sliderVal (double extVal) |
QString | toText (double val) |
These two routines convert 'external' values between double and text. More... | |
double | toNumber (QString text, bool *ok=0) |
QString | textVal () |
Current external value, as text. More... | |
void | adjSlIncr () |
Adjusts integer slider range (slMax_) and the increment that each unit on the slider represents (dIncr_), according to latest increment and range request (dIncr0_, dMin_, dMax_). More... | |
void | updateSlider () |
Sets slider to latest range and value (without triggering slider signals or slChg slot below). More... | |
void | emitVal () |
emit current value – widget's main output. More... | |
void | update (double dval) |
Accepts new value (if any), updates interface (without retriggering any internal slots). More... | |
Protected Attributes | |
double | dVal_ |
main state. More... | |
double | dMin_ |
double | dMax_ |
double | dIncr_ |
double | dIncr0_ |
double | slMax_ |
bool | floatrng_ |
Whether this element emits float values (ptype 'floatrange') vs. More... | |
bool | onrelease_ |
Should the event be generated only upon releasing the slider? More... | |
double | origVal_ |
For restoring 'original' value. More... | |
QSlider * | slider_ |
Relevant user interface elements. More... | |
QLabel * | nameLabel_ |
QToolButton * | menuBtn_ |
QString | itemName |
Internal name ('dlformat'). More... | |
Base class for QtAutoGui slider interface elements.
This is a base with common functionality for the two slider 'guientries': QtSliderEditor, which has a value edit box, and QtSliderLabel, with a non-editable value label. This class is abstract; its constructor can only be called by a derived class. That class should also call constructBase() after cxreating its interface elements, to complete construction.
Definition at line 109 of file QtGuiEntry.qo.h.
|
inlineprotected |
Only for use by derived classes.
Definition at line 138 of file QtGuiEntry.qo.h.
|
inlineprotected |
Definition at line 139 of file QtGuiEntry.qo.h.
|
protected |
Adjusts integer slider range (slMax_) and the increment that each unit on the slider represents (dIncr_), according to latest increment and range request (dIncr0_, dMin_, dMax_).
|
protected |
Derived class should call this within its constructor, after it has a valid QSlider, name QLabel and menu QToolButton (usually, after calling setUi()), passing them down in the parameters below.
ele is the QDomElement (an xml version of an option casacore::Record) used to construct the derived class.
|
protected |
|
signal |
class user may wish to connect to and display these.
|
inlineprotected |
Integer values with in [0, slMax_] on the internal slider are scaled to external values within [dMin_, dMax_].
These two routines convert between the two scalings.
Definition at line 194 of file QtGuiEntry.qo.h.
References dIncr_, dMax_, dMin_, casacore::max(), and casacore::min().
Referenced by slChg().
|
protected |
Fetch numeric value of attribute of ele named attnm, into val.
Does nothing if attr doesn't exist or is not valid numerically.
|
signal |
Main output signal.
Main parameters of interest are item name and new value.
|
inline |
|
inlineprotectedvirtualslot |
Definition at line 161 of file QtGuiEntry.qo.h.
References emitVal(), and onrelease_.
void casa::QtSliderBase::reSet | ( | QDomElement & | ele | ) |
Set up main state (value, etc.) and external appearance of this widget, according to options record (passed as a QDomElement).
Called via constructor, and from QtAutoGui::changeOptions(). Does not trigger (significant) signals; it is intended to set this interface element to library's internal value (not vice versa).
|
inlineprotected |
Definition at line 186 of file QtGuiEntry.qo.h.
Referenced by sliderVal().
|
inline |
Set interface label text ('listname').
Definition at line 118 of file QtGuiEntry.qo.h.
References nameLabel_.
|
protectedvirtualslot |
'revert-to-original' selected in menu.
|
inlineprotectedvirtualslot |
slider changed by user
Definition at line 157 of file QtGuiEntry.qo.h.
References emitVal(), externalVal(), onrelease_, and update().
|
inlineprotected |
Definition at line 198 of file QtGuiEntry.qo.h.
References dIncr_, dMin_, casacore::max(), casacore::min(), round(), and slMax_.
|
inlineprotected |
Current external value, as text.
Definition at line 211 of file QtGuiEntry.qo.h.
References dVal_, and toText().
Referenced by casa::QtSliderEditor::updateText().
|
protected |
|
protected |
These two routines convert 'external' values between double and text.
Referenced by textVal().
|
protected |
Accepts new value (if any), updates interface (without retriggering any internal slots).
New value should already have been validated.
Referenced by slChg().
|
protected |
Sets slider to latest range and value (without triggering slider signals or slChg slot below).
|
protectedpure virtual |
Derived class should implement: set value text box or label (if any) to (normalized) current value.
(Should not trigger class's own slots).
Implemented in casa::QtSliderLabel, and casa::QtSliderEditor.
|
protected |
Definition at line 243 of file QtGuiEntry.qo.h.
|
protected |
Definition at line 243 of file QtGuiEntry.qo.h.
Referenced by externalVal(), and sliderVal().
|
protected |
Definition at line 243 of file QtGuiEntry.qo.h.
Referenced by externalVal().
|
protected |
Definition at line 243 of file QtGuiEntry.qo.h.
Referenced by externalVal(), and sliderVal().
|
protected |
main state.
Determines the float scaling for the (necessarily int) QSlider. dVal_ is the slider's 'external' value (which may be floating-point). dMin_ and dMax_ are its 'external' range. dIncr0_ is the requested 'external' slider increment ('presolution'), dIncr_ is the increment actually used (normally, these will be the same).
Internally, the slider's range will be [0, slMax_]; slMax_ will be a non-negative integer value. Both of the QSlider's internal increments (singleStep, pageStep) will be 1.
Definition at line 243 of file QtGuiEntry.qo.h.
Referenced by textVal().
|
protected |
Whether this element emits float values (ptype 'floatrange') vs.
ints (ptype 'intrange').
Definition at line 247 of file QtGuiEntry.qo.h.
|
protected |
|
protected |
Definition at line 260 of file QtGuiEntry.qo.h.
|
protected |
Definition at line 259 of file QtGuiEntry.qo.h.
Referenced by setLabelText().
|
protected |
Should the event be generated only upon releasing the slider?
Definition at line 250 of file QtGuiEntry.qo.h.
|
protected |
For restoring 'original' value.
Definition at line 253 of file QtGuiEntry.qo.h.
|
protected |
Relevant user interface elements.
Must be created by derived class and passed in via constructBase().
Definition at line 258 of file QtGuiEntry.qo.h.
|
protected |
Definition at line 243 of file QtGuiEntry.qo.h.
Referenced by sliderVal().