gSAFE
1.3.8
|
#include <guilib.h>
Inherits QFrame.
Public Slots | |
int | addElement (HTableBrowserElement *e) |
int | clear () |
int | cursorToBegin (void) |
int | cursorToEnd (void) |
int | fulshDrawingCache (void) |
void | queryToCurrent (void) |
void | queryToStart (void) |
void | queryToTop (void) |
int | removeAllElementByKey (QString key) |
int | setCurrentElement (QString c, QString t="") |
int | setCurrentElement (int index) |
int | setHeadTexts (QStringList h) |
int | setTopElement (int index) |
void | sort (int keycol) |
Signals | |
void | activateItem (const QString &s) |
void | alternateActivateItem (const QString &s) |
void | itemChanged (const QString &s) |
Public Member Functions | |
HTableBrowser (QWidget *parent) | |
~HTableBrowser (void) | |
HTableBrowserElement * | currentElement (void) |
QString | currentKey (void) |
HTableBrowserElement * | elementByIndex (int n) |
bool | hasKey (QString key) |
QString * | keyByIndex (int n) |
int | numberOfElements (void) |
HTableBrowserElement * | queryNextElement (void) |
QString * | queryNextKey (void) |
QStringList * | queryNextValues (void) |
void | setBackgroundColor (QColor c) |
void | setColumnColor (int col, QColor c) |
void | setCursorColor (QColor c) |
void | setHeaderColor (QColor c) |
void | setHeaderColorCursor (QColor c) |
void | setSpecSort (int col, QString specsortname) |
HTableBrowserElement * | topElement (void) |
QString | topKey (void) |
QStringList * | valuesByIndex (int n) |
Public Attributes | |
int | mouseRightClickPosX |
int | mouseRightClickPosY |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *e) |
void | mouseDoubleClickEvent (QMouseEvent *e) |
void | mouseMoveEvent (QMouseEvent *e) |
bool | mouseNetClick (QMouseEvent *e, int rmode=NEED_UPDATE) |
void | mousePressEvent (QMouseEvent *e) |
void | mouseReleaseEvent (QMouseEvent *e) |
void | paintEvent (QPaintEvent *e) |
void | resizeEvent (QResizeEvent *e) |
bool | stepDown (void) |
bool | stepUp (void) |
void | wheelEvent (QWheelEvent *e) |
Protected Attributes | |
int | col_scroll |
QList< QColor > | colc |
QList< int > | colw |
HTableBrowserElement * | cur |
int | curc |
HTableBrowserElement * | end |
QFontMetrics * | fm |
QStringList | head |
bool | inscroll |
QString | last_right_clicked |
int | number |
int | plusw |
QMap< int, QColor > | precolor |
HTableBrowserElement * | query_cursor |
int | rowh |
QString | seek |
int | showrow |
QList< QString > | spec_sort |
HTableBrowserElement * | start |
HTableBrowserElement * | top |
HTableBrowser is a table view class, which can show the list of data groups (they can be a records).
This browser is designed to show/handle really big data tables without slow down.
Shows N column and M rows.
This viewer is a readonly viewer, you can't edit the content with it. Hovewer the list is readonly there is a cursor which marked an element to currently active. The HTableBrowser holds the data in a double linked list, memorize the beginning and the end of the displayed data part, so the browsing will be same speed, when the browser hold a dozen elements or more thousends. The elements are HTableBrowserElement objects. Every record have one key value, and N(column count) displayed value.
In the background this data browser uses bi-directional linked list to store the data, and handles the viewed area separatedly from the full list. There is not matter the size of the full list when drawing/scrolling or moving in the list but the displayed/drawed size only. This drawing is also fastened by pixmap caches, so a full screen scrollig is fast enough. The sorting is achived by quick sort algorithm to be the fastest as possible.
HTableBrowser::HTableBrowser | ( | QWidget * | parent | ) |
Creates a HTableBrowser class
parent | the parent widget of the HTableBrowser |
Definition at line 692 of file guilib.cpp.
HTableBrowser::~HTableBrowser | ( | void | ) |
Destructor. Deletes the elements too.
Definition at line 764 of file guilib.cpp.
|
signal |
This signal is activated if the user click on an item. The signal will pass the key value of the activated item
|
slot |
Adds a new element to the table. The new element will be placed the last position.
e | the new element. (You have to allocate the object, don't need to delete later, automatically deleted) |
Definition at line 830 of file guilib.cpp.
|
signal |
This signal is activated if the user right click on an item. The signal will pass the key value of the activated item
|
slot |
Clears every element from the table
Definition at line 786 of file guilib.cpp.
HTableBrowserElement * HTableBrowser::currentElement | ( | void | ) |
Returns the current element. Returns NULL, if there is not current. Don't delete the object!
Definition at line 1013 of file guilib.cpp.
QString HTableBrowser::currentKey | ( | void | ) |
Returns the key value of the current element
Definition at line 772 of file guilib.cpp.
|
slot |
Sets the cursor to the absolute first element
Definition at line 1096 of file guilib.cpp.
|
slot |
Sets the cursor to the absolute last element
Definition at line 1104 of file guilib.cpp.
HTableBrowserElement * HTableBrowser::elementByIndex | ( | int | n | ) |
Returns the HTableBrowserElement pointer in the position of the required index. If the element doesn't reachable NULL returned.
You will get a direct pointer, don't delete it!
n | the required index. (The first element is 0) |
Definition at line 1936 of file guilib.cpp.
|
slot |
It flushes the cell drawing cache
Definition at line 1596 of file guilib.cpp.
bool HTableBrowser::hasKey | ( | QString | key | ) |
Returns true if the table has an element with a key passed in parameter, otherwise return false.
Definition at line 2016 of file guilib.cpp.
|
signal |
This signal is activated if the user changed the current element. The signal will pass the key value of the new current item
QString * HTableBrowser::keyByIndex | ( | int | n | ) |
Returns the key (in a QString pointer) of HTableBrowserElement in the position of the required index. If the element doesn't reachable NULL returned.
You will get a new allocated object, you have to delete it!
n | the required index. (The first element is 0) |
Definition at line 1958 of file guilib.cpp.
|
protected |
Handle a mouse event
Definition at line 1308 of file guilib.cpp.
int HTableBrowser::numberOfElements | ( | void | ) |
Returns the number of the elements in the table (Number of rows)
Definition at line 1931 of file guilib.cpp.
HTableBrowserElement * HTableBrowser::queryNextElement | ( | void | ) |
Returns the HTableBrowserElement pointer in the position of the query cursor. After returning the pointer it steps to the next position. If we have already reached the end of the list NULL returned.
You will get a direct pointer, don't delete it!
Definition at line 1979 of file guilib.cpp.
QString * HTableBrowser::queryNextKey | ( | void | ) |
Returns the key (in a QString pointer) of the HTableBrowserElement in the position of the query cursor. After returning the key value it steps to the next position. If we have already reached the end of the list NULL returned.
You will get a new allocated object, you have to delete it!
Definition at line 2003 of file guilib.cpp.
QStringList * HTableBrowser::queryNextValues | ( | void | ) |
Returns the displayed values (in a QStringList pointer) of the HTableBrowserElement in the position of the query cursor. After returning the values it steps to the next position. If we have already reached the end of the list NULL returned.
You will get a new allocated object, you have to delete it!
Definition at line 1989 of file guilib.cpp.
|
slot |
Set the query cursor to the required position
Definition at line 1976 of file guilib.cpp.
|
slot |
Set the query cursor to the required position
Definition at line 1970 of file guilib.cpp.
|
slot |
Set the query cursor to the required position
Definition at line 1973 of file guilib.cpp.
|
slot |
Removes all elemet which have a same key passed in parameter.
key | the key value to delete. |
Definition at line 884 of file guilib.cpp.
void HTableBrowser::setBackgroundColor | ( | QColor | c | ) |
Sets the color of the backround
Definition at line 749 of file guilib.cpp.
void HTableBrowser::setColumnColor | ( | int | col, |
QColor | c | ||
) |
Sets the color of the specified column.
col | the index of the column to set the color |
c | the color to set |
Definition at line 819 of file guilib.cpp.
|
slot |
Sets the current elements.
the | requested KEY value to be current. The first element which have the key value matched with the c will be the currrent. |
t | (Optional) The key value of the top element of the DISPLAYED list. We can use this parameter to avoid unnecessary scrolling. The new current element always will be visible but: If we specify the currently displayed top element in parameter t(op), the browser will examine the visibility of the new current element. If it's possible the top element won't change. |
Definition at line 951 of file guilib.cpp.
|
slot |
Sets the current element by index
Definition at line 974 of file guilib.cpp.
|
inline |
|
inline |
|
inline |
|
slot |
Sets the header texts of the table. You have to call this funtion before you insert any elements!
h | the text of the headers. The QStringList have to have same number QString as the column of table. |
Definition at line 758 of file guilib.cpp.
void HTableBrowser::setSpecSort | ( | int | col, |
QString | specsortname | ||
) |
Set a sort modifier for a specified column.
col | the index of the modified sorting column. |
specsortname | name of the sort modifier. Now only can receive one modifier: "dropchar" which means the characters are dropped from the value and the result converted to integer, then the result is sorted. (For example if the sorted values are: id_1,id_10,id_14,id_2,id_21 will be 1,2,10,14,21 |
Definition at line 940 of file guilib.cpp.
|
slot |
Sets the displayed top element by index
Definition at line 990 of file guilib.cpp.
|
slot |
Sets the index of the column to sort the elements. The previous column will be the secondary sorting column. If you pass same column index which already set the sort order will be changed.
Example:
Definition at line 1563 of file guilib.cpp.
|
protected |
Step one item down
Definition at line 1047 of file guilib.cpp.
|
protected |
Step one item up
Definition at line 1020 of file guilib.cpp.
HTableBrowserElement * HTableBrowser::topElement | ( | void | ) |
Returns the first element on the display. (Top element) Don't delete the object!
Definition at line 1006 of file guilib.cpp.
QString HTableBrowser::topKey | ( | void | ) |
Returns the key of the first element on the display.
Definition at line 779 of file guilib.cpp.
QStringList * HTableBrowser::valuesByIndex | ( | int | n | ) |
Returns the displayed values (in a QStringList pointer) of HTableBrowserElement in the position of the required index. If the element doesn't reachable NULL returned.
You will get a new allocated object, you have to delete it!
n | the required index. (The first element is 0) |
Definition at line 1946 of file guilib.cpp.