50 QHBoxLayout *layout =
new QHBoxLayout(
this);
51 layout->setSpacing(0);
52 layout->setContentsMargins(0, 0, 0, 0);
58 QLabel *ico =
new QLabel(
this);
59 ico->setPixmap(QPixmap(icon));
60 layout->addWidget(ico);
70 QHBoxLayout *layout =
new QHBoxLayout(
this);
71 layout->setContentsMargins(20, 0, 20, 0);
73 QWidget *leftLabel =
new QWidget(
this);
74 QVBoxLayout *leftLabelLayout =
new QVBoxLayout(leftLabel);
75 leftLabelLayout->addStretch();
76 leftLabel->setFixedWidth(100);
77 leftLabel->setLayout(leftLabelLayout);
78 layout->addWidget(leftLabel);
80 QLabel *iconLabel =
new QLabel(leftLabel);
81 iconLabel->setFixedSize(38, 38);
82 iconLabel->setPixmap(QPixmap(
":/playlist/" + category->
m_tag));
83 leftLabelLayout->addWidget(iconLabel, 0, Qt::AlignCenter);
87 leftLabelLayout->addWidget(textLabel, 0, Qt::AlignCenter);
88 leftLabelLayout->addStretch();
90 QWidget *item =
new QWidget(
this);
95 connect(clickedGroup, SIGNAL(clicked(
int)), SLOT(
buttonClicked(
int)));
99 for(
int i = 0; i < items.count(); ++i)
101 QWidget *label =
nullptr;
105 if(property.m_index != i)
118 clickedGroup->
mapped(label);
121 label->setProperty(
"key", items[i].m_key);
122 label->setProperty(
"value", items[i].m_value);
131 layout->addWidget(item);
148 for(
int i = 0; i <
m_items.count(); ++i)
156 if(index < 0 || index >=
m_items.count())
161 const QString &
key =
m_items[index]->property(
"key").toString();
162 const QString &value =
m_items[index]->property(
"value").toString();
168 QWidget::resizeEvent(event);
188 item->resizeWindow();
194 QVBoxLayout *layout =
new QVBoxLayout(
this);
195 layout->setSpacing(0);
196 layout->setContentsMargins(0, 0, 0, 0);
201 QWidget *containWidget =
new QWidget(
this);
202 QVBoxLayout *containLayout =
new QVBoxLayout(containWidget);
203 containWidget->setLayout(containLayout);
205 QScrollArea *scrollArea =
new QScrollArea(
this);
207 layout->addWidget(scrollArea);
209 CategoryPropertyList items;
218 items.append({
"b", {{0,
CategoryProperty::Hot}, {5,
CategoryProperty::New}, {9,
CategoryProperty::New}, {15,
CategoryProperty::New}, {21,
CategoryProperty::Hot}}});
238 items.append({
"a", {{0,
CategoryProperty::Hot}, {5,
CategoryProperty::New}, {9,
CategoryProperty::New}, {15,
CategoryProperty::New}, {21,
CategoryProperty::Hot}}});
250 MusicResultsCategoryList categorys;
255 if(items.count() != categorys.count() - 1)
261 for(
int i = 0; i < categorys.count() - 1; ++i)
263 items[i].m_category = categorys[i + 1];
266 containLayout->addWidget(item);
269 QFrame *line =
new QFrame(
this);
270 line->setFrameShape(QFrame::HLine);
272 containLayout->addWidget(line);
#define TTKStaticCast(x, y)
static const QString FontStyle03
bool fromFile(Category type)
static constexpr const char * QUERY_KG_INTERFACE
static constexpr wchar_t key[]
QList< QWidget * > m_items
The class of the label widget that can click.
virtual bool readBuffer(MusicResultsCategoryList &items) overridefinal
static const QString ColorStyle12
void mapped(QWidget *widget)
The class of the results category core.
static constexpr const char * QUERY_WY_INTERFACE
MusicPlaylistCategoryItem(CategoryProperty *category, QWidget *parent=nullptr)
CategorySingleItem * m_item
The class of the playlist music category item.
The class of the category config manager.
static constexpr const char * QUERY_KW_INTERFACE
QGridLayout * m_gridLayout
MusicResultsCategory m_category
static const QString BackgroundStyle10
static const QString ColorStyle07
CategoryMultiItem(const QString &text, const QString &icon, QWidget *parent=nullptr)
static const QString ColorStyle03
~MusicPlaylistCategoryItem()
virtual void resizeEvent(QResizeEvent *event) overridefinal
QList< Property > m_property
void buttonClicked(int index)
#define TTK_ERROR_STREAM(msg)
MusicResultsCategoryItemList m_items
The class of the label widget click group mapper.
CategoryProperty(const QString &tag, const QList< Property > &property)
#define LEFT_SIDE_WIDTH_MIN