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

QlabCategoryList Class Reference
[Data Selection Widgets]

#include <qlabcategorylist.h>

List of all members.


Detailed Description

QlabCategoryList class allow for fast embedding of a standard category selection widget.

This selector allows for transparent use of the System_categories Data Collection in each and every module when categorization is needed.
The Category List shows up as a hierarchical view of the categories depending on a module name. Parametrization allow to show only active or inactive categories.

Todo:
Make the look anf feel more appealing.

Add an interactive category search mode.

Public Slots

Signals

Public Member Functions

Protected Slots

Private Slots

Private Member Functions

Private Attributes


Constructor & Destructor Documentation

QlabCategoryList::QlabCategoryList QWidget *  parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Constructs a QlabCategoryList as a child of parent, with the name name and widget flags set to f.

QlabCategoryList::~QlabCategoryList  ) 
 

Destroys the object and frees any allocated resources.


Member Function Documentation

void QlabCategoryList::categoryChanged QListViewItem *  item  )  [private, slot]
 

This is a helper method, only used internally by the widget.

For internal use only.

You should never try to call this directly, as you would end up in an infinite loop with the selectionChanged from QListView widget. This is here only to map the selected item to its Unique Object ID for selected category.

Emits the categoryIdChanged() signal whenever fired.

void QlabCategoryList::categoryIdChanged int  catid  )  [signal]
 

Emited whenever selected category has changed. Provides UOID to receiver.

void QlabCategoryList::categoryRemapped int  catid  )  [signal]
 

Emited whenever a category is remapped to another parent.
Alows inheritors to be informed when a category is remapped and let them act upon this information. Sampe code is available in LabKiosk Inventory Control section, which remaps parts to the master ancestor.

QString QlabCategoryList::categoryType  )  const [slot]
 

Returns the actual category type string.

This should match the module name in system tables. Please read reference manual if you don't know what the module name has to do with categorization or how to map widgets from various modules.

QSqlRecord * QlabCategoryList::create  )  [slot]
 

Allows creation of a new subcategory.

int QlabCategoryList::currentCategory  ) 
 

Returns the currently selected Category Unique Object ID.

This method maybe very handy when we create inheritance objects using categories as it gives instant access to category Unique Object ID.

bool QlabCategoryList::deleteCurrent  )  [slot]
 

Marks the current selection as Inactive.

Note:
This method works as a key. If you only view active categories, it will inactivate current. If you view inactive categories, it recalls current to activity. This can be handy to examine errors and dealing with erroneous category inactivation.
Another use is preparing categories for future use, create associated elements, keep them hidden till the day to make them public comes.
Active categories are those not marked for deletion. Inactive ones are marked for future real deletion. Please read reference manual if you don't understand why we do not delete categories immediately.

void QlabCategoryList::init  )  [private]
 

Inits widget before showing it.

For internal use only.

Emits the selectionChanged() signal upon init completion.

Todo:
Enforce network caching for the tree. One way could be storing trees as serialized instances, but this has some drawbacks too.

void QlabCategoryList::languageChange  )  [protected, virtual, slot]
 

Sets the strings of the subwidgets using the current language if available.

For internal use only.

void QlabCategoryList::refresh  )  [slot]
 

Refreshes the category list.

This slot may be connected to another module which might have edited a category, created a new one or marked one for inactivity.
The only result is a force rehashing of the category tree to reflect other modules changes.

If many people are allowed to edit the categores for a module, a nice and simple way for applications is to use a timer to force refresh every n minutes.

Note:
As init() internal method is called, all init() behaviour has to be understood when we refresh the list.
Todo:
Try to find a faster way for refreshing.

void QlabCategoryList::reparent int  source,
int  newParent
[slot]
 

Reparents category id source to new parent newParent.

While this code works perfectly and is used in our LabKiosk product, we consider it as experimental as we could not yet test all intrications on inheritance tree. So, if you use it, consider that you could eventually get unexpected results on badly designed inheritance or if your associative classes are not explicitly defined. Implicit and indirect childern cannot be found with a 100% result chance.

Note:
Sends a categoryRemapped() signal after remapping. Your application should connect to this signal and use it to update inheritors when those are loosely connected to category, such as reference only.
Todo:
Find a foolproof way for reparenting.

Find a way to automatically discover loose referencing to categories, even when not explicit references are generated.

void QlabCategoryList::setCategoryType const QString &  type  )  [slot]
 

Sets the category type as type.

This should match the module name in system tables. Please read reference manual if you don't know what the module name has to do with categorization or how to map widgets from various modules.
This call reinits the widget and rebuilds the actual category tree.

Warning:
If the type returns un undefined value, you end up with an empty category tree.
Note:
As init() internal method is called, all init() behaviour has to be understood when we refresh the list.

void QlabCategoryList::setShowActive bool  act  )  [slot]
 

Sets the actual category active status to act.

This call reinits the widget to show only active or inactive categories.

Active categories are those not marked for deletion. Inactive ones are marked for future real deletion. Please read reference manual if you don't understand why we do not delete categories immediately.
This method emits the categoryViewChanged() signal. Your application can use this and act upon if needed. This signal is used by some inherited standard widgets, but may be useful if you need to create your own inherited classes.

Note:
As init() internal method is called, all init() behaviour has to be understood when we refresh the list.

bool QlabCategoryList::showActive  )  const [slot]
 

Returns the actual category active status.

Active categories are those not marked for deletion. Inactive ones are marked for future real deletion. Please read reference manual if you don't understand why we do not delete categories immediately.

bool QlabCategoryList::validateChanges  )  [slot]
 

Validates changes in addSubCategory() and editCurrentCategory() method processing.

Warning:
You should never call this in other context, as you could crash the application or, even worse, save unexpected things.


Member Data Documentation

bool QlabCategoryList::active [private]
 

Active View Flag.

For internal use only.

int QlabCategoryList::activeModule [private]
 

Placeholder to store module info.

For internal use only.

QSqlRecord* QlabCategoryList::buffer [private]
 

Placeholder for Category Manipulations.

For internal use only.

QString QlabCategoryList::catType [private]
 

Category type bound to active module name.

For internal use only.

bool QlabCategoryList::inInit [private]
 

Used internally to prevent multiple indirections when init() method is activated.

For internal use only.

 

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