TTKMusicPlayer  4.3.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 - 2026 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
32 public:
36  explicit TTKTabButton(QWidget *parent = nullptr);
40  ~TTKTabButton();
41 
45  void addButtons(const QStringList &titles);
49  void setButtonEnabled(bool enabled);
50 
54  inline int currentIndex() const noexcept { return m_currentIndex; }
58  inline int count() const noexcept { return m_buttonGroup->buttons().count(); }
59 
60 Q_SIGNALS:
64  void clicked(int index);
65 
66 private Q_SLOTS:
70  void buttonClicked(int index);
71 
72 private:
74  QButtonGroup *m_buttonGroup;
75 
76 };
77 
78 #endif // TTKTABBUTTON_H
#define TTK_MODULE_EXPORT
int m_currentIndex
Definition: ttktabbutton.h:73
int count() const noexcept
Definition: ttktabbutton.h:58
QButtonGroup * m_buttonGroup
Definition: ttktabbutton.h:74
int currentIndex() const noexcept
Definition: ttktabbutton.h:54
The class of the tab button module.
Definition: ttktabbutton.h:29
#define const
Definition: zconf.h:233