TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicremotewidgetforrectangle.cpp
Go to the documentation of this file.
2 #include "musicmarqueewidget.h"
3 
5  : MusicRemoteWidget(parent)
6 {
7  setGeometry(200, 200, 230, 70);
8  adjustPosition(this);
9 
10  QVBoxLayout *vbox = new QVBoxLayout(this);
11  vbox->setContentsMargins(5, 5, 5, 2);
12  vbox->setSpacing(0);
13  vbox->addWidget(m_mainWidget);
14 
15  QHBoxLayout *mhbox = new QHBoxLayout(m_mainWidget);
16  mhbox->setContentsMargins(5, 0, 5, 0);
17  mhbox->setSpacing(0);
18 
20  mhbox->addWidget(m_songNameLabel);
22 
23  m_toolWidget = new QWidget(this);
24  m_toolWidget->setObjectName("ToolWidget");
25  m_toolWidget->setStyleSheet(QString("#ToolWidget{%1}").arg(TTK::UI::BackgroundStyle04));
26  vbox->addWidget(m_toolWidget);
27 
28  QHBoxLayout *hbox = new QHBoxLayout(m_toolWidget);
29  hbox->setContentsMargins(0, 0, 3, 0);
30  hbox->setSpacing(0);
31  hbox->addWidget(m_preSongButton);
32  hbox->addWidget(m_playButton);
33  hbox->addWidget(m_nextSongButton);
34  hbox->addWidget(m_volumeWidget);
35  hbox->addWidget(m_settingButton);
36  hbox->addWidget(m_showMainWindowButton);
37  m_toolWidget->setLayout(hbox);
38 }
39 
41 {
42  delete m_songNameLabel;
43 }
44 
46 {
47  m_songNameLabel->setText(TTK::Widget::elidedText(font(), value, Qt::ElideRight, width() - 20));
48 }
QPushButton * m_nextSongButton
QPushButton * m_showMainWindowButton
static const QString WidgetStyle01
Widget.
void adjustPosition(QWidget *w)
static const QString BackgroundStyle04
Definition: musicuiobject.h:90
MusicRemoteWidgetForRectangle(QWidget *parent=nullptr)
QPushButton * m_settingButton
TTK_MODULE_EXPORT QString elidedText(const QFont &font, const QString &text, Qt::TextElideMode mode, int width)
The class of the desktop remote widget base.
The class of the marquee widget.
void setText(const QString &newText)
QPushButton * m_playButton
QPushButton * m_preSongButton
virtual void setLabelText(const QString &value) overridefinal