Ananas Library 0.9.5
wField Class Reference

Ananas Field widget. . More...

#include <wfield.h>

Inheritance diagram for wField:
aWidget wDBField

Public Types

enum  tEditorType {
  Unknown , Numberic , String , Date ,
  DateTime , Boolean , Catalogue =101 , Document
}

Public Slots

bool getOpt () const
Public Slots inherited from aWidget
virtual QVariant value (const QString &name)

Signals

void valueChanged (const QString &)
void valueChanged (const QVariant &)
void inputInvalid ()
void lostFocus ()
Signals inherited from aWidget
void setData (QWidget *, aCfg *)
void getData (QWidget *)
void getMd (aCfg **)
void valueChanged (const QString &, const QVariant &)
void valueChanged (const QString &, const QVariant &, const QString &)
void changeObj (const QString &)
void changeObjId (const Q_ULLONG)
void keyPressed (QKeyEvent *e)

Public Member Functions

 wField (QWidget *parent, const char *name, WFlags fl=0)
virtual ~wField ()
virtual QDialog * createEditor (QWidget *parent)
void setOpt (bool fn)
virtual QString value () const
QString text () const
virtual void setValue (const QString &fn)
virtual void Validate (const QString &fn)
void setValue (const QDate &d)
virtual QString textValue ()
void setFieldType (QString n)
QString getFieldType () const
void setEditorType (tEditorType n)
tEditorType getEditorType () const
void fieldSelect ()
virtual void focusInEvent ()
virtual void focusOutEvent ()
void selectAll ()
virtual void SetReadOnly (bool)
virtual void SetNonZero (bool)
virtual void SetMask (QString)
virtual void SetValidator (QString Validator, int twostate)
Public Member Functions inherited from aWidget
 aWidget (QWidget *parent=0, const char *name=0, WFlags fl=0)
 aWidget (const QString &oname, aDatabase *adb, QWidget *parent=0, const char *name=0, WFlags fl=0)
 aWidget (aCfgItem context, aDatabase *adb, QWidget *parent=0, const char *name=0, WFlags fl=0)
virtual bool checkStructure ()
virtual void initObject (aDatabase *adb)
virtual void widgetEditor ()
virtual QToolBar * createToolBar (QMainWindow *parent)
virtual aObjectcreateDBObject (aCfgItem obj, aDatabase *)
virtual QString displayString ()
void init (aDatabase *adb)
bool getOpenEditor () const
void setOpenEditor (bool)
bool isInited ()
virtual bool isContainer ()
void setInited (bool flag)
aCfgItem * getMDObject ()
void setMDObject (aCfgItem object)
aSQLTable * table (const QString &name="")
void setObjectData (QWidget *object, aCfg *md)
void getObjectData (QWidget *object)
aCfggetMd ()
virtual Q_ULLONG uid ()
virtual ERR_Code New ()
virtual ERR_Code Update ()
virtual ERR_Code TurnOn ()
virtual ERR_Code Select (Q_ULLONG id)
aObjectdataObject ()
virtual Q_ULLONG docId ()
int formMode () const
virtual void setFormMode (int mode)
virtual QString getFieldName () const
int getId () const
void setId (int fn)
virtual int setValue (const QString &name, const QVariant &value)
virtual int setObjValue (const QString &nameWidget, aObject *value)
virtual int Refresh ()
QWidget * Widget (QString name, bool onlyMyWidgets=true)
virtual aDataFieldgetAttribute (const QString &name)
virtual int setAttribute (const QString &name, const aDataField *value)

Protected Member Functions

void widgetInit ()
Protected Member Functions inherited from aWidget
virtual void updateProp ()
virtual void keyPressEvent (QKeyEvent *e)

Protected Attributes

QLineEdit * lineEdit
wDateEditdateEdit
QLabel * objLabel
QLabel * nzLabel
wCatButtonobjButton
wCheckBoxcheckBox
QValidator * v
int two_state
tEditorType vEditorType
QString vFieldType
QString vValue
Protected Attributes inherited from aWidget
aObjectdbobj

Properties

QString value
QString FieldType
tEditorType EditorType
Properties inherited from aWidget
int Id
bool openEditor
int FormMode

Additional Inherited Members

Static Public Member Functions inherited from aWidget
static void widgetEditor (QWidget *object, QDialog *editor)
static aWidgetparentContainer (QWidget *w)
static aFormparentForm (QWidget *w)
static QString widgetName (QWidget *w)
static QWidget * Widget (QWidget *owner, QString name)
Public Attributes inherited from aWidget
aDatabasedb
aCfgmd
aEngineengine

Detailed Description

Ananas Field widget. .

Constructor & Destructor Documentation

◆ wField()

wField::wField ( QWidget * parent,
const char * name,
WFlags fl = 0 )

Constructs object with parent=parent, name=name and flags=fl

References aWidget::aWidget().

Referenced by wDBField::wDBField(), and wDBField::wDBField().

◆ ~wField()

wField::~wField ( )
virtual

Destructor.

Member Function Documentation

◆ createEditor()

QDialog * wField::createEditor ( QWidget * parent)
virtual

Sets widget visual type, depend of property fieldType. This property must be set above call this function. */ void wField::setFieldType( QString n ) { vFieldType=n; if (!loaded) { loaded = true; } widgetInit(); }

/*! Sets property editorType.

\en Creates property editor dialog window. _en \ru Создает окно диалога редактора свойств._ru

Parameters
parent- \en parent _en \ru родитель _ru

Reimplemented from aWidget.

Reimplemented in wDBField.

◆ fieldSelect()

void wField::fieldSelect ( )

\en Calls handler onClick event for Catalogue or Document object. _en \ru Вызывает обработчик события onClick для объектов Каталог или Документ. _ru

References aLog::print().

◆ focusInEvent()

void wField::focusInEvent ( )
virtual

\en Handler signal lostFocus. _en \ru Обработчик сигнала lostFocus. \ru

◆ focusOutEvent()

void wField::focusOutEvent ( )
virtual

\en Handler signal lostFocus. _en \ru Обработчик сигнала lostFocus. \ru

◆ SetMask()

void wField::SetMask ( QString inputMask)
virtual

\en Set input Mask to LineEdit. _en \ru Устанавливает маску ввода в LineEdit. _ru

Parameters
QStringinputMas - \en inputMas for LineEdit. _en \ru inputMas для LineEdit._ru

Referenced by wDBField::initObject().

◆ SetNonZero()

void wField::SetNonZero ( bool fl)
virtual

\en Mark field by red asterisk if it is Non Zero. _en \ru Помечает поле красной звездочкой, если поле не нулевое._ru

Referenced by wDBField::initObject().

◆ SetReadOnly()

void wField::SetReadOnly ( bool status)
virtual

Seting widget readonly flag. When widget readonly it's fields can't be edit, and make updatе action

Parameters
status- New readonly flag.

Reimplemented from aWidget.

◆ SetValidator()

void wField::SetValidator ( QString Validator,
int twostate )
virtual

\en Set validaror and connect LineEdit to Validator. _en \ru Устанавливает валидатор и соединяет LineEdit с Validator. _ru

Parameters
QStringValidator - \en RegExp for QRegExpValidator _en \ru значение RegExp для установки QRegExpValidator_ru

References Validate().

Referenced by wDBField::initObject().

◆ setValue() [1/2]

void wField::setValue ( const QDate & newDate)

\en Sets value type DateTime. _en \ru Устанавливает значения типа DateTime. Так как в базе хранится тип DateTime, значение дополняется нулевым временем для корректной конвертации и хранении в базе. Формат даты в базе данных должен быть ISO. _ru

Parameters
newDate(in) - \en date for set _en \ru Дата для установки _ru

◆ setValue() [2/2]

void wField::setValue ( const QString & newvalue)
virtual

\en Sets value. _en \ru Устанавливает значение виджета. _ru

Parameters
newvalue(in) - \en value for set _en \ru значение для установки _ru

Reimplemented from aWidget.

Referenced by Validate().

◆ text()

QString wField::text ( ) const

\en Gets text value. _en \ru Возвращает текстовое значение виджета. _ru

Returns
\en value _en \ru значение виджета _ru

◆ textValue()

virtual QString wField::textValue ( )
inlinevirtual

Reimplemented from aWidget.

◆ Validate()

void wField::Validate ( const QString & test)
virtual

\en Validate value and paint LineEdit frame. _en \ru Проверяет значение и рисует рамку поля ввода._ru

References setValue().

Referenced by SetValidator().

◆ value()

QString wField::value ( ) const
virtual

\en Gets value. _en \ru Возвращает значение виджета. _ru

Returns
\en value _en \ru значение виджета _ru

Reimplemented from aWidget.


The documentation for this class was generated from the following files: