Variant Class Reference

#include <variant.h>

List of all members.

Signals

void valueChanged (QVariant newValue, QVariant oldValue)

Public Member Functions

 Variant (Type::Value type)
virtual ~Variant ()
Variant::Type::Value type () const
void setType (Type::Value type)
QString filter () const
void setFilter (const QString &filter)
int colorScheme () const
void setColorScheme (int colorScheme)
void setCaption (const QString &caption)
QString toolbarCaption () const
void setToolbarCaption (const QString &caption)
QString editorCaption () const
void setEditorCaption (const QString &caption)
QString unit () const
void setUnit (const QString &unit)
double minValue () const
void setMinValue (double value)
double maxValue () const
void setMaxValue (double value)
double minAbsValue () const
void setMinAbsValue (double val)
QVariant defaultValue () const
void setDefaultValue (QVariant val)
void setAdvanced (bool advanced)
bool isAdvanced () const
void setHidden (bool hidden)
bool isHidden () const
QString displayString () const
QStringList allowed () const
void setAllowed (QStringList stringList)
void appendAllowed (QString string)
QVariant value () const
void setValue (const QVariant &val)
void resetToDefault ()

Classes

class  Type


Detailed Description

For information: QVariant::type() returns an enum for the current data type contained. e.g. returns QVariant::Color or QVariant::Rect
Author:
Daniel Clarke

David Saxton

Definition at line 27 of file variant.h.


Member Function Documentation

Variant::Type::Value Variant::type (  )  const [inline]

Returns the type of Variant (see Variant::Type::Value)

Definition at line 63 of file variant.h.

Referenced by displayString(), PIStringCombo::PIStringCombo(), and PropertiesListView::slotSelectionChanged().

void Variant::setType ( Type::Value  type  ) 

Sets the variant type

Definition at line 42 of file variant.cpp.

Referenced by FlowPart::createProperty(), and DrawPart::createProperty().

QString Variant::filter (  )  const [inline]

Returns the filter used for file dialogs (if this is of type Type::FileName)

Definition at line 71 of file variant.h.

Referenced by PIFilename::PIFilename().

int Variant::colorScheme (  )  const [inline]

The selection of colours to be used in the combo box - e.g. ColorCombo::LED.

See also:
ColorCombo::ColorScheme

Definition at line 78 of file variant.h.

Referenced by PIColor::PIColor().

void Variant::setCaption ( const QString &  caption  )  [inline]

This function is for convenience; it sets both the toolbar and editor caption.

Definition at line 84 of file variant.h.

References setEditorCaption(), and setToolbarCaption().

Referenced by ADDAC::ADDAC(), BiDirLED::BiDirLED(), BinaryCounter::BinaryCounter(), BusSplitter::BusSplitter(), CallSub::CallSub(), Count::Count(), Delay::Delay(), Demultiplexer::Demultiplexer(), DependentSource::DependentSource(), DPLine::DPLine(), DPRectangle::DPRectangle(), DPText::DPText(), ECBJT::ECBJT(), ECCapacitor::ECCapacitor(), ECCell::ECCell(), ECClockInput::ECClockInput(), ECCurrentSignal::ECCurrentSignal(), ECCurrentSource::ECCurrentSource(), ECDiode::ECDiode(), ECDPDT::ECDPDT(), ECDPST::ECDPST(), ECFixedVoltage::ECFixedVoltage(), ECKeyPad::ECKeyPad(), ECLed::ECLed(), ECLogicInput::ECLogicInput(), ECPotentiometer::ECPotentiometer(), ECPTBSwitch::ECPTBSwitch(), ECPTMSwitch::ECPTMSwitch(), ECResistor::ECResistor(), ECRotoSwitch::ECRotoSwitch(), ECSevenSegment::ECSevenSegment(), ECSPDT::ECSPDT(), ECSPST::ECSPST(), ECVoltageSignal::ECVoltageSignal(), Embed::Embed(), ExternalConnection::ExternalConnection(), FloatingProbe::FloatingProbe(), Inductor::Inductor(), InputButton::InputButton(), Interrupt::Interrupt(), Keypad::Keypad(), MagnitudeComparator::MagnitudeComparator(), MatrixDisplay::MatrixDisplay(), MatrixDisplayDriver::MatrixDisplayDriver(), MechanicsItem::MechanicsItem(), Meter::Meter(), MultiInputGate::MultiInputGate(), Multiplexer::Multiplexer(), ParallelPortComponent::ParallelPortComponent(), PICComponent::PICComponent(), Probe::Probe(), Pulse::Pulse(), RAM::RAM(), ResistorDIP::ResistorDIP(), SerialPortComponent::SerialPortComponent(), SetPin::SetPin(), SevenSeg::SevenSeg(), Sub::Sub(), TestPin::TestPin(), Unary::Unary(), VarAssignment::VarAssignment(), and VarComparison::VarComparison().

QString Variant::toolbarCaption (  )  const [inline]

This text is displayed to the left of the entry widget in the toolbar

Definition at line 88 of file variant.h.

QString Variant::editorCaption (  )  const [inline]

This text is displayed to the left of the entry widget in the item editor

Definition at line 93 of file variant.h.

Referenced by Item::mouseDoubleClickEvent().

QString Variant::unit (  )  const [inline]

Unit of number, (e.g. V (volts) / F (farads))

Definition at line 98 of file variant.h.

Referenced by PIDouble::PIDouble().

double Variant::minValue (  )  const [inline]

The smallest (as in negative, not absoluteness) value that the user can set this to.

Definition at line 104 of file variant.h.

Referenced by PIDouble::PIDouble(), and PIInt::PIInt().

double Variant::maxValue (  )  const [inline]

The largest (as in positive, not absoluteness) value that the user can set this to.

Definition at line 110 of file variant.h.

Referenced by PIDouble::PIDouble(), and PIInt::PIInt().

double Variant::minAbsValue (  )  const [inline]

The smallest absolute value that the user can set this to, before the value is considered zero.

Definition at line 116 of file variant.h.

Referenced by PIDouble::PIDouble().

void Variant::setAdvanced ( bool  advanced  )  [inline]

If this data is marked as advanced, it will only display in the item editor (and not in the toolbar)

Definition at line 124 of file variant.h.

Referenced by DPLine::DPLine(), DPRectangle::DPRectangle(), DPText::DPText(), ECBJT::ECBJT(), ECDiode::ECDiode(), ECDPDT::ECDPDT(), ECDPST::ECDPST(), ECKeyPad::ECKeyPad(), ECPTBSwitch::ECPTBSwitch(), ECPTMSwitch::ECPTMSwitch(), ECRotoSwitch::ECRotoSwitch(), ECSPDT::ECSPDT(), ECSPST::ECSPST(), FloatingProbe::FloatingProbe(), ForLoop::ForLoop(), MatrixDisplay::MatrixDisplay(), MatrixDisplayDriver::MatrixDisplayDriver(), and MechanicsItem::MechanicsItem().

void Variant::setHidden ( bool  hidden  )  [inline]

If this data is marked as hidden, it will not be editable from anywhere in the user interface

Definition at line 130 of file variant.h.

Referenced by Demultiplexer::Demultiplexer(), ECRotoSwitch::ECRotoSwitch(), ECSubcircuit::ECSubcircuit(), Multiplexer::Multiplexer(), and PICComponent::PICComponent().

QString Variant::displayString (  )  const

Returns the best possible attempt at representing the data in a string for display. Used by the properties list view.

Definition at line 89 of file variant.cpp.

References Item::getMultiplier(), Item::getNumberMag(), and type().

QStringList Variant::allowed (  )  const [inline]

The list of values that the data is allowed to take (if it is string)

Definition at line 140 of file variant.h.

Referenced by DPArrow::DPArrow(), PIFilename::PIFilename(), and PIStringCombo::PIStringCombo().

void Variant::valueChanged ( QVariant  newValue,
QVariant  oldValue 
) [signal]

Emitted when the value changes. NOTE: The order of data given is the new value, and then the old value This is done so that slots that don't care about the old value don't have to accept it

Referenced by setValue().


The documentation for this class was generated from the following files:
Generated on Tue May 8 17:06:00 2007 for KTechLab by  doxygen 1.5.1