WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. | Zuble QML Types | Zuble C++ Classes | Zuble Overview |
Zuble
0.1
Zuble Framework C++/QML extension API
|
A table data object contains the role data and model item flags for a 2 dimensional array of model data cells. More...
#include <ZblTableData.h>
Public Types | |
typedef QList< QString > | zColumnNames |
typedef QList< QList< int > > | zFlagsTable |
typedef QMap< int, QVariant > | zCellValue |
typedef QList< QVariant > | zDataRow |
typedef QList< zDataRow > | zDataTable |
typedef QMap< int, zDataRow > | zRoleRow |
typedef QList< zRoleRow > | zRoleRowList |
typedef QMap< int, QVariant > | zTableRow |
typedef QList< zTableRow > | zTableRowList |
typedef QMap< int, zDataTable > | zRoleTable |
Public Member Functions | |
ZblTableData () | |
void | putValue (int role, int row, int col, const QVariant value) |
Replaces the current value of a cell's role. This is a blocking call. with the specified value. More... | |
QVariant | getValue (int role, int row, int col) const |
Obtains the value of the specified cell and role. This is a blocking call. More... | |
void | putTableColumnRows (QVariant rows, int startRow, int col) |
Replaces the current value for a set of rows for a single model column. More... | |
QVariant | getTableColumnRows (QList< int > roles, int startRow, int col, int rowCount) const |
Obtain data values for a set of rows from a single model column. More... | |
bool | hasCell (int role, int row, int col) const |
Determines if the specified cell and role combination exists in the data table. More... | |
bool | hasCell (int row, int col) const |
Determines if the specified cell exists in the data table. More... | |
void | appendRow (zRoleRow data) |
Appends a row of role values to the table data. More... | |
void | appendRows (zRoleRowList data) |
Appends a list of rows of role values to the table data. More... | |
void | prependRow (zRoleRow data) |
Prepends a row of role values to the table data. More... | |
void | prependRows (zRoleRowList data) |
Prepends a list of rows of role values to the table data. More... | |
void | removeRows (int row, int count) |
Removes one or more rows from the table. More... | |
void | clearData () |
Removes all rows from the data table. More... | |
bool | addRole (int role) |
Adds the specified role to the data table. The table must not contain data rows when calling this method. More... | |
bool | hasRole (int role) const |
Determines if a specified role already exists in the data table. More... | |
QList< int > | roles () const |
Determines which roles are in the data set. More... | |
int | roleCount () const |
Determines the current number of roles in the data table. More... | |
void | clearRoles () |
Removes all roles and data rows from the data table. More... | |
int | columnCount () const |
Determines the number of columns in the data table. More... | |
void | setColumnCount (int count) |
Sets the number of columns in the data table. This method fails if the data table contains rows. More... | |
int | rowCount () const |
Determines the number of rows in the data table. More... | |
void | dumpData () const |
Prints diagnostic information about the state of the contained data to debug output. More... | |
int | findNextItemRow (int startRow, const QString &text, int column=0, bool caseSensitive=true, bool forwardDirection=true, bool keySearch=false) const |
bool | copyColumn (int fromColumn, int toColumn) |
Private Member Functions | |
void | pushRow (zRoleRow data, bool front=false) |
Private Attributes | |
zFlagsTable | m_childFlags |
A two dimensional array of child cell flags. Dimensions of the array are row and column. TBD: Sorry, not yet implemented! More... | |
zRoleTable | m_roles |
A three dimensional array of child cell data. Dimensions of the array are role, row and column. More... | |
int | m_columnCount |
The number of columns in the child data table. More... | |
int | m_rowCount |
The number of rows in the child data table. More... | |
A table data object contains the role data and model item flags for a 2 dimensional array of model data cells.
A separate table is stored for each role in the data set. Before adding rows you should call addRole() to add roles to the data set and setColumnCount() to set the table size.
TBD: this should be refactored into separate abstract and implementation classes to support selectable cell engines OR the cell engine should be optimized for 2 dimensions.
Definition at line 51 of file ZblTableData.h.
typedef QMap<int,QVariant> Zbl::ZblTableData::zCellValue |
Definition at line 59 of file ZblTableData.h.
typedef QList<QString> Zbl::ZblTableData::zColumnNames |
Definition at line 55 of file ZblTableData.h.
typedef QList<QVariant> Zbl::ZblTableData::zDataRow |
Definition at line 61 of file ZblTableData.h.
typedef QList<zDataRow> Zbl::ZblTableData::zDataTable |
Definition at line 63 of file ZblTableData.h.
typedef QList<QList<int> > Zbl::ZblTableData::zFlagsTable |
Definition at line 57 of file ZblTableData.h.
typedef QMap<int, zDataRow> Zbl::ZblTableData::zRoleRow |
Definition at line 65 of file ZblTableData.h.
typedef QList<zRoleRow> Zbl::ZblTableData::zRoleRowList |
Definition at line 67 of file ZblTableData.h.
typedef QMap<int, zDataTable> Zbl::ZblTableData::zRoleTable |
Definition at line 73 of file ZblTableData.h.
typedef QMap<int, QVariant> Zbl::ZblTableData::zTableRow |
Definition at line 69 of file ZblTableData.h.
typedef QList<zTableRow> Zbl::ZblTableData::zTableRowList |
Definition at line 71 of file ZblTableData.h.
Zbl::ZblTableData::ZblTableData | ( | ) |
Definition at line 32 of file ZblTableData.cpp.
bool Zbl::ZblTableData::addRole | ( | int | role | ) |
Adds the specified role to the data table. The table must not contain data rows when calling this method.
If the data table is already populated with rows an exception is thrown.
role | the role to be added |
Definition at line 293 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::addRole().
void Zbl::ZblTableData::appendRow | ( | zRoleRow | data | ) |
Appends a row of role values to the table data.
Only roles that currently exist in the data table will be appended. Roles that don't exist will be silently ignored. Call the ZblDataTable::addRole() method to add roles to the data table before calling this method.
data | a QMap<int, QList<QVariant> >, which is a map containing a list of variants for each role/column |
Definition at line 195 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::appendRow().
void Zbl::ZblTableData::appendRows | ( | zRoleRowList | data | ) |
Appends a list of rows of role values to the table data.
Only roles that currently exist in the data table will be appended. Roles that don't exist will be silently ignored. Call the ZblDataTable::addRole() method to add roles to the data table before calling this method.
data | a QList<QMap<int, QList<QVariant> > >, which is a list of maps containing a list of variants for each role/row |
Definition at line 200 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::appendRows().
void Zbl::ZblTableData::clearData | ( | ) |
Removes all rows from the data table.
Definition at line 262 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::clearData().
void Zbl::ZblTableData::clearRoles | ( | ) |
Removes all roles and data rows from the data table.
Definition at line 284 of file ZblTableData.cpp.
int Zbl::ZblTableData::columnCount | ( | ) | const |
Determines the number of columns in the data table.
Definition at line 474 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::columnCount().
bool Zbl::ZblTableData::copyColumn | ( | int | fromColumn, |
int | toColumn | ||
) |
Definition at line 375 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::copyColumn().
void Zbl::ZblTableData::dumpData | ( | ) | const |
Prints diagnostic information about the state of the contained data to debug output.
Definition at line 36 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::dumpModelData().
int Zbl::ZblTableData::findNextItemRow | ( | int | startRow, |
const QString & | text, | ||
int | column = 0 , |
||
bool | caseSensitive = true , |
||
bool | forwardDirection = true , |
||
bool | keySearch = false |
||
) | const |
Definition at line 310 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::findNextItemRow().
QVariant Zbl::ZblTableData::getTableColumnRows | ( | QList< int > | roles, |
int | startRow, | ||
int | col, | ||
int | rowCount | ||
) | const |
Obtain data values for a set of rows from a single model column.
Only data for the model roles specified in the roles parameter will be returned. Data is returned in a zTableRowList structure, which is a list of maps, each of which contains a data value for each role that was requested to be returned.
roles | A list of model role values determines which model roles will be returned |
startRow | The first model row to return |
col | The model column to return |
rowCount | The number of rows to return |
Definition at line 135 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::getTableColumnRows().
QVariant Zbl::ZblTableData::getValue | ( | int | role, |
int | row, | ||
int | col | ||
) | const |
Obtains the value of the specified cell and role. This is a blocking call.
role | |
row | |
col |
Definition at line 100 of file ZblTableData.cpp.
Referenced by copyColumn(), Zbl::ZblDataModel::data(), dumpData(), and getTableColumnRows().
bool Zbl::ZblTableData::hasCell | ( | int | role, |
int | row, | ||
int | col | ||
) | const |
Determines if the specified cell and role combination exists in the data table.
role | |
row | |
col |
Definition at line 182 of file ZblTableData.cpp.
Referenced by getValue(), Zbl::ZblTableCell::hasCell(), and putValue().
bool Zbl::ZblTableData::hasCell | ( | int | row, |
int | col | ||
) | const |
Determines if the specified cell exists in the data table.
row | |
col |
Definition at line 190 of file ZblTableData.cpp.
bool Zbl::ZblTableData::hasRole | ( | int | role | ) | const |
Determines if a specified role already exists in the data table.
Definition at line 458 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::hasRole().
void Zbl::ZblTableData::prependRow | ( | zRoleRow | data | ) |
Prepends a row of role values to the table data.
Only roles that currently exist in the data table will be prepended. Roles that don't exist will be silently ignored. Call the ZblDataTable::addRole() method to add roles to the data table before calling this method.
data | a QMap<int, QList<QVariant> >, which is a map containing a list of variants for each role/row |
Definition at line 215 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::prependRow().
void Zbl::ZblTableData::prependRows | ( | zRoleRowList | data | ) |
Prepends a list of rows of role values to the table data.
Only roles that currently exist in the data table will be prepended. Roles that don't exist will be silently ignored. Call the ZblDataTable::addRole() method to add roles to the data table before calling this method.
data | a QList<QMap<int, QList<QVariant> > >, which is a list of maps containing a list of variants for each role/row |
Definition at line 220 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::prependRows().
|
private |
Definition at line 392 of file ZblTableData.cpp.
Referenced by appendRow(), appendRows(), prependRow(), and prependRows().
void Zbl::ZblTableData::putTableColumnRows | ( | QVariant | rows, |
int | startRow, | ||
int | col | ||
) |
Replaces the current value for a set of rows for a single model column.
Only data for the model roles specified contained in the rows parameter is replaced. Values for roles not contained in the rows parameter are not modified by this method.
rows | A QVaraint containing a zTableRowList structure containing the row data to be replaced |
startRow | The row number of the first row to be replaced |
col | The column number of the row to be replaced |
Definition at line 109 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::putTableColumnRows().
void Zbl::ZblTableData::putValue | ( | int | role, |
int | row, | ||
int | col, | ||
const QVariant | value | ||
) |
Replaces the current value of a cell's role. This is a blocking call. with the specified value.
role | |
row | |
col | |
value |
ZblException | if specified role or cell doesn't exist |
Definition at line 84 of file ZblTableData.cpp.
Referenced by copyColumn(), putTableColumnRows(), and Zbl::ZblDataModel::setData().
void Zbl::ZblTableData::removeRows | ( | int | row, |
int | count | ||
) |
Removes one or more rows from the table.
row | Row number of the first row to remove. Row numbers start at zero. |
count | The number of rows to remove. |
Definition at line 234 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::removeRows().
int Zbl::ZblTableData::roleCount | ( | ) | const |
Determines the current number of roles in the data table.
Definition at line 468 of file ZblTableData.cpp.
Referenced by copyColumn(), dumpData(), findNextItemRow(), getTableColumnRows(), pushRow(), and Zbl::ZblDataModel::roleCount().
QList< int > Zbl::ZblTableData::roles | ( | ) | const |
Determines which roles are in the data set.
Definition at line 463 of file ZblTableData.cpp.
Referenced by copyColumn(), dumpData(), putTableColumnRows(), and Zbl::ZblDataModel::roles().
int Zbl::ZblTableData::rowCount | ( | ) | const |
Determines the number of rows in the data table.
Definition at line 488 of file ZblTableData.cpp.
Referenced by appendRows(), prependRows(), and Zbl::ZblDataModel::rowCount().
void Zbl::ZblTableData::setColumnCount | ( | int | count | ) |
Sets the number of columns in the data table. This method fails if the data table contains rows.
Definition at line 479 of file ZblTableData.cpp.
Referenced by Zbl::ZblDataModel::setColumnCount().
|
private |
A two dimensional array of child cell flags. Dimensions of the array are row and column. TBD: Sorry, not yet implemented!
Definition at line 384 of file ZblTableData.h.
|
private |
The number of columns in the child data table.
Definition at line 401 of file ZblTableData.h.
Referenced by columnCount(), dumpData(), findNextItemRow(), hasCell(), pushRow(), and setColumnCount().
|
private |
A three dimensional array of child cell data. Dimensions of the array are role, row and column.
Data is arranged as a map of roles, each role consisting of a two dimensional array of variants.
Definition at line 395 of file ZblTableData.h.
Referenced by addRole(), clearData(), clearRoles(), findNextItemRow(), getValue(), hasCell(), hasRole(), pushRow(), putValue(), removeRows(), roleCount(), and roles().
|
private |
The number of rows in the child data table.
Definition at line 407 of file ZblTableData.h.
Referenced by addRole(), clearData(), clearRoles(), copyColumn(), dumpData(), findNextItemRow(), getTableColumnRows(), hasCell(), pushRow(), removeRows(), rowCount(), and setColumnCount().
Zuble documentation copyright © 2019 Bob Dinitto. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Zuble is a derivative work of Qt version 5. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.