Declare some utilities functions for QTableWidget.
More...
|
| QTableWidgetItem * | qtlSetTableHorizontalHeader (QTableWidget *table, int column, const QString &text, int alignment=Qt::AlignLeft|Qt::AlignVCenter) |
| | Set a header in a QTableWidget. More...
|
| |
| int | qtlSetTableRow (QTableWidget *table, int row, const QList< QTableWidgetItem *> &items) |
| | Set all items in a row of a QTableWidget. More...
|
| |
| int | qtlSetTableRow (QTableWidget *table, int row, const QStringList &texts, bool copyHeaderTextAlignment=false, Qt::ItemFlags flags=Qt::ItemIsEnabled, int checkBoxColumn=-1) |
| | Set the texts of all items in a row of a QTableWidget. More...
|
| |
| void | qtlSetTableRowStyle (QTableWidget *table, int row, const QColor &background=QColor(), const QColor &foreground=QColor(), Qt::BrushStyle style=Qt::SolidPattern) |
| | Set the text style of a row of a QTableWidget. More...
|
| |
| void | qtlSetTableStyle (QTableWidget *table, int firstRow, int lastRow, int firstColumn, int lastColumn, const QColor &background=QColor(), const QColor &foreground=QColor(), Qt::BrushStyle style=Qt::SolidPattern) |
| | Set the text style of a region of a QTableWidget. More...
|
| |
| QList< QTableWidgetItem * > | qtlTakeTableRow (QTableWidget *table, int row) |
| | Remove all items in a row of a QTableWidget and return them. More...
|
| |
Declare some utilities functions for QTableWidget.
Qtl, Qt utility library.
◆ qtlSetTableHorizontalHeader()
| QTableWidgetItem* qtlSetTableHorizontalHeader |
( |
QTableWidget * |
table, |
|
|
int |
column, |
|
|
const QString & |
text, |
|
|
int |
alignment = Qt::AlignLeft|Qt::AlignVCenter |
|
) |
| |
Set a header in a QTableWidget.
- Parameters
-
| [in,out] | table | The table to modify. |
| [in] | column | Header column, starting at zero. |
| [in] | text | Header text. |
| [in] | alignment | Header alignment. |
- Returns
- The created item.
◆ qtlTakeTableRow()
| QList<QTableWidgetItem*> qtlTakeTableRow |
( |
QTableWidget * |
table, |
|
|
int |
row |
|
) |
| |
Remove all items in a row of a QTableWidget and return them.
- Parameters
-
| [in,out] | table | The table to modify. |
| [in] | row | The row to remove. |
- Returns
- A list of removed items.
◆ qtlSetTableRow() [1/2]
| int qtlSetTableRow |
( |
QTableWidget * |
table, |
|
|
int |
row, |
|
|
const QList< QTableWidgetItem *> & |
items |
|
) |
| |
Set all items in a row of a QTableWidget.
- Parameters
-
| [in,out] | table | The table to modify. |
| [in] | row | The row to set. If outside the table size, the table is enlarged. |
| [in] | items | A list of items to set. The QTableWidget takes ownership of the items. |
- Returns
- The row number. This may not be identical to row if automatic sorting was enabled.
◆ qtlSetTableRow() [2/2]
| int qtlSetTableRow |
( |
QTableWidget * |
table, |
|
|
int |
row, |
|
|
const QStringList & |
texts, |
|
|
bool |
copyHeaderTextAlignment = false, |
|
|
Qt::ItemFlags |
flags = Qt::ItemIsEnabled, |
|
|
int |
checkBoxColumn = -1 |
|
) |
| |
Set the texts of all items in a row of a QTableWidget.
- Parameters
-
| [in,out] | table | The table to modify. |
| [in] | row | The row to set. If outside the table size, the table is enlarged. |
| [in] | texts | The texts to set in the various columns of the row. |
| [in] | copyHeaderTextAlignment | If true, set the text alignment to the same value as the header of the same column. |
| [in] | flags | The flags to set in all cells in this row. If checkBoxColumn is non-negative, the cell with the checkbox automatically has flags Qt::ItemIsUserCheckable and Qt::ItemIsEnabled. |
| [in] | checkBoxColumn | Add a checkbox in this column. Ignored if negative. |
- Returns
- The row number. This may not be identical to row if automatic sorting was enabled.
◆ qtlSetTableStyle()
| void qtlSetTableStyle |
( |
QTableWidget * |
table, |
|
|
int |
firstRow, |
|
|
int |
lastRow, |
|
|
int |
firstColumn, |
|
|
int |
lastColumn, |
|
|
const QColor & |
background = QColor(), |
|
|
const QColor & |
foreground = QColor(), |
|
|
Qt::BrushStyle |
style = Qt::SolidPattern |
|
) |
| |
Set the text style of a region of a QTableWidget.
- Parameters
-
| [in,out] | table | The table to modify. |
| [in] | firstRow | First row in table to modify. |
| [in] | lastRow | Last row in table to modify. |
| [in] | firstColumn | First column in table to modify. |
| [in] | lastColumn | Last column in table to modify. |
| [in] | background | Background color. Ignored if omitted. |
| [in] | foreground | Foreground color. Ignored if omitted. |
| [in] | style | Background color style. |
◆ qtlSetTableRowStyle()
| void qtlSetTableRowStyle |
( |
QTableWidget * |
table, |
|
|
int |
row, |
|
|
const QColor & |
background = QColor(), |
|
|
const QColor & |
foreground = QColor(), |
|
|
Qt::BrushStyle |
style = Qt::SolidPattern |
|
) |
| |
Set the text style of a row of a QTableWidget.
- Parameters
-
| [in,out] | table | The table to modify. |
| [in] | row | Row in table to modify. |
| [in] | background | Background color. Ignored if omitted. |
| [in] | foreground | Foreground color. Ignored if omitted. |
| [in] | style | Background color style. |