TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Types | Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
MusicBackgroundListWidget Class Reference

The class of the background list widget. More...

#include <musicbackgroundlistwidget.h>

+ Inheritance diagram for MusicBackgroundListWidget:

Public Types

enum  Module { CachedModule, StackedModule, DailyModule, OnlineModule }
 

Signals

void itemClicked (int type, const QString &name)
 

Public Member Functions

 MusicBackgroundListWidget (QWidget *parent=nullptr)
 
 ~MusicBackgroundListWidget ()
 
void setCurrentItemName (const QString &name)
 
void setType (Module type)
 
Module type () const
 
void clearState ()
 
void clearItems ()
 
void addCellItem (const QString &icon, bool state)
 
void addCellItem (const QString &name, const QString &path, bool state)
 
void updateItem (const MusicBackgroundImage &image, const QString &path)
 
bool contains (const QString &name) const
 
bool contains (const MusicBackgroundImage &image) const
 
int find (MusicBackgroundListItem *item) const
 
MusicBackgroundListItemfind (const QString &name) const
 
MusicBackgroundListItemfind (const MusicBackgroundImage &image) const
 
void updateLastedItem ()
 
int count () const
 

Private Slots

void itemCloseClicked (MusicBackgroundListItem *item)
 
void currentItemClicked (MusicBackgroundListItem *item)
 

Private Attributes

Module m_type
 
QGridLayout * m_gridLayout
 
MusicBackgroundListItemm_currentItem
 
QList< MusicBackgroundListItem * > m_items
 

Detailed Description

The class of the background list widget.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 135 of file musicbackgroundlistwidget.h.

Member Enumeration Documentation

Enumerator
CachedModule 
StackedModule 
DailyModule 
OnlineModule 

Definition at line 140 of file musicbackgroundlistwidget.h.

Constructor & Destructor Documentation

MusicBackgroundListWidget::MusicBackgroundListWidget ( QWidget *  parent = nullptr)
explicit

Object constructor.

Definition at line 137 of file musicbackgroundlistwidget.cpp.

References m_gridLayout.

MusicBackgroundListWidget::~MusicBackgroundListWidget ( )

Object destructor.

Definition at line 148 of file musicbackgroundlistwidget.cpp.

References clearItems(), and m_gridLayout.

Member Function Documentation

void MusicBackgroundListWidget::addCellItem ( const QString &  icon,
bool  state 
)
void MusicBackgroundListWidget::addCellItem ( const QString &  name,
const QString &  path,
bool  state 
)
void MusicBackgroundListWidget::clearItems ( )
void MusicBackgroundListWidget::clearState ( )

Clear select state.

Definition at line 167 of file musicbackgroundlistwidget.cpp.

References m_items, and qAsConst.

Referenced by MusicBackgroundSkinDialog::listWidgetItemClicked().

bool MusicBackgroundListWidget::contains ( const QString &  name) const
bool MusicBackgroundListWidget::contains ( const MusicBackgroundImage image) const

Current item contains or not.

Definition at line 236 of file musicbackgroundlistwidget.cpp.

References MusicBackgroundImage::m_item, m_items, and qAsConst.

int MusicBackgroundListWidget::count ( ) const
inline

Item count.

Definition at line 224 of file musicbackgroundlistwidget.h.

void MusicBackgroundListWidget::currentItemClicked ( MusicBackgroundListItem item)
privateslot
int MusicBackgroundListWidget::find ( MusicBackgroundListItem item) const

Current item index at container.

Definition at line 249 of file musicbackgroundlistwidget.cpp.

References m_items.

Referenced by itemCloseClicked(), and MusicBackgroundSkinDialog::listWidgetItemClicked().

MusicBackgroundListItem * MusicBackgroundListWidget::find ( const QString &  name) const

Find item by name.

Definition at line 262 of file musicbackgroundlistwidget.cpp.

References m_items, name, and qAsConst.

MusicBackgroundListItem * MusicBackgroundListWidget::find ( const MusicBackgroundImage image) const

Find item by image.

Definition at line 275 of file musicbackgroundlistwidget.cpp.

References MusicBackgroundImage::m_item, m_items, and qAsConst.

void MusicBackgroundListWidget::itemClicked ( int  type,
const QString &  name 
)
signal

Current item clicked.

Referenced by addCellItem(), and currentItemClicked().

void MusicBackgroundListWidget::itemCloseClicked ( MusicBackgroundListItem item)
privateslot
void MusicBackgroundListWidget::setCurrentItemName ( const QString &  name)

Select current item by name when the widget show.

Definition at line 154 of file musicbackgroundlistwidget.cpp.

References m_currentItem, m_items, name, and qAsConst.

Referenced by MusicBackgroundSkinDialog::listWidgetItemClicked(), and MusicBackgroundSkinDialog::setCurrentBackgroundTheme().

void MusicBackgroundListWidget::setType ( Module  type)
inline
Module MusicBackgroundListWidget::type ( ) const
inline

Get background list rtpe.

Definition at line 169 of file musicbackgroundlistwidget.h.

void MusicBackgroundListWidget::updateItem ( const MusicBackgroundImage image,
const QString &  path 
)

Update item by backgroud image.

Definition at line 208 of file musicbackgroundlistwidget.cpp.

References m_items, and qAsConst.

Referenced by MusicBackgroundRemoteWidget::downLoadFinished().

void MusicBackgroundListWidget::updateLastedItem ( )

Member Data Documentation

MusicBackgroundListItem* MusicBackgroundListWidget::m_currentItem
private
QGridLayout* MusicBackgroundListWidget::m_gridLayout
private
QList<MusicBackgroundListItem*> MusicBackgroundListWidget::m_items
private
Module MusicBackgroundListWidget::m_type
private

Definition at line 243 of file musicbackgroundlistwidget.h.

Referenced by currentItemClicked().


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