Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

QlabDbCombo Class Reference
[Data Selection Widgets]

#include <qlabdbcombo.h>

Inheritance diagram for QlabDbCombo:

QlabAccessModeSelector QlabBillModesSelector QlabContactSelector QlabCustomerSelector QlabVendorSelector List of all members.

Detailed Description

This class is the base class for all combo selectors.

All QlabDbCombo inheritors allow opaque selection of various data and present them to the user in a combo box selector.
You even can use this class directly, while this is not a good practice. One should always subclass and specify this class.

Todo:
Extend this class to allow generalized by countryselections. This new option will be present in 1.3 version, as we'll have to revise some inheritors after introducing such a generalization.
However, client apps will keep the same interface.
Warning:
If the used data backend is IBM DB2, you should not store full Unicode in table BLOBS as this is not well supported by IBM and may generate random backend server threads crashes. We could not determine where the problem is, as this backend is not Open Source Software.

Public Types

Public Slots

Signals

Public Member Functions

Public Attributes

Protected Member Functions

Protected Attributes

Private Member Functions

Private Attributes


Member Enumeration Documentation

enum QlabDbCombo::ActiveState
 

Describes the needed auto select mode.

As stated in LAB general rules, one does not really delete data from collections, but inactivate them to preserve integrity for full system. Real delete happens when all delete rules are met.

Enumeration values:
Active  Select Only active items
Inactive  Select Only inactive items
Both  Select all items


Constructor & Destructor Documentation

QlabDbCombo::QlabDbCombo QWidget *  parent = 0,
const char *  name = 0
 

Constructs a new instance of QlabDbCombo.

Note:
This class MUST receive a QWidget parent as first parameter as it is only available in graphics environments. The name is standard.

QlabDbCombo::~QlabDbCombo  ) 
 

Destroys the instance of QlabDbCombo.


Member Function Documentation

QlabDbCombo::ActiveState QlabDbCombo::activeFilter  )  const [slot]
 

Returns the current ActiveState filter Status.

QStringList QlabDbCombo::entries  )  const [slot]
 

Returns the Data Elements entries involved in combo.

QString QlabDbCombo::filter  )  const [slot]
 

Returns the current Data Selection filter.

int QlabDbCombo::getId const QString &  txt  )  [slot]
 

Returns the Item ID belonging to text.

void QlabDbCombo::idChanged int  idx  )  [signal]
 

Emited whenever the active selection changes.

Sends the unique Object ID for the selected Item.

int QlabDbCombo::itemId  )  const [slot]
 

Returns the current Item ID.

Item ID is the effective Unique Object ID for the item. It can be directed to an associate data Element slot.

void QlabDbCombo::mapModes QString &  name,
int &  id,
bool  populate
[protected, virtual]
 

Element Mapper.

If populate is TRUE, Populates the map with name and id Else retrieves an id from its name or a name from id.

Note:
If you need to reimplement this, make sure it looks like:
void QlabDbCombo::mapModes( QString & name, int &id, bool populate )
{
        if ( populate ) {
                tblMap.replace( name, id ) ;
                revMap.replace( id, name ) ;
        } else {
                if ( id == 0 ) {
                        id = tblMap.find( name ).data() ;
                } else {
                        name = revMap.find( id ).data() ;
                }
        }
}

QStringList QlabDbCombo::order  )  const [slot]
 

Returns current ordering string.

void QlabDbCombo::rehash  )  [virtual]
 

rehashes the map according to system parameters

void QlabDbCombo::setActive const QString &  data  )  [slot]
 

Sets the Combo Element with data as Active Element.

void QlabDbCombo::setActive int  id  )  [slot]
 

Sets the id Item as active Element.

void QlabDbCombo::setActiveFilter QlabDbCombo::ActiveState  flt  )  [slot]
 

Sets the current ActiveState filter Status.

Note:
Changing the flt fires the rehash() method and generates the active combo contents.

void QlabDbCombo::setEntries const QStringList &  lst  )  [slot]
 

Sets the Data Elements entries involved in combo to lst.

Note:
Fires the rehash() method and generates the active combo contents.

void QlabDbCombo::setFilter const QString &  flt  )  [slot]
 

Sets the Data Selection filter to flt.

Note:
Changing the flt fires the rehash() method and generates the active combo contents.

void QlabDbCombo::setItemId int  id  )  [slot]
 

Sets Current Item ID to id.

This ID MUST be an existing Unique Object ID in the Data Collection.
If this id does not exist, you can lead to unpredictable results and sometimes to an application crash as the mapper cannot always solve the unprectitible.

void QlabDbCombo::setOrder const QStringList &  ordering  )  [slot]
 

Sets the combo data ordering to ordering.

void QlabDbCombo::setTableName const QString &  table  )  [slot]
 

Sets the active table name to table.

Note:
Setting the table fires the rehash() method and generates the active combo contents.

QString QlabDbCombo::tableName  )  const [slot]
 

Returns the active table name.

QStringList QlabDbCombo::valueList  )  const [slot]
 

Returns the whole Data Collection embedded in combo.

This is only for completeness as no one really needs it, except for debugging purposes.


Member Data Documentation

ActiveState QlabDbCombo::activeState [private]
 

Current active State.

For internal use only.

QString QlabDbCombo::defaultFilter [private]
 

Default Filter as stated by widget instanciator.

For internal use only.

QStringList QlabDbCombo::fields [private]
 

Presented Data Elements.

For internal use only.

bool QlabDbCombo::inInit
 

Flag telling if the widget is in Init State

int QlabDbCombo::itemid [private]
 

Current Element activated Item ID.

For internal use only.

QString QlabDbCombo::mainTable [private]
 

Main Data Collection Table Name.

For internal use only.

QStringList QlabDbCombo::orderField [private]
 

Data Element used to sort the list.

For internal use only.

QMap<int, QString> QlabDbCombo::revMap [protected]
 

Reverse Item Name to ID Map - Here for speed.

For internal use only.

QMap<QString, int> QlabDbCombo::tblMap [protected]
 

Direct Item Name to ID Map - Here for speed.

For internal use only.

 

L.A.B. Project © 2001-2004 LAB Project & DJ Anubis