Miam-Player  0.8.0
A nice music player
extendedtabwidget.h
Go to the documentation of this file.
1 #ifndef EXTENDEDTAB_H
2 #define EXTENDEDTAB_H
3 
4 #include <QAction>
5 #include <QTabWidget>
6 
7 #include "extendedtabbar.h"
9 
16 {
17  Q_OBJECT
18 public:
19  explicit ExtendedTabWidget(QWidget *parent = nullptr) : QTabWidget(parent) { setTabBar(new ExtendedTabBar(this)); }
20 
21  inline void setShortcut(const QString &objectName, const QKeySequence &sequence) {
22  int i = 0;
23  if (objectName == "showTabFilesystem") {
24  i = 1;
25  }
26  QAction *shortcutAction = new QAction(this);
27  connect(shortcutAction, &QAction::triggered, this, [=]() { setCurrentIndex(i); });
28  shortcutAction->setShortcut(sequence);
29  this->addAction(shortcutAction);
30  }
31 };
32 
33 #endif // EXTENDEDTAB_H
The ExtendedTabWidget class does only one thing: bind shortcuts for tab Library and tab FileSystem...
Definition: extendedtabwidget.h:15
void setShortcut(const QString &objectName, const QKeySequence &sequence)
Definition: extendedtabwidget.h:21
The ExtendedTabBar class is only used in left-pane to display 2 tabs (Library - FileSystem) where eac...
Definition: extendedtabbar.h:13
ExtendedTabWidget(QWidget *parent=nullptr)
Definition: extendedtabwidget.h:19
#define MIAMTABPLAYLISTS_LIBRARY
Definition: miamtabplaylists_global.hpp:8