ATLAS Offline Software
VP1TabBar.h
Go to the documentation of this file.
1 // //
3 // File adopted from KDE4 libraries by //
4 // T. Kittelmann <Thomas.Kittelmann@cern.ch>, March 2007. //
5 // //
6 // Main thing is to remove dependence on KDE for length of title text //
7 // settings, delay on drag settings and title eliding. Also, //
8 // hoverbuttons were removed (since these had not been properly //
9 // implemented in KDE4 at the time the code was copied). //
10 // //
11 // Notice about Copyrights and GPL license from the orignal file is //
12 // left untouched below. //
13 // //
15 
16 /* This file is part of the KDE libraries
17  Copyright (C) 2003 Stephan Binner <binner@kde.org>
18  Copyright (C) 2003 Zack Rusin <zack@kde.org>
19 
20  This library is free software; you can redistribute it and/or
21  modify it under the terms of the GNU Library General Public
22  License as published by the Free Software Foundation; either
23  version 2 of the License, or (at your option) any later version.
24 
25  This library is distributed in the hope that it will be useful,
26  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  Library General Public License for more details.
29 
30  You should have received a copy of the GNU Library General Public License
31  along with this library; see the file COPYING.LIB. If not, write to
32  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
33  Boston, MA 02110-1301, USA.
34 */
35 
36 #ifndef VP1TABBAR_H
37 #define VP1TABBAR_H
38 
39 #include <QTabBar>
40 
41 class VP1TabBar: public QTabBar
42 {
43  Q_OBJECT
44 
45  public:
46  explicit VP1TabBar( QWidget* parent = 0 );
47 
48  virtual ~VP1TabBar();
49 
50  void setTabReorderingEnabled( bool enable );
51 
52  bool isTabReorderingEnabled() const;
53 
54  void setTabCloseActivatePrevious( bool );
55 
56  bool tabCloseActivatePrevious() const;
57 
58  int selectTab( const QPoint &position ) const;
59 
60  Q_SIGNALS:
61  void contextMenu( int, const QPoint& );
62  void mouseDoubleClick( int );
63  void mouseMiddleClick( int );
64  void initiateDrag( int );
65  void testCanDecode( const QDragMoveEvent*, bool& );
66  void receivedDropEvent( int, QDropEvent* );
67  void moveTab( int, int );
68  void closeRequest( int );
69 #ifndef QT_NO_WHEELEVENT
70  void wheelDelta( int );
71 #endif
72 
73  protected:
74  virtual void mouseDoubleClickEvent( QMouseEvent *event );
75  virtual void mousePressEvent( QMouseEvent *event );
76  virtual void mouseMoveEvent( QMouseEvent *event );
77  virtual void mouseReleaseEvent( QMouseEvent *event );
78 #ifndef QT_NO_WHEELEVENT
79  virtual void wheelEvent( QWheelEvent *event );
80 #endif
81 
82  virtual void dragEnterEvent( QDragEnterEvent *event );
83  virtual void dragMoveEvent( QDragMoveEvent *event );
84  virtual void dropEvent( QDropEvent *event );
85 
86  protected Q_SLOTS:
87  virtual void activateDragSwitchTab();
88 
89  protected:
90  virtual void tabLayoutChange();
91 
92  private:
93  class Private;
94  Private* const m_d;
95 };
96 
97 #endif
VP1TabBar::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: VP1TabBar.cxx:179
VP1TabBar::mouseDoubleClick
void mouseDoubleClick(int)
VP1TabBar::mouseMiddleClick
void mouseMiddleClick(int)
VP1TabBar::tabLayoutChange
virtual void tabLayoutChange()
Definition: VP1TabBar.cxx:267
VP1TabBar::testCanDecode
void testCanDecode(const QDragMoveEvent *, bool &)
VP1TabBar::wheelDelta
void wheelDelta(int)
VP1TabBar::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: VP1TabBar.cxx:205
VP1TabBar::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event)
Definition: VP1TabBar.cxx:102
VP1TabBar::setTabCloseActivatePrevious
void setTabCloseActivatePrevious(bool)
Definition: VP1TabBar.cxx:261
VP1TabBar::closeRequest
void closeRequest(int)
VP1TabBar::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *event)
Definition: VP1TabBar.cxx:199
VP1TabBar::isTabReorderingEnabled
bool isTabReorderingEnabled() const
Definition: VP1TabBar.cxx:246
VP1TabBar::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QMouseEvent *event)
Definition: VP1TabBar.cxx:88
VP1TabBar::selectTab
int selectTab(const QPoint &position) const
Definition: VP1TabBar.cxx:273
VP1TabBar::Private
Definition: VP1TabBar.cxx:43
VP1TabBar::activateDragSwitchTab
virtual void activateDragSwitchTab()
Definition: VP1TabBar.cxx:170
VP1TabBar
Definition: VP1TabBar.h:42
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
VP1TabBar::dropEvent
virtual void dropEvent(QDropEvent *event)
Definition: VP1TabBar.cxx:226
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP1TabBar::receivedDropEvent
void receivedDropEvent(int, QDropEvent *)
VP1TabBar::initiateDrag
void initiateDrag(int)
VP1TabBar::setTabReorderingEnabled
void setTabReorderingEnabled(bool enable)
Definition: VP1TabBar.cxx:251
VP1TabBar::VP1TabBar
VP1TabBar(QWidget *parent=0)
Definition: VP1TabBar.cxx:66
VP1TabBar::tabCloseActivatePrevious
bool tabCloseActivatePrevious() const
Definition: VP1TabBar.cxx:256
VP1TabBar::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: VP1TabBar.cxx:118
VP1TabBar::~VP1TabBar
virtual ~VP1TabBar()
Definition: VP1TabBar.cxx:83
VP1TabBar::contextMenu
void contextMenu(int, const QPoint &)
VP1TabBar::wheelEvent
virtual void wheelEvent(QWheelEvent *event)
Definition: VP1TabBar.cxx:240
VP1TabBar::m_d
Private *const m_d
Definition: VP1TabBar.h:93
VP1TabBar::moveTab
void moveTab(int, int)