ATLAS Offline Software
Loading...
Searching...
No Matches
VP1TabWidget.h
Go to the documentation of this file.
1
2// //
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 VP1TABWIDGET_H
37#define VP1TABWIDGET_H
38
39#include <QTabWidget>
40
41class QTab;
42class VP1TabBar;
43
44class VP1TabWidget : public QTabWidget
45{
46 Q_OBJECT
50
51 public:
52
53 VP1TabBar* getVP1TabBar();//Added by TK.
54
55 explicit VP1TabWidget( QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags() );
56
57 virtual ~VP1TabWidget();
58
59 void setTabTextColor( int index, const QColor& color );
60
61 QColor tabTextColor( int index ) const;
62
64
66
68
69 void setTabBarHidden( bool hide );
70
71 bool isTabBarHidden() const;
72
73 QString tabText( int ) const; // but it's not virtual...
74
75 void setTabText( int , const QString & );
76
77 public Q_SLOTS:
78 virtual void moveTab( int, int );
79
80 virtual QT_MOC_COMPAT void removePage ( QWidget * w );
81
82 virtual void removeTab(int index);
83
84 void setTabReorderingEnabled( bool enable );
85
86 void setTabCloseActivatePrevious( bool previous );
87
88 void setAutomaticResizeTabs( bool enable );
89
90 Q_SIGNALS:
91 void testCanDecode(const QDragMoveEvent *e, bool &accept /* result */);
92
93 void receivedDropEvent( QDropEvent * );
94
95 void receivedDropEvent( QWidget *, QDropEvent * );
96
97 void initiateDrag( QWidget * );
98
99 void contextMenu( const QPoint & );
100
101 void contextMenu( QWidget *, const QPoint & );
102
103 void movedTab( int, int );
104
106
107 void mouseDoubleClick( QWidget * );
108
110
111 void mouseMiddleClick( QWidget * );
112
113 void closeRequest( QWidget * );
114
115 protected:
116 virtual void mouseDoubleClickEvent( QMouseEvent* );
117 virtual void mousePressEvent( QMouseEvent* );
118 virtual void dragEnterEvent( QDragEnterEvent* );
119 virtual void dragMoveEvent( QDragMoveEvent* );
120 virtual void dropEvent( QDropEvent* );
121 int tabBarWidthForMaxChars( int );
122#ifndef QT_NO_WHEELEVENT
123 virtual void wheelEvent( QWheelEvent* );
124#endif
125 virtual void resizeEvent( QResizeEvent* );
126 virtual void tabInserted( int );
127 virtual void tabRemoved ( int );
128
129
130 protected Q_SLOTS:
131 virtual void receivedDropEvent( int, QDropEvent* );
132 virtual void initiateDrag( int );
133 virtual void contextMenu( int, const QPoint& );
134 virtual void mouseDoubleClick( int );
135 virtual void mouseMiddleClick( int );
136 virtual void closeRequest( int );
137#ifndef QT_NO_WHEELEVENT
138 virtual void wheelDelta( int );
139#endif
140
141 private:
142 class Private;
143 Private * const m_d;
144};
145
146#endif
#define protected
void receivedDropEvent(QDropEvent *)
void setTabReorderingEnabled(bool enable)
virtual void tabRemoved(int)
void setTabTextColor(int index, const QColor &color)
void mouseDoubleClick()
virtual QT_MOC_COMPAT void removePage(QWidget *w)
void testCanDecode(const QDragMoveEvent *e, bool &accept)
bool isTabBarHidden() const
void closeRequest(QWidget *)
void mouseMiddleClick()
virtual void tabInserted(int)
virtual void wheelEvent(QWheelEvent *)
int tabBarWidthForMaxChars(int)
void initiateDrag(QWidget *)
virtual void removeTab(int index)
bool tabReorderingEnabled
bool automaticResizeTabs
VP1TabWidget(QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
Private *const m_d
VP1TabBar * getVP1TabBar()
bool tabCloseActivatePrevious
void movedTab(int, int)
void contextMenu(const QPoint &)
void setTabBarHidden(bool hide)
virtual void dragEnterEvent(QDragEnterEvent *)
bool isTabReorderingEnabled() const
void setTabText(int, const QString &)
virtual void mouseDoubleClickEvent(QMouseEvent *)
virtual void wheelDelta(int)
void setAutomaticResizeTabs(bool enable)
QColor tabTextColor(int index) const
virtual void resizeEvent(QResizeEvent *)
virtual void mousePressEvent(QMouseEvent *)
virtual void dropEvent(QDropEvent *)
void setTabCloseActivatePrevious(bool previous)
virtual void moveTab(int, int)
QString tabText(int) const
virtual void dragMoveEvent(QDragMoveEvent *)
Definition index.py:1