pqTabbedMultiViewWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqTabbedMultiViewWidget.h
5 
6  Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 ========================================================================*/
32 #ifndef pqTabbedMultiViewWidget_h
33 #define pqTabbedMultiViewWidget_h
34 
35 #include "pqComponentsModule.h"
36 #include "vtkType.h" // needed for vtkIdType
37 #include <QStyle> // needed for QStyle:StandardPixmap
38 #include <QTabBar> // needed for QTabBar::ButtonPosition
39 #include <QTabWidget> // needed for QTabWidget.
40 
41 class pqMultiViewWidget;
42 class pqProxy;
43 class pqServer;
45 class pqView;
46 class vtkImageData;
48 
56 {
57  Q_OBJECT
58  typedef QWidget Superclass;
59  Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly)
60 public:
61  pqTabbedMultiViewWidget(QWidget* parent = nullptr);
62  ~pqTabbedMultiViewWidget() override;
63 
67  virtual QSize clientSize() const;
68 
73  void setReadOnly(bool val);
74  bool readOnly() const;
75 
80  void setTabVisibility(bool visible);
81  bool tabVisibility() const;
82 
86  vtkSMViewLayoutProxy* layoutProxy() const;
87 
91  bool decorationsVisibility() const;
92 
97  pqMultiViewWidget* findTab(vtkSMViewLayoutProxy*) const;
98 
100 
104  void enableAnnotationFilter(const QString& annotationKey);
105  void disableAnnotationFilter();
106  void setAnnotationFilterMatching(bool matching);
108 
114  void updateVisibleTabs();
115 
120  QList<QString> visibleTabLabels() const;
121 
122 Q_SIGNALS:
126  void viewSizeLocked(bool);
127 
128 public Q_SLOTS:
129  virtual int createTab();
130  virtual int createTab(pqServer*);
131  virtual int createTab(vtkSMViewLayoutProxy*);
132  virtual void closeTab(int);
133 
137  void setCurrentTab(int index);
138 
140 
144  void setDecorationsVisibility(bool);
145  void showDecorations() { this->setDecorationsVisibility(true); }
146  void hideDecorations() { this->setDecorationsVisibility(false); }
148 
152  virtual void toggleFullScreen();
153 
157  virtual void toggleWidgetDecoration();
158 
163  virtual void lockViewSize(const QSize&);
164 
168  virtual void reset();
169 
188  QSize preview(const QSize& previewSize = QSize());
189 
190 protected Q_SLOTS:
194  virtual void proxyAdded(pqProxy*);
195  virtual void proxyRemoved(pqProxy*);
196  virtual void serverRemoved(pqServer*);
197 
202  virtual void currentTabChanged(int);
203 
208  virtual void onStateLoaded();
209 
213  void contextMenuRequested(const QPoint&);
214 
215  void onLayoutNameChanged(pqServerManagerModelItem*);
216 
217 protected: // NOLINT(readability-redundant-access-specifiers)
218  bool eventFilter(QObject* obj, QEvent* event) override;
219 
223  class pqTabWidget : public QTabWidget
224  {
225  typedef QTabWidget Superclass;
226 
227  public:
228  pqTabWidget(QWidget* parentWdg = nullptr);
229  ~pqTabWidget() override;
230 
234  virtual void setTabButton(int index, QTabBar::ButtonPosition position, QWidget* wdg);
235 
241  virtual int tabButtonIndex(QWidget* wdg, QTabBar::ButtonPosition position) const;
242 
248  virtual int addAsTab(pqMultiViewWidget* wdg, pqTabbedMultiViewWidget* self);
249 
254  static const char* popoutLabelText(bool popped_out);
255 
259  static QStyle::StandardPixmap popoutLabelPixmap(bool popped_out);
260 
265  void setReadOnly(bool val);
266  bool readOnly() const { return this->ReadOnly; }
267 
271  QSize preview(const QSize&);
272 
274 
279  void setTabBarVisibility(bool);
280  bool tabBarVisibility() const { return this->TabBarVisibility; }
282  private:
283  Q_DISABLE_COPY(pqTabWidget)
284  bool ReadOnly;
285  bool TabBarVisibility;
287  };
288 
289 private:
290  Q_DISABLE_COPY(pqTabbedMultiViewWidget)
291 
292  class pqInternals;
293  pqInternals* Internals;
294  friend class pqInternals;
295 };
296 
297 #endif
pqMultiViewWidget is a widget that manages layout of multiple views.
void showDecorations()
When set to false, all decorations including title frames, separators, tab-bars are hidden...
#define PQCOMPONENTS_EXPORT
pqServerManagerModelItem is a element maintained by pqServerManagerModel.
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
pqTabbedMultiViewWidget is used to to enable adding of multiple pqMultiViewWidget instances in tabs...
vtkSMViewLayoutProxy is used by ParaView to layout multiple views in a 2D KD-Tree layout...
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:56
bool tabBarVisibility() const
Get/Set tab bar visibility.
index
Internal class used as the TabWidget.
void hideDecorations()
When set to false, all decorations including title frames, separators, tab-bars are hidden...
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:63
position