TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
ttktabbutton.h
Go to the documentation of this file.
1 #ifndef TTKTABBUTTON_H
2 #define TTKTABBUTTON_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Library Module project
6  * Copyright (C) 2015 - 2024 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17 
18  * You should have received a copy of the GNU Lesser General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
22 #include <QPushButton>
23 #include <QButtonGroup>
24 #include "ttkmoduleexport.h"
25 
29 class TTK_MODULE_EXPORT TTKTabButton : public QWidget
30 {
31  Q_OBJECT
33 public:
37  explicit TTKTabButton(QWidget *parent = nullptr);
41  ~TTKTabButton();
42 
46  void addButtons(const QStringList &titles);
50  void setButtonEnabled(bool enabled);
51 
55  inline int currentIndex() const { return m_currentIndex; }
59  inline int count() const { return m_buttonGroup->buttons().count(); }
60 
61 Q_SIGNALS:
65  void clicked(int index);
66 
67 private Q_SLOTS:
71  void buttonClicked(int index);
72 
73 private:
75  QButtonGroup *m_buttonGroup;
76 
77 };
78 
79 #endif // TTKTABBUTTON_H
#define TTK_MODULE_EXPORT
int m_currentIndex
Definition: ttktabbutton.h:74
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
int currentIndex() const
Definition: ttktabbutton.h:55
QButtonGroup * m_buttonGroup
Definition: ttktabbutton.h:75
The class of the tab button module.
Definition: ttktabbutton.h:29
int count() const
Definition: ttktabbutton.h:59