pqTabbedMultiViewWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
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 = 0);
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 
99 Q_SIGNALS:
103  void viewSizeLocked(bool);
104 
105 public Q_SLOTS:
106  virtual int createTab();
107  virtual int createTab(pqServer*);
108  virtual int createTab(vtkSMViewLayoutProxy*);
109  virtual void closeTab(int);
110 
112 
116  void setDecorationsVisibility(bool);
117  void showDecorations() { this->setDecorationsVisibility(true); }
118  void hideDecorations() { this->setDecorationsVisibility(false); }
120 
124  virtual void toggleFullScreen();
125 
129  virtual void toggleWidgetDecoration();
130 
135  virtual void lockViewSize(const QSize&);
136 
140  virtual void reset();
141 
160  QSize preview(const QSize& previewSize = QSize());
161 
162 protected Q_SLOTS:
166  virtual void proxyAdded(pqProxy*);
167  virtual void proxyRemoved(pqProxy*);
168  virtual void serverRemoved(pqServer*);
169 
174  virtual void currentTabChanged(int);
175 
180  virtual void onStateLoaded();
181 
185  void contextMenuRequested(const QPoint&);
186 
187  void onLayoutNameChanged(pqServerManagerModelItem*);
188 
189 protected:
190  bool eventFilter(QObject* obj, QEvent* event) override;
191 
195  class pqTabWidget : public QTabWidget
196  {
197  typedef QTabWidget Superclass;
198 
199  public:
200  pqTabWidget(QWidget* parentWdg = NULL);
201  ~pqTabWidget() override;
202 
206  virtual void setTabButton(int index, QTabBar::ButtonPosition position, QWidget* wdg);
207 
213  virtual int tabButtonIndex(QWidget* wdg, QTabBar::ButtonPosition position) const;
214 
220  virtual int addAsTab(pqMultiViewWidget* wdg, pqTabbedMultiViewWidget* self);
221 
226  static const char* popoutLabelText(bool popped_out);
227 
231  static QStyle::StandardPixmap popoutLabelPixmap(bool popped_out);
232 
237  void setReadOnly(bool val);
238  bool readOnly() const { return this->ReadOnly; }
239 
243  QSize preview(const QSize&);
244 
246 
251  void setTabBarVisibility(bool);
252  bool tabBarVisibility() const { return this->TabBarVisibility; }
254  private:
255  Q_DISABLE_COPY(pqTabWidget)
256  bool ReadOnly;
257  bool TabBarVisibility;
259  };
260 
261 private:
262  Q_DISABLE_COPY(pqTabbedMultiViewWidget)
263 
264  class pqInternals;
265  pqInternals* Internals;
266  friend class pqInternals;
267 };
268 
269 #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:64
position