Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

FloatEditor Class Reference

GUI widget for editing algorithm specific parameters. More...

#include <FloatEditor.h>

List of all members.

Public Methods

Public Slots

Signals

Private Attributes

Private Slots


Detailed Description

An instance of this class represents a GUI widget specialy designed for editing algorithm specific parameters of a WarpAlgorithm instance. As the name suggests, it was made to edit parameters of type float.

Note:
This class is moreless a quick hack, so don't expect too much. Anyway, it should give an idea to anyone interested on how to use the paramInfo struct achieved from an algorithm.

A FloatEditor supports means of communicating with the rest of the gui through a single public slot setValue(float) and a signal valueChanged(int,float) Within this Project, it is used as a child widget of the AlgorithmControl widget.

Apearance is a bit clumsy right now, if you want a more elaborated gui, you should think about rewriting this class from scratch. At the moment, the following features are implemented:

Todo:
Implement additional slot for reseting value to default.


Constructor & Destructor Documentation

FloatEditor::FloatEditor ( int paramId = 0,
QWidget * parent = 0,
paramInfo * info = 0,
WFlags fl = 0 )
 

Creates a FloatEditor and initializes it using parameter information found in info</info>

Parameters:
paramId   set this to something you like;-) . The FloatEditor will store this value and include it as argument each time the valueChanged(int,float) signal is emmited. You should use this to easiely identify the source of the signal.
info   meta information to describe the parameter edited by this FloatEditor instance. Usualy it gets filled out by WarpAlgorithm::getParamInfo(int,paramInfo)
parent   A pointer to the parent widget
fl   Window style flags

Apart info, all arguments are passed through to the QWidget constructor

FloatEditor::~FloatEditor ( )
 

Does nothing ;-)


Member Function Documentation

void FloatEditor::setValue ( float v ) [slot]
 

Parameters:
v   the new value

void FloatEditor::sliderValueChanged ( int v ) [private, slot]
 

This is an internal slot, which is connected to the valueChanged signal of slider. It's use is to update the lcd accordingly.

Parameters:
v   the new value set by the slider.
Note:
unfortunatly, the QSlider class only supports int values. To get floats anyway, the sliders actual range is scaled by 20. Consequently we have to divide it by 20 within this class, to get the real value. This value is subsequently passed on to the LCD and also emmited via the valueChanged(int,float)

void FloatEditor::valueChanged ( double v ) [signal]
 

Hmm. i honestly don't know anymore what this method was good for. Will have another look on the code. Stay tuned.

Todo:
find out what this method was used for and comment it accordingly, or remove it if not used anymore.

void FloatEditor::valueChanged ( int paramId,
float v ) [signal]
 

Parameters:
paramId   the Id that was set for this editor instance
v   the new value
See also:
FloatEditor( int ,QWidget* , paramInfo* , WFlags )


Member Data Documentation

int FloatEditor::ID [private]
 

See also:
FloatEditor( int ,QWidget* , paramInfo* , WFlags )


The documentation for this class was generated from the following file:
Generated at Fri Apr 19 16:53:06 2002 for GLFramework by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001