pqTabbedMultiViewWidget.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqTabbedMultiViewWidget_h
5 #define pqTabbedMultiViewWidget_h
6 
7 #include "pqComponentsModule.h"
8 #include "vtkType.h" // needed for vtkIdType
9 #include <QCoreApplication>
10 #include <QStyle> // needed for QStyle:StandardPixmap
11 #include <QTabBar> // needed for QTabBar::ButtonPosition
12 #include <QTabWidget> // needed for QTabWidget.
13 
14 class pqMultiViewWidget;
15 class pqProxy;
16 class pqServer;
18 class pqView;
19 class vtkImageData;
21 
29 {
30  Q_OBJECT
31  typedef QWidget Superclass;
32  Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly)
33 public:
34  pqTabbedMultiViewWidget(QWidget* parent = nullptr);
35  ~pqTabbedMultiViewWidget() override;
36 
40  virtual QSize clientSize() const;
41 
46  void setReadOnly(bool val);
47  bool readOnly() const;
48 
53  void setTabVisibility(bool visible);
54  bool tabVisibility() const;
55 
59  vtkSMViewLayoutProxy* layoutProxy() const;
60 
64  bool decorationsVisibility() const;
65 
70  pqMultiViewWidget* findTab(vtkSMViewLayoutProxy*) const;
71 
73 
77  void enableAnnotationFilter(const QString& annotationKey);
78  void disableAnnotationFilter();
79  void setAnnotationFilterMatching(bool matching);
81 
87  void updateVisibleTabs();
88 
93  QList<QString> visibleTabLabels() const;
94 
95 Q_SIGNALS:
99  void viewSizeLocked(bool);
100 
104  void fullScreenEnabled(bool);
105 
109  void fullScreenActiveViewEnabled(bool);
110 
111 public Q_SLOTS:
112  virtual int createTab();
113  virtual int createTab(pqServer*);
114  virtual int createTab(vtkSMViewLayoutProxy*);
115  virtual void closeTab(int);
116 
120  void setCurrentTab(int index);
121 
123 
127  void setDecorationsVisibility(bool);
128  void showDecorations() { this->setDecorationsVisibility(true); }
129  void hideDecorations() { this->setDecorationsVisibility(false); }
131 
137  virtual void toggleFullScreen();
138 
142  void toggleFullScreenActiveView();
143 
147  virtual void toggleWidgetDecoration();
148 
153  virtual void lockViewSize(const QSize&);
154 
158  virtual void reset();
159 
178  QSize preview(const QSize& previewSize = QSize());
179 
180 protected Q_SLOTS:
184  virtual void proxyAdded(pqProxy*);
185  virtual void proxyRemoved(pqProxy*);
186  virtual void serverRemoved(pqServer*);
187 
192  virtual void currentTabChanged(int);
193 
198  virtual void onStateLoaded();
199 
203  void contextMenuRequested(const QPoint&);
204 
205  void onLayoutNameChanged(pqServerManagerModelItem*);
206 
207 protected: // NOLINT(readability-redundant-access-specifiers)
208  bool eventFilter(QObject* obj, QEvent* event) override;
209 
213  class pqTabWidget : public QTabWidget
214  {
215  typedef QTabWidget Superclass;
216 
217  Q_DECLARE_TR_FUNCTIONS(pqTabWidget);
218 
219  public:
220  pqTabWidget(QWidget* parentWdg = nullptr);
221  ~pqTabWidget() override;
222 
226  virtual void setTabButton(int index, QTabBar::ButtonPosition position, QWidget* wdg);
227 
233  virtual int tabButtonIndex(QWidget* wdg, QTabBar::ButtonPosition position) const;
234 
240  virtual int addAsTab(pqMultiViewWidget* wdg, pqTabbedMultiViewWidget* self);
241 
246  static QString popoutLabelText(bool popped_out);
247 
251  static QStyle::StandardPixmap popoutLabelPixmap(bool popped_out);
252 
257  void setReadOnly(bool val);
258  bool readOnly() const { return this->ReadOnly; }
259 
263  QSize preview(const QSize&);
264 
266 
271  void setTabBarVisibility(bool);
272  bool tabBarVisibility() const { return this->TabBarVisibility; }
274  protected:
275  void createViewSelectorTabIfNeeded(int tabIndex);
276 
277  private:
278  Q_DISABLE_COPY(pqTabWidget)
279  bool ReadOnly;
280  bool TabBarVisibility;
282  };
283 
284 private:
285  Q_DISABLE_COPY(pqTabbedMultiViewWidget)
286 
287  class pqInternals;
288  pqInternals* Internals;
289  friend class pqInternals;
290 };
291 
292 #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:26
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:28
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:35
position