A subclass of QTableWidget to edit a list of TLV items. More...
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 QtlNamedIntSet & | tagNames () 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... | |
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:
|
explicit |
Constructor.
[in] | parent | Optional parent widget. |
|
private |
|
inline |
Set the list of known tag names.
This list is used to display and edit the tags.
[in] | tagNames | The list of known tag names. |
|
inline |
Get a constant reference to the list of known tag names.
|
inline |
Set the number of hex digits per group as displayed in value.
[in] | valueHexDigitGroupSize | The 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. |
|
inline |
Get the number of hex digits per group as displayed in value.
void QtlTlvTableWidget::getTlvList | ( | QtlTlvList< TAG, LENGTH, ORDER > & | tlvList | ) | const |
Get the content of the table widget as a list of TLV.
TAG | An integer type representing tag fields. |
LENGTH | An integer type representing length fields. |
ORDER | Byte order to use for serialization. |
[out] | tlvList | The return list of TLV. |
void QtlTlvTableWidget::setTlvList | ( | const QtlTlvList< TAG, LENGTH, ORDER > & | tlvList | ) |
Set the content of the table widget from a list of TLV.
TAG | An integer type representing tag fields. |
LENGTH | An integer type representing length fields. |
ORDER | Byte order to use for serialization. |
[in] | tlvList | The list of TLV to set. |
QtlByteBlock QtlTlvTableWidget::binaryValue | ( | ) | const |
Get the binary serialized value of the edited TLV list.
TAG | An integer type representing tag fields. |
LENGTH | An integer type representing length fields. |
ORDER | Byte order to use for serialization. |
void QtlTlvTableWidget::setBinaryValue | ( | const QtlByteBlock & | value | ) |
Set the edited TLV list from a binary serialized TLV list.
TAG | An integer type representing tag fields. |
LENGTH | An integer type representing length fields. |
ORDER | Byte order to use for serialization. |
[in] | value | The binary serialized value of a TLV list. If invalid, only keep the first items which can be parsed. |
bool QtlTlvTableWidget::getTlvRow | ( | int | row, |
QtlTlv< TAG, LENGTH, ORDER > & | tlv | ||
) | const |
Get the content of a row in the TLV editor.
TAG | An integer type representing tag fields. |
LENGTH | An integer type representing length fields. |
ORDER | Byte order to use for serialization. |
[in] | row | Row index. |
[out] | tlv | The value extracted from the row. Unchanged on error. |
|
inline |
Set the content of a row in the TLV editor.
TAG | An integer type representing tag fields. |
LENGTH | An integer type representing length fields. |
ORDER | Byte order to use for serialization. |
[in] | row | Row index. |
[in] | tlv | The value to set in the row. |
int QtlTlvTableWidget::getSelectedTlvRow | ( | ) | const |
Get the first selected row in the TLV editor.
|
slot |
Clear the table content.
Reimplemented from QTableWidget.
|
privateslot |
Insert one row in TLV editor before selected one.
|
privateslot |
Insert one row in TLV editor after selected one.
|
privateslot |
Move selected row up in TLV editor.
|
privateslot |
Move selected row down in TLV editor.
|
privateslot |
Delete selected row in TLV editor.
|
private |
Set the content of a row in the TLV editor.
[in] | row | Row index. |
[in] | tag | The tag to set in the row. |
[in] | value | The value to set in the row. |
|
private |
List of known tags.
|
private |
Number of hex digits per group as displayed in value.