Qmmp
Signals | Public Member Functions | List of all members
PlayListHeaderModel Class Reference

#include <playlistheadermodel.h>

Inherits QObject.

Signals

void columnAdded (int index)
 
void columnRemoved (int index)
 
void columnChanged (int index)
 
void columnMoved (int from, int to)
 
void headerChanged ()
 

Public Member Functions

 PlayListHeaderModel (QObject *parent=nullptr)
 
 ~PlayListHeaderModel ()
 
void restoreSettings (const QString &groupName)
 
void restoreSettings (QSettings *settings)
 
void saveSettings (const QString &groupName)
 
void saveSettings (QSettings *settings)
 
bool isSettingsLoaded () const
 
void insert (int index, const QString &name, const QString &pattern)
 
void remove (int index)
 
void move (int from, int to)
 
void execEdit (int index, QWidget *parent=nullptr)
 
void execInsert (int index, QWidget *parent=nullptr)
 
int count ()
 
const QString name (int index) const
 
const QString pattern (int index) const
 
void setData (int index, int key, const QVariant &data)
 
const QVariant data (int index, int key) const
 

Detailed Description

Helper class that provides access to playlist column configuration.

Author
Ilya Kotov forko.nosp@m.tov0.nosp@m.2@ya..nosp@m.ru

Constructor & Destructor Documentation

◆ PlayListHeaderModel()

PlayListHeaderModel ( QObject *  parent = nullptr)
explicit

Constructs a playlist model.

Parameters
parentQObject parent.

◆ ~PlayListHeaderModel()

Object destructor.

Member Function Documentation

◆ columnAdded

void columnAdded ( int  index)
signal

Emitted when a new column is added.

Parameters
indexIndex of the column.

◆ columnChanged

void columnChanged ( int  index)
signal

Emitted when a column is changed.

Parameters
indexIndex of the column.

◆ columnMoved

void columnMoved ( int  from,
int  to 
)
signal

Emitted when the column at index position from is moved to index position to.

◆ columnRemoved

void columnRemoved ( int  index)
signal

Emitted when a column is removed.

Parameters
indexIndex of the column.

◆ count()

int count ( )

Returns number of the columns.

◆ data()

const QVariant data ( int  index,
int  key 
) const

Returns extra data of the column.

Parameters
indexIndex of the column.
keyKey of the extra field.

◆ execEdit()

void execEdit ( int  index,
QWidget *  parent = nullptr 
)

Opens internal column editor.

Parameters
indexIndex of the column.
parentParent widget,

◆ execInsert()

void execInsert ( int  index,
QWidget *  parent = nullptr 
)

Opens internal column editor and inserts new column if user press "ok".

Parameters
indexRequired index of the column.
parentParent widget.

◆ headerChanged

void headerChanged ( )
signal

Emitted when columns have changed.

◆ insert()

void insert ( int  index,
const QString &  name,
const QString &  pattern 
)

Inserts the new column.

Parameters
indexIndex of the column.
nameName of the column.
patternColumn template. See MetaDataFormatter for details.

◆ isSettingsLoaded()

bool isSettingsLoaded ( ) const

Indicates that the settings is loaded.

◆ move()

void move ( int  from,
int  to 
)

Moves the column at index position from to index position to.

◆ name()

const QString name ( int  index) const

Returns name of the column with index index.

◆ pattern()

const QString pattern ( int  index) const

Returns template of the column with index index.

◆ remove()

void remove ( int  index)

Removes column.

Parameters
indexIndex of the column.

◆ restoreSettings() [1/2]

void restoreSettings ( const QString &  groupName)

Restores column settings using internal configuration file.

Parameters
groupNameName of the settings group (should be different for each UI plugin)

◆ restoreSettings() [2/2]

void restoreSettings ( QSettings *  settings)

Restores column settings using provided QSettings object.

Parameters
settingsPointer to QSettings object.

◆ saveSettings() [1/2]

void saveSettings ( const QString &  groupName)

Saves column settings using internal configuration file.

Parameters
groupNameName of the settings group (should be different for each UI plugin)

◆ saveSettings() [2/2]

void saveSettings ( QSettings *  settings)

Saves column settings using provided QSettings object.

Parameters
settingsPointer to QSettings object.

◆ setData()

void setData ( int  index,
int  key,
const QVariant &  data 
)

Adds extra data to column (size, geometry, etc).

Parameters
indexIndex of the column.
keyKey of the extra field.
dataExtra data value.

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