DockWidgetTab.h
Go to the documentation of this file.
1 #ifndef DockWidgetTabH
2 #define DockWidgetTabH
3 /*******************************************************************************
4 ** Qt Advanced Docking System
5 ** Copyright (C) 2017 Uwe Kindler
6 **
7 ** This library is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU Lesser General Public
9 ** License as published by the Free Software Foundation; either
10 ** version 2.1 of the License, or (at your option) any later version.
11 **
12 ** This library is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ** Lesser General Public License for more details.
16 **
17 ** You should have received a copy of the GNU Lesser General Public
18 ** License along with this library; If not, see <http://www.gnu.org/licenses/>.
19 ******************************************************************************/
20 
21 
22 //============================================================================
27 //============================================================================
28 
29 
30 //============================================================================
31 // INCLUDES
32 //============================================================================
33 #include <QFrame>
34 #include <QSize>
35 
36 #include "ads_globals.h"
37 
38 namespace ads
39 {
40 class CDockWidget;
41 class CDockAreaWidget;
42 struct DockWidgetTabPrivate;
43 class CDockManager;
44 
50 class ADS_EXPORT CDockWidgetTab : public QFrame
51 {
52  Q_OBJECT
53  Q_PROPERTY(bool activeTab READ isActiveTab WRITE setActiveTab NOTIFY activeTabChanged)
54  Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
55 
56 private:
58  friend struct DockWidgetTabPrivate;
59  friend class CDockWidget;
60  friend class CDockManager;
61  void onDockWidgetFeaturesChanged();
62 
63 private slots:
64  void detachDockWidget();
65 
66 protected:
67  virtual void mousePressEvent(QMouseEvent* ev) override;
68  virtual void mouseReleaseEvent(QMouseEvent* ev) override;
69  virtual void mouseMoveEvent(QMouseEvent* ev) override;
70  virtual void contextMenuEvent(QContextMenuEvent* ev) override;
71 
75  virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
76 
77 public:
78  using Super = QFrame;
84  CDockWidgetTab(CDockWidget* DockWidget, QWidget* parent = 0);
85 
89  virtual ~CDockWidgetTab();
90 
94  bool isActiveTab() const;
95 
99  void setActiveTab(bool active);
100 
105  void setDockAreaWidget(CDockAreaWidget* DockArea);
106 
112  CDockAreaWidget* dockAreaWidget() const;
113 
117  CDockWidget* dockWidget() const;
118 
122  void setIcon(const QIcon& Icon);
123 
127  const QIcon& icon() const;
128 
132  QString text() const;
133 
137  void setText(const QString& title);
138 
142  bool isTitleElided() const;
143 
147  bool isClosable() const;
148 
152  virtual bool event(QEvent *e) override;
153 
157  void setElideMode(Qt::TextElideMode mode);
158 
162  void updateStyle();
163 
169  QSize iconSize() const;
170 
176  void setIconSize(const QSize& Size);
177 
178 public slots:
179  virtual void setVisible(bool visible) override;
180 
181 signals:
182  void activeTabChanged();
183  void clicked();
184  void closeRequested();
185  void closeOtherTabsRequested();
186  void moved(const QPoint& GlobalPos);
187  void elidedChanged(bool elided);
188 }; // class DockWidgetTab
189 }
190  // namespace ads
191 //-----------------------------------------------------------------------------
192 #endif // DockWidgetTabH
ads_globals.h
Declaration of.
ads::CDockAreaWidget
Definition: DockAreaWidget.h:55
ads::CDockWidgetTab::Super
QFrame Super
Definition: DockWidgetTab.h:78
ads::CDockManager
Definition: DockManager.h:69
ads
Definition: ads_globals.h:69
DockWidget
Definition: plot_docker.h:16
ads::CDockWidget
Definition: DockWidget.h:54
override
#define override
Definition: backward.hpp:387
ads::DockWidgetTabPrivate
Definition: DockWidgetTab.cpp:63
ads::CDockWidgetTab
Definition: DockWidgetTab.h:50
ADS_EXPORT
#define ADS_EXPORT
Definition: ads_globals.h:50


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:44