Ananas Library 0.9.5
aWidget Class Reference

#include <awidget.h>

Inheritance diagram for aWidget:
wCatalogue wDocument wField wGroupTree wJournal wReport wDBField

Public Slots

virtual QVariant value (const QString &name)
 
virtual QString value () const
 

Signals

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

 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 QDialog * createEditor (QWidget *parent)
 
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 QString textValue ()
 
virtual void setValue (const QString &)
 
virtual int setValue (const QString &name, const QVariant &value)
 
virtual int setObjValue (const QString &nameWidget, aObject *value)
 
virtual void SetReadOnly (bool)
 
virtual int Refresh ()
 
QWidget * Widget (QString name, bool onlyMyWidgets=true)
 
virtual aDataFieldgetAttribute (const QString &name)
 
virtual int setAttribute (const QString &name, const aDataField *value)
 

Static Public Member Functions

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

aDatabasedb
 
aCfgmd
 
aEngineengine
 

Protected Member Functions

virtual void updateProp ()
 
virtual void keyPressEvent (QKeyEvent *e)
 

Protected Attributes

aObjectdbobj
 

Properties

int Id
 
bool openEditor
 
int FormMode
 

Detailed Description

Base visual object.

Constructor & Destructor Documentation

◆ aWidget() [1/3]

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

Abstract Ananas widget object.

◆ aWidget() [2/3]

aWidget::aWidget ( const QString & itemname,
aDatabase * adb,
QWidget * parent = 0,
const char * name = 0,
WFlags fl = 0 )

References aDatabase::cfg, aCfg::find(), and init().

◆ aWidget() [3/3]

aWidget::aWidget ( aCfgItem context,
aDatabase * adb,
QWidget * parent = 0,
const char * name = 0,
WFlags fl = 0 )

References init().

Member Function Documentation

◆ checkStructure()

bool aWidget::checkStructure ( )
virtual

Reimplemented in wCatalogue, wDocument, wJournal, and wReport.

◆ createDBObject()

aObject * aWidget::createDBObject ( aCfgItem obj,
aDatabase *  )
virtual

Create database object.

Reimplemented in wCatalogue, wDocument, wGroupTree, and wJournal.

Referenced by initObject().

◆ createEditor()

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

◆ createToolBar()

QToolBar * aWidget::createToolBar ( QMainWindow * parent)
virtual

Create toolbar for QMainWindow owner object.

Reimplemented in wCatalogue, wGroupTree, and wJournal.

Referenced by aForm::init(), and aForm::initContainer().

◆ displayString()

QString aWidget::displayString ( )
virtual

Reimplemented in wDocument.

◆ getAttribute()

aDataField * aWidget::getAttribute ( const QString & name)
virtual

Return form widget pointer by name.

◆ getMd()

aCfg * aWidget::getMd ( )

Return toplevel metadata configuration.

References getMd().

Referenced by getMd(), wDBField::init(), and wDBTable::init().

◆ getObjectData()

void aWidget::getObjectData ( QWidget * object)

Emit signal getData( object ).

◆ init()

void aWidget::init ( aDatabase * adb)

References initObject().

Referenced by aWidget(), aWidget(), and aForm::initContainer().

◆ initObject()

void aWidget::initObject ( aDatabase * adb)
virtual

Init object after create. Need setId( id ), where id - if of the metadata object of the adb->cfg loaded Configuration.

Parameters
adb- ananas database object.

Reimplemented in wCatalogue, wDBField, wDocument, wGroupTree, wJournal, and wReport.

References aDatabase::cfg, createDBObject(), aCfg::find(), and aLog::print().

Referenced by aEditorFactory::createEditor(), init(), wCatalogue::initObject(), wDBField::initObject(), wDocument::initObject(), wGroupTree::initObject(), wJournal::initObject(), and wReport::initObject().

◆ isContainer()

bool aWidget::isContainer ( )
virtual

Reimplemented in wDocument.

◆ New()

ERR_Code aWidget::New ( )
virtual

Create new database record object. New object create with using wirtual function aObject::New() of aObject and it's childs.

Returns

Reimplemented in wDocument, and wReport.

References aObject::New(), and aLog::print().

Referenced by aForm::New(), and wDocument::New().

◆ Select()

ERR_Code aWidget::Select ( Q_ULLONG id)
virtual

Select object in database.

Parameters
id- database record id.
Returns
error code.

Reimplemented in wDocument, and wReport.

References aLog::print(), and aObject::select().

Referenced by aForm::Select(), and wDocument::Select().

◆ setAttribute()

int aWidget::setAttribute ( const QString & name,
const aDataField * value )
virtual

Return form widget pointer by name.

◆ setObjectData()

void aWidget::setObjectData ( QWidget * object,
aCfg * md )

Emit signal setData( object, md ).

◆ setObjValue()

int aWidget::setObjValue ( const QString & nameWidget,
aObject * value )
virtual

Setting form widgets value of object type. Support type of widgets: wField, wDBField.

Parameters
nameWidget- Widget name.
value- value.

References aObject::getUid(), aLog::print(), and Widget().

Referenced by aForm::SetObjValue().

◆ setOpenEditor()

void aWidget::setOpenEditor ( bool fn)

◆ SetReadOnly()

void aWidget::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 in wField.

Referenced by aForm::SetReadOnly().

◆ setValue() [1/2]

void aWidget::setValue ( const QString & value)
virtual

Setting form widgets value. Must be implemented in inherited class.

Parameters
value- value.

Reimplemented in wField.

Referenced by aForm::SetValue().

◆ setValue() [2/2]

int aWidget::setValue ( const QString & nameWidget,
const QVariant & value )
virtual

Setting form widgets value. Support type of widgets: wField, wDBField, QPushButton, QLabel, QLineEdit, QCheckBox.

Parameters
nameWidget- Widget name.
value- value.

References aLog::print(), and Widget().

◆ uid()

Q_ULLONG aWidget::uid ( )
virtual

Get id from database. Get id for current database record or 0 if database object not created.

Returns
current database record id

Reimplemented in wReport.

References aObject::getUid(), and aLog::print().

Referenced by wDBTable::init(), aForm::New(), wDocument::New(), aForm::SelectByCurrent(), and aForm::SetTabValue().

◆ Update()

ERR_Code aWidget::Update ( )
virtual

Update data

Reimplemented in wReport.

References aLog::print(), aObject::SetValue(), aObject::Update(), and value().

Referenced by aForm::Update(), and aForm::UpdateDB().

◆ value [1/2]

virtual QString aWidget::value ( ) const
inlinevirtualslot

Reimplemented in wField.

◆ value [2/2]

QVariant aWidget::value ( const QString & nameWidget)
virtualslot

Get field value. get value for field with such name.

Parameters
name- field md name.
Returns
field value.

References aLog::print(), value(), and Widget().

Referenced by Update(), aForm::Value(), and value().

◆ Widget() [1/2]

QWidget * aWidget::Widget ( QString name,
bool onlyMyWidgets = true )

Return form widget pointer by name.

References Widget().

◆ Widget() [2/2]

QWidget * aWidget::Widget ( QWidget * owner,
QString name )
static

Return form widget pointer by name.

Referenced by setObjValue(), setValue(), value(), aForm::Widget(), and Widget().


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