Miam-Player  0.8.0
A nice music player
tabbar.h
Go to the documentation of this file.
1 #ifndef TABBAR_H
2 #define TABBAR_H
3 
4 #include <QLineEdit>
5 #include <QMouseEvent>
6 #include <QStylePainter>
7 #include <QTabBar>
8 #include <QTimer>
9 
10 #include "playlist.h"
11 #include "tabplaylist.h"
13 
21 class MIAMTABPLAYLISTS_LIBRARY TabBar : public QTabBar
22 {
23  Q_OBJECT
24 private:
25  QLineEdit *lineEdit;
26 
27  TabPlaylist *tabPlaylist;
28 
29  QRect _targetRect;
30  bool _cursorOverSameTab;
31  QTimer *_timer;
32 
33 public:
34  explicit TabBar(TabPlaylist *parent);
35 
37  void editTab(int indexTab);
38 
40  virtual bool eventFilter(QObject *, QEvent *);
41 
42 protected:
44  virtual void dragEnterEvent(QDragEnterEvent *event);
45 
47  virtual void dragMoveEvent(QDragMoveEvent *event);
48 
50  virtual void dropEvent(QDropEvent *event);
51 
53  virtual void mouseDoubleClickEvent(QMouseEvent *);
54 
56  virtual void mousePressEvent(QMouseEvent *);
57 
58  virtual void paintEvent(QPaintEvent *);
59 
61  virtual QSize tabSizeHint(int index) const;
62 
63 private:
64  void paintRectTabs(QStylePainter &p);
65 
66  void paintRoundedTabs(QStylePainter &p);
67 
68 private slots:
70  void renameTab();
71 
72 signals:
73  void tabRenamed(int index, const QString &text);
74 };
75 
76 #endif // TABBAR_H
The TabPlaylist class is used to manage mutiple playlists in the MainWindow class.
Definition: tabplaylist.h:20
The TabBar class is used to be able to rename a tab, e.g. a Playlist.
Definition: tabbar.h:21
#define MIAMTABPLAYLISTS_LIBRARY
Definition: miamtabplaylists_global.hpp:8