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

Window for adding a new record or editing an existing one. More...

#include <recordwindow.h>

Inheritance diagram for RecordWindow:

Public Slots

void accept ()
 Validates all data and closes this window if successful.
 

Public Member Functions

 RecordWindow (QWidget *parent=0)
 Constructs a new window for adding a new record or editing an existing one. More...
 
QString getRecordDisplayName () const
 Gets the display name of the record. More...
 
QString getRecordEditorIconFieldId () const
 Gets the id of the field to use as editor icon for the record. More...
 
QVariant getRecordId () const
 Gets the unique id of the record. More...
 
QMap< QString, Tome::RecordFieldState::RecordFieldState > getRecordFields () const
 Gets which fields are used by the record. More...
 
QString getRecordSetName () const
 Gets the name of the set the record belongs to. More...
 
void setDisallowedRecordIds (const QVariantList disallowedRecordIds)
 Sets the list of record ids that are prohibited (e.g. because other records with the same id exist). More...
 
void setRecordDisplayName (const QString &displayName)
 Sets the display name of the record. More...
 
void setRecordId (const QVariant &id)
 Sets the unique id of the record. More...
 
void setRecordIdLocked (const bool recordIdLocked)
 Sets whether to automatically update the record id to reflect the display name, or not. More...
 
void setRecordIdType (const Tome::RecordIdType::RecordIdType recordIdType)
 Sets the type of the id of the record. More...
 
void setRecordEditorIconFieldId (const QString &editorIconFieldId)
 Sets the id of the field to use as editor icon for the record. More...
 
void setRecordFields (const Tome::FieldDefinitionList &fieldDefinitions)
 Sets the list of available record fields, initially disabling all of them. More...
 
void setRecordFields (const Tome::FieldDefinitionList &fieldDefinitions, const Tome::ComponentList &componentDefinitions, const Tome::RecordFieldValueMap &ownFieldValues, const Tome::RecordFieldValueMap &inheritedFieldValues)
 Sets the list of fields used by the record. More...
 
void setRecordComponents (const Tome::ComponentList &components)
 Sets the list of available components. More...
 
void setRecordSetName (const QString &recordSetName)
 Sets the name of the set the record belongs to. More...
 
void setRecordSetNames (const QStringList &recordSetNames)
 Sets the list of available record sets. More...
 

Protected Member Functions

void showEvent (QShowEvent *event)
 Sets up this window, e.g. by setting the focus on the first widget. More...
 

Detailed Description

Window for adding a new record or editing an existing one.

Constructor & Destructor Documentation

◆ RecordWindow()

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

Constructs a new window for adding a new record or editing an existing one.

Parameters
parentOptional owner widget.

Member Function Documentation

◆ getRecordDisplayName()

QString RecordWindow::getRecordDisplayName ( ) const

Gets the display name of the record.

Returns
Display name of the record.

◆ getRecordEditorIconFieldId()

QString RecordWindow::getRecordEditorIconFieldId ( ) const

Gets the id of the field to use as editor icon for the record.

Returns
Id of the field to use as editor icon for the record.

◆ getRecordFields()

QMap< QString, RecordFieldState::RecordFieldState > RecordWindow::getRecordFields ( ) const

Gets which fields are used by the record.

Returns
Which fields are used by the record.

◆ getRecordId()

QVariant RecordWindow::getRecordId ( ) const

Gets the unique id of the record.

Returns
Unique id of the record.

◆ getRecordSetName()

QString RecordWindow::getRecordSetName ( ) const

Gets the name of the set the record belongs to.

Returns
Name of the set the record belongs to.

◆ setDisallowedRecordIds()

void RecordWindow::setDisallowedRecordIds ( const QVariantList  disallowedRecordIds)

Sets the list of record ids that are prohibited (e.g. because other records with the same id exist).

Parameters
disallowedRecordIdsList of record ids that are prohibited.

◆ setRecordComponents()

void RecordWindow::setRecordComponents ( const Tome::ComponentList &  components)

Sets the list of available components.

Parameters
componentsList of available components.

◆ setRecordDisplayName()

void RecordWindow::setRecordDisplayName ( const QString &  displayName)

Sets the display name of the record.

Parameters
displayNameDisplay name of the record.

◆ setRecordEditorIconFieldId()

void RecordWindow::setRecordEditorIconFieldId ( const QString &  editorIconFieldId)

Sets the id of the field to use as editor icon for the record.

Parameters
editorIconFieldIdId of the field to use as editor icon for the record.

◆ setRecordFields() [1/2]

void RecordWindow::setRecordFields ( const Tome::FieldDefinitionList &  fieldDefinitions)

Sets the list of available record fields, initially disabling all of them.

Parameters
fieldDefinitionsList of available record fields.

◆ setRecordFields() [2/2]

void RecordWindow::setRecordFields ( const Tome::FieldDefinitionList &  fieldDefinitions,
const Tome::ComponentList &  componentDefinitions,
const Tome::RecordFieldValueMap &  ownFieldValues,
const Tome::RecordFieldValueMap &  inheritedFieldValues 
)

Sets the list of fields used by the record.

Parameters
fieldDefinitionsList of available record fields.
componentDefinitionsList of available components.
ownFieldValuesFields used by the record.
inheritedFieldValuesFields used by ancestors of the record.

◆ setRecordId()

void RecordWindow::setRecordId ( const QVariant &  id)

Sets the unique id of the record.

Parameters
idUnique id of the record.

◆ setRecordIdLocked()

void RecordWindow::setRecordIdLocked ( const bool  recordIdLocked)

Sets whether to automatically update the record id to reflect the display name, or not.

Parameters
recordIdLockedWhether to automatically update the record id to reflect the display name, or not.

◆ setRecordIdType()

void RecordWindow::setRecordIdType ( const Tome::RecordIdType::RecordIdType  recordIdType)

Sets the type of the id of the record.

Parameters
recordIdTypeType of the id of the record.

◆ setRecordSetName()

void RecordWindow::setRecordSetName ( const QString &  recordSetName)

Sets the name of the set the record belongs to.

Parameters
recordSetNameName of the new set the record belongs to.

◆ setRecordSetNames()

void RecordWindow::setRecordSetNames ( const QStringList &  recordSetNames)

Sets the list of available record sets.

Parameters
recordSetNamesList of available record sets.

◆ showEvent()

void RecordWindow::showEvent ( QShowEvent *  event)
protected

Sets up this window, e.g. by setting the focus on the first widget.

Parameters
eventEvent for showing this window.

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