QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlTlvTableWidget Class Reference

A subclass of QTableWidget to edit a list of TLV items. More...

Inheritance diagram for QtlTlvTableWidget:

Public Slots

void clear ()
 Clear the table content. More...
 

Public Member Functions

 QtlTlvTableWidget (QWidget *parent=0)
 Constructor. More...
 
template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
QtlByteBlock binaryValue () const
 Get the binary serialized value of the edited TLV list. More...
 
int getSelectedTlvRow () const
 Get the first selected row in the TLV editor. More...
 
template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void getTlvList (QtlTlvList< TAG, LENGTH, ORDER > &tlvList) const
 Get the content of the table widget as a list of TLV. More...
 
template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
bool getTlvRow (int row, QtlTlv< TAG, LENGTH, ORDER > &tlv) const
 Get the content of a row in the TLV editor. More...
 
template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void setBinaryValue (const QtlByteBlock &value)
 Set the edited TLV list from a binary serialized TLV list. More...
 
void setTagNames (const QtlNamedIntSet &tagNames)
 Set the list of known tag names. More...
 
template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void setTlvList (const QtlTlvList< TAG, LENGTH, ORDER > &tlvList)
 Set the content of the table widget from a list of TLV. More...
 
template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void setTlvRow (int row, const QtlTlv< TAG, LENGTH, ORDER > &tlv)
 Set the content of a row in the TLV editor. More...
 
void setValueHexDigitGroupSize (int valueHexDigitGroupSize)
 Set the number of hex digits per group as displayed in value. More...
 
const QtlNamedIntSettagNames () const
 Get a constant reference to the list of known tag names. More...
 
int valueHexDigitGroupSize () const
 Get the number of hex digits per group as displayed in value. More...
 

Private Slots

void tlvDeleteSelected ()
 Delete selected row in TLV editor. More...
 
void tlvInsertAfterSelected ()
 Insert one row in TLV editor after selected one. More...
 
void tlvInsertBeforeSelected ()
 Insert one row in TLV editor before selected one. More...
 
void tlvMoveSelectedDown ()
 Move selected row down in TLV editor. More...
 
void tlvMoveSelectedUp ()
 Move selected row up in TLV editor. More...
 

Private Member Functions

 QtlTlvTableWidget () Q_DECL_EQ_DELETE
 
void setTlvRowData (int row, quint32 tag, const QtlByteBlock &value)
 Set the content of a row in the TLV editor. More...
 

Private Attributes

QtlNamedIntSet _tagNames
 List of known tags. More...
 
int _valueHexDigitGroupSize
 Number of hex digits per group as displayed in value. More...
 

Detailed Description

A subclass of QTableWidget to edit a list of TLV items.

The corresponding table has two columns. Each row contains an editable pair of tag / value.

The first column contains the tags. The tags may have known names defined by a QtlNamedIntSet instance. The tag names are used for display and edition using a combo box.

The second column contains the values. Each value is simply an editable haxadecimal string.

A context menu (right-click) proposes the following options:

  • Insert before this one
  • Insert after this one
  • Move up (Ctrl-Up arrow)
  • Move down (Ctrl-Down arrow)
  • Delete

Constructor & Destructor Documentation

◆ QtlTlvTableWidget() [1/2]

QtlTlvTableWidget::QtlTlvTableWidget ( QWidget *  parent = 0)
explicit

Constructor.

Parameters
[in]parentOptional parent widget.

◆ QtlTlvTableWidget() [2/2]

QtlTlvTableWidget::QtlTlvTableWidget ( )
private

Member Function Documentation

◆ setTagNames()

void QtlTlvTableWidget::setTagNames ( const QtlNamedIntSet tagNames)
inline

Set the list of known tag names.

This list is used to display and edit the tags.

Parameters
[in]tagNamesThe list of known tag names.

◆ tagNames()

const QtlNamedIntSet& QtlTlvTableWidget::tagNames ( ) const
inline

Get a constant reference to the list of known tag names.

Returns
A constant reference to the list of known tag names.

◆ setValueHexDigitGroupSize()

void QtlTlvTableWidget::setValueHexDigitGroupSize ( int  valueHexDigitGroupSize)
inline

Set the number of hex digits per group as displayed in value.

Parameters
[in]valueHexDigitGroupSizeThe number of hex digits per group as displayed in value. When negative or zero, there is no digit grouping and all hex digits are contiguous.

◆ valueHexDigitGroupSize()

int QtlTlvTableWidget::valueHexDigitGroupSize ( ) const
inline

Get the number of hex digits per group as displayed in value.

Returns
The number of hex digits per group as displayed in value. When zero, there is no digit grouping and all hex digits are contiguous.

◆ getTlvList()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void QtlTlvTableWidget::getTlvList ( QtlTlvList< TAG, LENGTH, ORDER > &  tlvList) const

Get the content of the table widget as a list of TLV.

Template Parameters
TAGAn integer type representing tag fields.
LENGTHAn integer type representing length fields.
ORDERByte order to use for serialization.
Parameters
[out]tlvListThe return list of TLV.

◆ setTlvList()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void QtlTlvTableWidget::setTlvList ( const QtlTlvList< TAG, LENGTH, ORDER > &  tlvList)

Set the content of the table widget from a list of TLV.

Template Parameters
TAGAn integer type representing tag fields.
LENGTHAn integer type representing length fields.
ORDERByte order to use for serialization.
Parameters
[in]tlvListThe list of TLV to set.

◆ binaryValue()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
QtlByteBlock QtlTlvTableWidget::binaryValue ( ) const

Get the binary serialized value of the edited TLV list.

Template Parameters
TAGAn integer type representing tag fields.
LENGTHAn integer type representing length fields.
ORDERByte order to use for serialization.
Returns
The binary serialized value of the edited TLV list.

◆ setBinaryValue()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void QtlTlvTableWidget::setBinaryValue ( const QtlByteBlock value)

Set the edited TLV list from a binary serialized TLV list.

Template Parameters
TAGAn integer type representing tag fields.
LENGTHAn integer type representing length fields.
ORDERByte order to use for serialization.
Parameters
[in]valueThe binary serialized value of a TLV list. If invalid, only keep the first items which can be parsed.

◆ getTlvRow()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
bool QtlTlvTableWidget::getTlvRow ( int  row,
QtlTlv< TAG, LENGTH, ORDER > &  tlv 
) const

Get the content of a row in the TLV editor.

Template Parameters
TAGAn integer type representing tag fields.
LENGTHAn integer type representing length fields.
ORDERByte order to use for serialization.
Parameters
[in]rowRow index.
[out]tlvThe value extracted from the row. Unchanged on error.
Returns
True on success, false on error (non-existent row, invalid value).

◆ setTlvRow()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void QtlTlvTableWidget::setTlvRow ( int  row,
const QtlTlv< TAG, LENGTH, ORDER > &  tlv 
)
inline

Set the content of a row in the TLV editor.

Template Parameters
TAGAn integer type representing tag fields.
LENGTHAn integer type representing length fields.
ORDERByte order to use for serialization.
Parameters
[in]rowRow index.
[in]tlvThe value to set in the row.

◆ getSelectedTlvRow()

int QtlTlvTableWidget::getSelectedTlvRow ( ) const

Get the first selected row in the TLV editor.

Returns
The first selected row or -1 if none is selected.

◆ clear

void QtlTlvTableWidget::clear ( )
slot

Clear the table content.

Reimplemented from QTableWidget.

◆ tlvInsertBeforeSelected

void QtlTlvTableWidget::tlvInsertBeforeSelected ( )
privateslot

Insert one row in TLV editor before selected one.

◆ tlvInsertAfterSelected

void QtlTlvTableWidget::tlvInsertAfterSelected ( )
privateslot

Insert one row in TLV editor after selected one.

◆ tlvMoveSelectedUp

void QtlTlvTableWidget::tlvMoveSelectedUp ( )
privateslot

Move selected row up in TLV editor.

◆ tlvMoveSelectedDown

void QtlTlvTableWidget::tlvMoveSelectedDown ( )
privateslot

Move selected row down in TLV editor.

◆ tlvDeleteSelected

void QtlTlvTableWidget::tlvDeleteSelected ( )
privateslot

Delete selected row in TLV editor.

◆ setTlvRowData()

void QtlTlvTableWidget::setTlvRowData ( int  row,
quint32  tag,
const QtlByteBlock value 
)
private

Set the content of a row in the TLV editor.

Parameters
[in]rowRow index.
[in]tagThe tag to set in the row.
[in]valueThe value to set in the row.

Member Data Documentation

◆ _tagNames

QtlNamedIntSet QtlTlvTableWidget::_tagNames
private

List of known tags.

◆ _valueHexDigitGroupSize

int QtlTlvTableWidget::_valueHexDigitGroupSize
private

Number of hex digits per group as displayed in value.


The documentation for this class was generated from the following files: