QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlTableWidgetUtils.h File Reference

Declare some utilities functions for QTableWidget. More...

Functions

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...
 

Detailed Description

Declare some utilities functions for QTableWidget.

Qtl, Qt utility library.

Function Documentation

◆ 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]tableThe table to modify.
[in]columnHeader column, starting at zero.
[in]textHeader text.
[in]alignmentHeader 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]tableThe table to modify.
[in]rowThe 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]tableThe table to modify.
[in]rowThe row to set. If outside the table size, the table is enlarged.
[in]itemsA 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]tableThe table to modify.
[in]rowThe row to set. If outside the table size, the table is enlarged.
[in]textsThe texts to set in the various columns of the row.
[in]copyHeaderTextAlignmentIf true, set the text alignment to the same value as the header of the same column.
[in]flagsThe 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]checkBoxColumnAdd 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]tableThe table to modify.
[in]firstRowFirst row in table to modify.
[in]lastRowLast row in table to modify.
[in]firstColumnFirst column in table to modify.
[in]lastColumnLast column in table to modify.
[in]backgroundBackground color. Ignored if omitted.
[in]foregroundForeground color. Ignored if omitted.
[in]styleBackground 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]tableThe table to modify.
[in]rowRow in table to modify.
[in]backgroundBackground color. Ignored if omitted.
[in]foregroundForeground color. Ignored if omitted.
[in]styleBackground color style.