#include <qlabticketline.h>
Warning:
This is a work in progress class. The only thing that you can get for sure is the interface, which may extend but not change in incompatible ways. Do not rely on code in this class, at it can be fully revamped before we reach version 1.0.
QlabTicketLine proposes an abstract view for ticket data, via the classic QVariant mechanism. If you are not familiar with QVariant read the QVariant class description in Qt documentation
The class offers a good deal of line types. If you need to add some new types, you should ask for a specific code if you want a good compatibility with future versions.
One of the evolutions could be a parametrizable linetype descriptor which could be dynamically expanded. But this is still a wish as some issues did not yet find an elegant solution.
You gain access to data items using the usual value() and setValue() methods. store() and get() methods deal with the data repository, including a local fallback when master server is busy or down.
setGetField() method should be used very carefully as, badly parametrized, you could get the wrong data object.
A sample of usage is included in qlabibmcashbox.cpp sample application which describes a full fledged skeleton for IBM 4694 cashbox hardware.
License :
Please read the license file in doc directory. 1. Lab Public License. You should have received a copy of the Lab Public License with this package. If this is not the case, you can read it or download it at: http://labproject.free.fr 2. Q Public License. Conformant to Trolltech QPL license. 3. GNU General Public License. Reserved for free projects. 4. Commercial license. Recommanded if your code is not distributed under one of the 3 models above. Read the license FAQ in doc directory.
|
Provides standard Line Types for Ticket lines. Most of these names are self explanatory. Moneo is a French paypal like system, Separator inserts a line not dealing with real cashbox data. |
|
Builds a new QlabTicketLine instance.
|
|
Deletes the instance of QlabTicketLine.
|
|
Get a Ticket Line from the data collection using the val Get Descriptor. If setGetField() Method has not been called to remap the getter, you pass a recid ObjectID. Else you pass the wanted value. Note that an invalid descriptor can lead to 2 situations: 1. FALSE on really invalid value. 2. TRUE idf the value is valid for something, but you posted a logical error in your code. Be very carefull when changing the setGetField() method. On FALSE result, you can access the reject reason using lastError() Method to get informations from the backend with a textual explanation. |
|
Inits the ticket line fields to known values. This gives the most often used defaults, say: empty Line type.
|
|
Emited whenever a data Type or Name error appears. This signal is emited whenever a data Type or Name error appears. The err string gives a somewhat database repository dependant error description.
|
|
Returns the last Error String from the data repository backend.
|
|
Sets the default Get Field to something else than the standard recid field. This can lead to strange results if the getter is not an absolute reference to an object.
|
|
Sets the value for the fld field to value.
|
|
Stores the values to the repository. We first try to connect to master server. If connection fails, we use the local backdrop. When master comes up afeter a backdrop, we have to push to the master the whole pile of ticket lines before registering the new one. Returns TRUE if save is correct. Else returns FALSE and you can access the error with lastError() method. |
|
Returns the value of the field fld as a QVariant.
|
|
For internal use only. Flag telling the store() method if something has to be saved here. |
|
For internal use only. Hook to the client interface to repository |
|
For internal use only. Keeps in a cool place the last error reported from the backend data repository. |
|
For internal use only. Stores the current Get Field used for get() method. |
|
For internal use only.
|
|
For internal use only. Short hand access to master connection. |