Tome
A generic data editor for games supporting arbitrary input and output formats.
Public Member Functions | List of all members
Tome::RecordTreeWidgetItem Class Reference

Selectable item in the record hierarchy. More...

#include <recordtreewidgetitem.h>

Inheritance diagram for Tome::RecordTreeWidgetItem:

Public Member Functions

 RecordTreeWidgetItem (const QVariant &id, const QString &displayName, const QVariant &parentId, const bool readOnly)
 Constructs a new selectable item in the record hierarchy. More...
 
QVariant getId () const
 Gets the unique id of the record. More...
 
QString getDisplayName () const
 Gets the display name of the record. More...
 
QVariant getParentId () const
 Gets the id of the parent of the record in the hierarchy. More...
 
bool isReadOnly () const
 Gets whether to prevent the record from being edited, reparented or removed. More...
 
void setId (const QVariant &id)
 Sets the unique id of the record. More...
 
void setDisplayName (const QString &displayName)
 Sets the display name of the record to show in the hierarchy. More...
 
void setParentId (const QVariant &parentId)
 Sets the id of the parent of the record in the hierarchy. More...
 
void setReadOnly (const bool readOnly)
 Sets whether to prevent the record from being edited, reparented or removed. More...
 
bool operator< (const QTreeWidgetItem &other) const Q_DECL_OVERRIDE
 Compares this record tree widget item with the specified other one for order. More...
 

Detailed Description

Selectable item in the record hierarchy.

Constructor & Destructor Documentation

◆ RecordTreeWidgetItem()

RecordTreeWidgetItem::RecordTreeWidgetItem ( const QVariant &  id,
const QString &  displayName,
const QVariant &  parentId,
const bool  readOnly 
)

Constructs a new selectable item in the record hierarchy.

Parameters
idUnique id of the record.
displayNameDisplay name of the record.
parentIdId of the parent of the record, or null if the record is a root of the hierarchy.
readOnlyWhether to prevent the record from being edited, reparented or removed.

Member Function Documentation

◆ getDisplayName()

QString RecordTreeWidgetItem::getDisplayName ( ) const

Gets the display name of the record.

Returns
Display name of the record.

◆ getId()

QVariant RecordTreeWidgetItem::getId ( ) const

Gets the unique id of the record.

Returns
Unique id of the record.

◆ getParentId()

QVariant RecordTreeWidgetItem::getParentId ( ) const

Gets the id of the parent of the record in the hierarchy.

Returns
Id of the parent of the record, or null if the record is a root of the hierarchy.

◆ isReadOnly()

bool RecordTreeWidgetItem::isReadOnly ( ) const

Gets whether to prevent the record from being edited, reparented or removed.

Returns
Whether to prevent the record from being edited, reparented or removed.

◆ operator<()

bool Tome::RecordTreeWidgetItem::operator< ( const QTreeWidgetItem &  other) const
inline

Compares this record tree widget item with the specified other one for order.

Parameters
otherOther record tree widget item to compare this one to.
Returns
true, if the display name of the record represented by this tree widget item is larger than the display name of the record represented by the other one, with respect to alphabetical order, and false otherwise.

◆ setDisplayName()

void RecordTreeWidgetItem::setDisplayName ( const QString &  displayName)

Sets the display name of the record to show in the hierarchy.

Parameters
displayNameNew display name of the record to show in the hierarchy.

◆ setId()

void RecordTreeWidgetItem::setId ( const QVariant &  id)

Sets the unique id of the record.

Parameters
idNew unique id of the record.

◆ setParentId()

void RecordTreeWidgetItem::setParentId ( const QVariant &  parentId)

Sets the id of the parent of the record in the hierarchy.

Parameters
parentIdNew id of the parent of the record, or null to make the record a root of the hierarchy.

◆ setReadOnly()

void RecordTreeWidgetItem::setReadOnly ( const bool  readOnly)

Sets whether to prevent the record from being edited, reparented or removed.

Parameters
readOnlyWhether to prevent the record from being edited, reparented or removed.

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