DockAreaWidget.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Qt Advanced Docking System
3 ** Copyright (C) 2017 Uwe Kindler
4 **
5 ** This library is free software; you can redistribute it and/or
6 ** modify it under the terms of the GNU Lesser General Public
7 ** License as published by the Free Software Foundation; either
8 ** version 2.1 of the License, or (at your option) any later version.
9 **
10 ** This library is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ** Lesser General Public License for more details.
14 **
15 ** You should have received a copy of the GNU Lesser General Public
16 ** License along with this library; If not, see <http://www.gnu.org/licenses/>.
17 ******************************************************************************/
18 
19 
20 //============================================================================
25 //============================================================================
26 
27 
28 //============================================================================
29 // INCLUDES
30 //============================================================================
31 #include "DockAreaWidget.h"
32 
33 #include <QStackedLayout>
34 #include <QScrollBar>
35 #include <QScrollArea>
36 #include <QWheelEvent>
37 #include <QStyle>
38 #include <QPushButton>
39 #include <QDebug>
40 #include <QMenu>
41 #include <QSplitter>
42 #include <QXmlStreamWriter>
43 #include <QVector>
44 #include <QList>
45 
46 
47 #include "DockContainerWidget.h"
48 #include "DockWidget.h"
49 #include "FloatingDockContainer.h"
50 #include "DockManager.h"
51 #include "DockOverlay.h"
52 #include "DockAreaTabBar.h"
53 #include "DockSplitter.h"
54 #include "DockAreaTitleBar.h"
55 #include "DockComponentsFactory.h"
56 #include "DockWidgetTab.h"
57 
58 
59 namespace ads
60 {
61 static const char* const INDEX_PROPERTY = "index";
62 static const char* const ACTION_PROPERTY = "action";
63 
72 {
73 private:
74  QBoxLayout* m_ParentLayout;
76  int m_CurrentIndex = -1;
77  QWidget* m_CurrentWidget = nullptr;
78 
79 public:
83  CDockAreaLayout(QBoxLayout* ParentLayout)
84  : m_ParentLayout(ParentLayout)
85  {
86 
87  }
88 
92  int count() const
93  {
94  return m_Widgets.count();
95  }
96 
101  void insertWidget(int index, QWidget* Widget)
102  {
103  Widget->setParent(nullptr);
104  if (index < 0)
105  {
106  index = m_Widgets.count();
107  }
108  m_Widgets.insert(index, Widget);
109  if (m_CurrentIndex < 0)
110  {
111  setCurrentIndex(index);
112  }
113  else
114  {
115  if (index <= m_CurrentIndex )
116  {
117  ++m_CurrentIndex;
118  }
119  }
120  }
121 
125  void removeWidget(QWidget* Widget)
126  {
127  if (currentWidget() == Widget)
128  {
129  auto LayoutItem = m_ParentLayout->takeAt(1);
130  if (LayoutItem)
131  {
132  LayoutItem->widget()->setParent(nullptr);
133  }
134  m_CurrentWidget = nullptr;
135  m_CurrentIndex = -1;
136  }
137  else if (indexOf(Widget) < m_CurrentIndex)
138  {
139  --m_CurrentIndex;
140  }
141  m_Widgets.removeOne(Widget);
142  }
143 
147  QWidget* currentWidget() const
148  {
149  return m_CurrentWidget;
150  }
151 
155  void setCurrentIndex(int index)
156  {
157  QWidget *prev = currentWidget();
158  QWidget *next = widget(index);
159  if (!next || (next == prev && !m_CurrentWidget))
160  {
161  return;
162  }
163 
164  bool reenableUpdates = false;
165  QWidget *parent = m_ParentLayout->parentWidget();
166 
167  if (parent && parent->updatesEnabled())
168  {
169  reenableUpdates = true;
170  parent->setUpdatesEnabled(false);
171  }
172 
173  auto LayoutItem = m_ParentLayout->takeAt(1);
174  if (LayoutItem)
175  {
176  LayoutItem->widget()->setParent(nullptr);
177  }
178  delete LayoutItem;
179 
180  m_ParentLayout->addWidget(next);
181  if (prev)
182  {
183  prev->hide();
184  }
185  m_CurrentIndex = index;
186  m_CurrentWidget = next;
187 
188 
189  if (reenableUpdates)
190  {
191  parent->setUpdatesEnabled(true);
192  }
193  }
194 
198  int currentIndex() const
199  {
200  return m_CurrentIndex;
201  }
202 
206  bool isEmpty() const
207  {
208  return m_Widgets.empty();
209  }
210 
214  int indexOf(QWidget* w) const
215  {
216  return m_Widgets.indexOf(w);
217  }
218 
222  QWidget* widget(int index) const
223  {
224  return (index < m_Widgets.size()) ? m_Widgets.at(index) : nullptr;
225  }
226 
230  QRect geometry() const
231  {
232  return m_Widgets.empty() ? QRect() : currentWidget()->geometry();
233  }
234 };
235 
236 
237 
239 static const DockWidgetAreas DefaultAllowedAreas = AllDockAreas;
240 
241 
246 {
247  CDockAreaWidget* _this = nullptr;
248  QBoxLayout* Layout = nullptr;
249  DockAreaLayout* ContentsLayout = nullptr;
250  CDockAreaTitleBar* TitleBar = nullptr;
251  CDockManager* DockManager = nullptr;
252  bool UpdateTitleBarButtons = false;
253  DockWidgetAreas AllowedAreas = DefaultAllowedAreas;
254  QSize MinSizeHint;
255  CDockAreaWidget::DockAreaFlags Flags{CDockAreaWidget::DefaultFlags};
256 
261 
265  void createTitleBar();
266 
271  {
272  return qobject_cast<CDockWidget*>(ContentsLayout->widget(index));
273  }
274 
279  {
280  return dockWidgetAt(index)->tabWidget();
281  }
282 
283 
288  {
289  return qvariant_cast<QAction*>(DockWidget->property(ACTION_PROPERTY));
290  }
291 
296  {
297  return DockWidget->property(INDEX_PROPERTY).toInt();
298  }
299 
304  {
305  return TitleBar->tabBar();
306  }
307 
311  void updateTitleBarButtonStates();
312 
317  {
318  MinSizeHint = QSize();
319  for (int i = 0; i < ContentsLayout->count(); ++i)
320  {
321  auto Widget = ContentsLayout->widget(i);
322  MinSizeHint.setHeight(qMax(MinSizeHint.height(), Widget->minimumSizeHint().height()));
323  MinSizeHint.setWidth(qMax(MinSizeHint.width(), Widget->minimumSizeHint().width()));
324  }
325  }
326 };
327 // struct DockAreaWidgetPrivate
328 
329 
330 //============================================================================
332  _this(_public)
333 {
334 
335 }
336 
337 
338 //============================================================================
340 {
342  Layout->addWidget(TitleBar);
346 }
347 
348 
349 //============================================================================
351 {
352  if (_this->isHidden())
353  {
354  UpdateTitleBarButtons = true;
355  return;
356  }
357 
358  TitleBar->button(TitleBarButtonClose)->setEnabled(
360  TitleBar->button(TitleBarButtonUndock)->setEnabled(
363  UpdateTitleBarButtons = false;
364 }
365 
366 
367 //============================================================================
369  QFrame(parent),
370  d(new DockAreaWidgetPrivate(this))
371 {
372  d->DockManager = DockManager;
373  d->Layout = new QBoxLayout(QBoxLayout::TopToBottom);
374  d->Layout->setContentsMargins(0, 0, 0, 0);
375  d->Layout->setSpacing(0);
376  setLayout(d->Layout);
377 
378  d->createTitleBar();
380  if (d->DockManager)
381  {
382  emit d->DockManager->dockAreaCreated(this);
383  }
384 }
385 
386 //============================================================================
388 {
389  ADS_PRINT("~CDockAreaWidget()");
390  delete d->ContentsLayout;
391  delete d;
392 }
393 
394 
395 //============================================================================
397 {
398  return d->DockManager;
399 }
400 
401 
402 //============================================================================
404 {
405  return internal::findParent<CDockContainerWidget*>(this);
406 }
407 
408 
409 //============================================================================
411 {
412  insertDockWidget(d->ContentsLayout->count(), DockWidget);
413 }
414 
415 
416 //============================================================================
418  bool Activate)
419 {
420  d->ContentsLayout->insertWidget(index, DockWidget);
421  DockWidget->setDockArea(this);
422  DockWidget->tabWidget()->setDockAreaWidget(this);
423  auto TabWidget = DockWidget->tabWidget();
424  // Inserting the tab will change the current index which in turn will
425  // make the tab widget visible in the slot
426  d->tabBar()->blockSignals(true);
427  d->tabBar()->insertTab(index, TabWidget);
428  d->tabBar()->blockSignals(false);
429  TabWidget->setVisible(!DockWidget->isClosed());
430  DockWidget->setProperty(INDEX_PROPERTY, index);
431  d->MinSizeHint.setHeight(qMax(d->MinSizeHint.height(), DockWidget->minimumSizeHint().height()));
432  d->MinSizeHint.setWidth(qMax(d->MinSizeHint.width(), DockWidget->minimumSizeHint().width()));
433  if (Activate)
434  {
435  setCurrentIndex(index);
436  }
437  // If this dock area is hidden, then we need to make it visible again
438  // by calling DockWidget->toggleViewInternal(true);
439  if (!this->isVisible() && d->ContentsLayout->count() > 1 && !dockManager()->isRestoringState())
440  {
441  DockWidget->toggleViewInternal(true);
442  }
445 }
446 
447 
448 //============================================================================
450 {
451  ADS_PRINT("CDockAreaWidget::removeDockWidget");
452  auto CurrentDockWidget = currentDockWidget();
453  auto NextOpenDockWidget = (DockWidget == CurrentDockWidget) ? nextOpenDockWidget(DockWidget) : nullptr;
454 
455  d->ContentsLayout->removeWidget(DockWidget);
456  auto TabWidget = DockWidget->tabWidget();
457  TabWidget->hide();
459  TabWidget->setParent(DockWidget);
460  DockWidget->setDockArea(nullptr);
461  CDockContainerWidget* DockContainer = dockContainer();
462  if (NextOpenDockWidget)
463  {
464  setCurrentDockWidget(NextOpenDockWidget);
465  }
466  else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() >= 1)
467  {
468  ADS_PRINT("Dock Area empty");
469  DockContainer->removeDockArea(this);
470  this->deleteLater();
471  if(DockContainer->dockAreaCount() == 0)
472  {
473  if(CFloatingDockContainer* FloatingDockContainer = DockContainer->floatingWidget())
474  {
475  FloatingDockContainer->hide();
476  FloatingDockContainer->deleteLater();
477  }
478  }
479  }
480  else if (DockWidget == CurrentDockWidget)
481  {
482  // if contents layout is not empty but there are no more open dock
483  // widgets, then we need to hide the dock area because it does not
484  // contain any visible content
486  }
487 
491  auto TopLevelDockWidget = DockContainer->topLevelDockWidget();
492  if (TopLevelDockWidget)
493  {
494  TopLevelDockWidget->emitTopLevelChanged(true);
495  }
496 
497 #if (ADS_DEBUG_LEVEL > 0)
498  DockContainer->dumpLayout();
499 #endif
500 }
501 
502 
503 //============================================================================
505 {
506  this->toggleView(false);
507 
508  // Hide empty parent splitters
509  auto Splitter = internal::findParent<CDockSplitter*>(this);
511 
512  //Hide empty floating widget
513  CDockContainerWidget* Container = this->dockContainer();
515  {
516  return;
517  }
518 
520  auto TopLevelWidget = Container->topLevelDockWidget();
521  auto FloatingWidget = Container->floatingWidget();
522  if (TopLevelWidget)
523  {
524  if (FloatingWidget)
525  {
526  FloatingWidget->updateWindowTitle();
527  }
528  CDockWidget::emitTopLevelEventForWidget(TopLevelWidget, true);
529  }
530  else if (Container->openedDockAreas().isEmpty() && FloatingWidget)
531  {
532  FloatingWidget->hide();
533  }
534 }
535 
536 
537 //============================================================================
539 {
540  ADS_PRINT("CDockAreaWidget::onTabCloseRequested " << Index);
541  auto* DockWidget = dockWidget(Index);
543  {
545  }
546  else
547  {
548  DockWidget->toggleView(false);
549  }
550 }
551 
552 
553 //============================================================================
555 {
556  int CurrentIndex = currentIndex();
557  if (CurrentIndex < 0)
558  {
559  return nullptr;
560  }
561 
562  return dockWidget(CurrentIndex);
563 }
564 
565 
566 //============================================================================
568 {
569  if (dockManager()->isRestoringState())
570  {
571  return;
572  }
573 
574  internalSetCurrentDockWidget(DockWidget);
575 }
576 
577 
578 //============================================================================
580 {
581  int Index = index(DockWidget);
582  if (Index < 0)
583  {
584  return;
585  }
586 
587  setCurrentIndex(Index);
588 }
589 
590 
591 //============================================================================
593 {
594  auto TabBar = d->tabBar();
595  if (index < 0 || index > (TabBar->count() - 1))
596  {
597  qWarning() << Q_FUNC_INFO << "Invalid index" << index;
598  return;
599  }
600 
601  auto cw = d->ContentsLayout->currentWidget();
602  auto nw = d->ContentsLayout->widget(index);
603  if (cw == nw && !nw->isHidden())
604  {
605  return;
606  }
607 
608  emit currentChanging(index);
609  TabBar->setCurrentIndex(index);
611  d->ContentsLayout->currentWidget()->show();
612  emit currentChanged(index);
613 }
614 
615 
616 //============================================================================
618 {
619  return d->ContentsLayout->currentIndex();
620 }
621 
622 
623 //============================================================================
625 {
626  return d->TitleBar->geometry();
627 }
628 
629 //============================================================================
631 {
632  return d->ContentsLayout->geometry();
633 }
634 
635 
636 //============================================================================
638 {
639  return d->ContentsLayout->indexOf(DockWidget);
640 }
641 
642 
643 //============================================================================
645 {
646  QList<CDockWidget*> DockWidgetList;
647  for (int i = 0; i < d->ContentsLayout->count(); ++i)
648  {
649  DockWidgetList.append(dockWidget(i));
650  }
651  return DockWidgetList;
652 }
653 
654 
655 //============================================================================
657 {
658  int Count = 0;
659  for (int i = 0; i < d->ContentsLayout->count(); ++i)
660  {
661  if (!dockWidget(i)->isClosed())
662  {
663  ++Count;
664  }
665  }
666  return Count;
667 }
668 
669 
670 //============================================================================
672 {
673  QList<CDockWidget*> DockWidgetList;
674  for (int i = 0; i < d->ContentsLayout->count(); ++i)
675  {
677  if (!DockWidget->isClosed())
678  {
679  DockWidgetList.append(dockWidget(i));
680  }
681  }
682  return DockWidgetList;
683 }
684 
685 
686 //============================================================================
688 {
689  for (int i = 0; i < d->ContentsLayout->count(); ++i)
690  {
691  if (!dockWidget(i)->isClosed())
692  {
693  return i;
694  }
695  }
696 
697  return -1;
698 }
699 
700 
701 //============================================================================
703 {
704  return d->ContentsLayout->count();
705 }
706 
707 
708 //============================================================================
710 {
711  return qobject_cast<CDockWidget*>(d->ContentsLayout->widget(Index));
712 }
713 
714 
715 //============================================================================
716 void CDockAreaWidget::reorderDockWidget(int fromIndex, int toIndex)
717 {
718  ADS_PRINT("CDockAreaWidget::reorderDockWidget");
719  if (fromIndex >= d->ContentsLayout->count() || fromIndex < 0
720  || toIndex >= d->ContentsLayout->count() || toIndex < 0 || fromIndex == toIndex)
721  {
722  ADS_PRINT("Invalid index for tab movement" << fromIndex << toIndex);
723  return;
724  }
725 
726  auto Widget = d->ContentsLayout->widget(fromIndex);
727  d->ContentsLayout->removeWidget(Widget);
728  d->ContentsLayout->insertWidget(toIndex, Widget);
729  setCurrentIndex(toIndex);
730 }
731 
732 
733 //============================================================================
735 {
736  Q_UNUSED(DockWidget);
737  Q_UNUSED(Open);
739 }
740 
741 
742 //============================================================================
744 {
745  CDockContainerWidget* Container = dockContainer();
746  if (!Container)
747  {
748  return;
749  }
750 
752  {
753  return;
754  }
755 
756  if (d->TitleBar)
757  {
758  bool Hidden = Container->hasTopLevelDockWidget() && (Container->isFloating()
760  Hidden |= (d->Flags.testFlag(HideSingleWidgetTitleBar) && openDockWidgetsCount() == 1);
761  d->TitleBar->setVisible(!Hidden);
762  }
763 }
764 
765 
766 //============================================================================
768 {
769  if (d->TitleBar)
770  {
772  }
773 }
774 
775 
776 
777 //============================================================================
778 void CDockAreaWidget::saveState(QXmlStreamWriter& s) const
779 {
780  s.writeStartElement("Area");
781  s.writeAttribute("Tabs", QString::number(d->ContentsLayout->count()));
782  auto CurrentDockWidget = currentDockWidget();
783  QString Name = CurrentDockWidget ? CurrentDockWidget->objectName() : "";
784  s.writeAttribute("Current", Name);
785  // To keep the saved XML data small, we only save the allowed areas and the
786  // dock area flags if the values are different from the default values
787  if (d->AllowedAreas != DefaultAllowedAreas)
788  {
789  s.writeAttribute("AllowedAreas", QString::number(d->AllowedAreas, 16));
790  }
791 
792  if (d->Flags != DefaultFlags)
793  {
794  s.writeAttribute("Flags", QString::number(d->Flags, 16));
795  }
796  ADS_PRINT("CDockAreaWidget::saveState TabCount: " << d->ContentsLayout->count()
797  << " Current: " << Name);
798  for (int i = 0; i < d->ContentsLayout->count(); ++i)
799  {
800  dockWidget(i)->saveState(s);
801  }
802  s.writeEndElement();
803 }
804 
805 
806 //============================================================================
808 {
809  auto OpenDockWidgets = openedDockWidgets();
810  if (OpenDockWidgets.count() > 1 || (OpenDockWidgets.count() == 1 && OpenDockWidgets[0] != DockWidget))
811  {
812  CDockWidget* NextDockWidget;
813  if (OpenDockWidgets.last() == DockWidget)
814  {
815  NextDockWidget = OpenDockWidgets[OpenDockWidgets.count() - 2];
816  }
817  else
818  {
819  int NextIndex = OpenDockWidgets.indexOf(DockWidget) + 1;
820  NextDockWidget = OpenDockWidgets[NextIndex];
821  }
822 
823  return NextDockWidget;
824  }
825  else
826  {
827  return nullptr;
828  }
829 }
830 
831 
832 //============================================================================
833 CDockWidget::DockWidgetFeatures CDockAreaWidget::features(eBitwiseOperator Mode) const
834 {
835  if (BitwiseAnd == Mode)
836  {
837  CDockWidget::DockWidgetFeatures Features(CDockWidget::AllDockWidgetFeatures);
838  for (const auto DockWidget : dockWidgets())
839  {
840  Features &= DockWidget->features();
841  }
842  return Features;
843  }
844  else
845  {
846  CDockWidget::DockWidgetFeatures Features(CDockWidget::NoDockWidgetFeatures);
847  for (const auto DockWidget : dockWidgets())
848  {
849  Features |= DockWidget->features();
850  }
851  return Features;
852  }
853 }
854 
855 
856 //============================================================================
858 {
859  setVisible(Open);
860 
861  emit viewToggled(Open);
862 }
863 
864 
865 //============================================================================
866 void CDockAreaWidget::setVisible(bool Visible)
867 {
868  Super::setVisible(Visible);
870  {
872  }
873 }
874 
875 
876 //============================================================================
877 void CDockAreaWidget::setAllowedAreas(DockWidgetAreas areas)
878 {
879  d->AllowedAreas = areas;
880 }
881 
882 
883 //============================================================================
884 DockWidgetAreas CDockAreaWidget::allowedAreas() const
885 {
886  return d->AllowedAreas;
887 }
888 
889 
890 //============================================================================
891 CDockAreaWidget::DockAreaFlags CDockAreaWidget::dockAreaFlags() const
892 {
893  return d->Flags;
894 }
895 
896 
897 //============================================================================
898 void CDockAreaWidget::setDockAreaFlags(DockAreaFlags Flags)
899 {
900  auto ChangedFlags = d->Flags ^ Flags;
901  d->Flags = Flags;
902  if (ChangedFlags.testFlag(HideSingleWidgetTitleBar))
903  {
905  }
906 }
907 
908 
909 //============================================================================
911 {
912  auto flags = dockAreaFlags();
913  internal::setFlag(flags, Flag, On);
914  setDockAreaFlags(flags);
915 }
916 
917 
918 //============================================================================
919 QAbstractButton* CDockAreaWidget::titleBarButton(TitleBarButton which) const
920 {
921  return d->TitleBar->button(which);
922 }
923 
924 
925 //============================================================================
927 {
928  // If there is only one single dock widget and this widget has the
929  // DeleteOnClose feature, then we delete the dock widget now
930  auto OpenDockWidgets = openedDockWidgets();
931  if (OpenDockWidgets.count() == 1 && OpenDockWidgets[0]->features().testFlag(CDockWidget::DockWidgetDeleteOnClose))
932  {
933  OpenDockWidgets[0]->closeDockWidgetInternal();
934  }
935  else
936  {
937  for (auto DockWidget : openedDockWidgets())
938  {
941  else
942  DockWidget->toggleView(false);
943  }
944  }
945 }
946 
947 
948 //============================================================================
950 {
952 }
953 
954 
955 //============================================================================
957 {
958  return d->TitleBar;
959 }
960 
961 
962 //============================================================================
964 {
965  if (dockWidgetsCount()!= 1)
966  {
967  return false;
968  }
969 
970  return dockManager()->centralWidget() == dockWidgets()[0];
971 }
972 
973 
974 //============================================================================
976 {
977  return d->MinSizeHint.isValid() ? d->MinSizeHint : Super::minimumSizeHint();
978 }
979 
980 
981 //============================================================================
983 {
984  if (d->TitleBar)
985  {
987  }
988 }
989 
990 
991 } // namespace ads
992 
993 //---------------------------------------------------------------------------
994 // EOF DockAreaWidget.cpp
static bool testConfigFlag(eConfigFlag Flag)
void setDockArea(CDockAreaWidget *DockArea)
Definition: DockWidget.cpp:549
QList< CDockWidget * > dockWidgets() const
DockAreaFlags dockAreaFlags() const
Declaration of CDockWidgetTab class.
void setDockAreaFlag(eDockAreaFlag Flag, bool On)
void closeOtherAreas(CDockAreaWidget *KeepOpenArea)
CDockWidget::DockWidgetFeatures features(eBitwiseOperator Mode=BitwiseAnd) const
int indexOfFirstOpenDockWidget() const
bool isRestoringState() const
void toggleViewInternal(bool Open)
Definition: DockWidget.cpp:499
CDockWidget * currentDockWidget() const
void removeDockWidget(CDockWidget *DockWidget)
CDockAreaTitleBar * titleBar() const
void currentChanged(int index)
QList< CDockWidget * > openedDockWidgets() const
TitleBarButton
Definition: ads_globals.h:89
QAction * dockWidgetTabAction(CDockWidget *DockWidget) const
dock widget has a close button
Definition: DockWidget.h:150
MQTTClient d
Definition: test10.c:1656
QBoxLayout * m_ParentLayout
deletes the dock widget when it is closed
Definition: DockWidget.h:153
virtual void setVisible(bool Visible) override
void setDockAreaFlags(DockAreaFlags Flags)
CDockWidget * dockWidgetAt(int index)
Declaration of DockComponentsFactory.
QRect geometry() const
CDockWidget * centralWidget() const
void setCurrentIndex(int index)
DockWidgetAreas allowedAreas() const
DockAreaLayout * ContentsLayout
Declaration of CDockAreaTabBar class.
Declaration of CFloatingDockContainer class.
QList< CDockAreaWidget * > openedDockAreas() const
const CDockComponentsFactory * componentsFactory()
void insertTab(int Index, CDockWidgetTab *Tab)
CDockContainerWidget * dockContainer() const
void removeDockArea(CDockAreaWidget *area)
void setCurrentDockWidget(CDockWidget *DockWidget)
void tabCloseRequested(int index)
CDockWidget * nextOpenDockWidget(CDockWidget *DockWidget) const
CDockWidgetTab * tabWidgetAt(int index)
CDockAreaWidget(CDockManager *DockManager, CDockContainerWidget *parent)
CDockAreaWidget::DockAreaFlags Flags
virtual CDockAreaTitleBar * createDockAreaTitleBar(CDockAreaWidget *DockArea) const
bool isClosed() const
Definition: DockWidget.cpp:431
void internalSetCurrentDockWidget(CDockWidget *DockWidget)
CDockAreaLayout DockAreaLayout
void tabMoved(int from, int to)
CDockAreaTabBar * tabBar() const
void insertWidget(int index, QWidget *Widget)
void saveState(QXmlStreamWriter &Stream) const
dock widget can be dragged into a floating window
Definition: DockWidget.h:152
dock widget will be closed when the dock area hosting it is closed
Definition: DockWidget.h:156
void toggleDockWidgetView(CDockWidget *DockWidget, bool Open)
int dockWidgetIndex(CDockWidget *DockWidget) const
void dockAreaCreated(ads::CDockAreaWidget *DockArea)
void toggleView(bool Open=true)
Definition: DockWidget.cpp:475
void emitTopLevelChanged(bool Floating)
Definition: DockWidget.cpp:784
void addDockWidget(CDockWidget *DockWidget)
CDockWidget * dockWidget(int Index) const
static const char *const INDEX_PROPERTY
If this option is enabled, the tab of a dock widget is always displayed - even if it is the only visi...
Definition: DockManager.h:172
void onTabCloseRequested(int Index)
void setAllowedAreas(DockWidgetAreas areas)
#define next(ls)
Definition: llex.c:32
void setCurrentIndex(int index)
#define ADS_PRINT(s)
Definition: ads_globals.h:60
CDockAreaLayout(QBoxLayout *ParentLayout)
bool isCentralWidgetArea() const
Declaration of CDockSplitter.
DockAreaWidgetPrivate(CDockAreaWidget *_public)
QWidget * currentWidget() const
CDockAreaTabBar * tabBar() const
QRect titleBarGeometry() const
void setFlag(T &Flags, typename T::enum_type flag, bool on=true)
Definition: ads_globals.h:230
void removeTab(CDockWidgetTab *Tab)
int dockWidgetsCount() const
Declaration of CDockContainerWidget class.
void setDockAreaWidget(CDockAreaWidget *DockArea)
static const char *const ACTION_PROPERTY
int index(CDockWidget *DockWidget)
CFloatingDockContainer * floatingWidget() const
virtual QSize minimumSizeHint() const override
Definition: DockWidget.cpp:802
virtual void setVisible(bool Visible) override
virtual QSize minimumSizeHint() const override
CDockWidget * topLevelDockWidget() const
void currentChanging(int index)
CDockWidgetTab * tabWidget() const
Definition: DockWidget.cpp:328
DockWidgetFeatures features() const
Definition: DockWidget.cpp:359
QAbstractButton * button(TitleBarButton which) const
void hideEmptyParentSplitters(CDockSplitter *FirstParentSplitter)
Declaration of CDockAreaWidget class.
CDockManager * dockManager() const
void removeWidget(QWidget *Widget)
bool closeDockWidgetInternal(bool ForceClose=false)
Definition: DockWidget.cpp:843
void tabBarClicked(int index)
QList< QWidget * > m_Widgets
eBitwiseOperator
Definition: ads_globals.h:123
void toggleView(bool Open)
Declaration of CDockWidget class.
void viewToggled(bool Open)
Declaration of CDockManager class.
DockAreaWidgetPrivate * d
private data (pimpl)
static void emitTopLevelEventForWidget(CDockWidget *TopLevelDockWidget, bool Floating)
Definition: DockWidget.cpp:773
QAbstractButton * titleBarButton(TitleBarButton which) const
void reorderDockWidget(int fromIndex, int toIndex)
void saveState(QXmlStreamWriter &Stream) const
Definition: DockWidget.cpp:558
static const DockWidgetAreas DefaultAllowedAreas
QWidget * widget(int index) const
int openDockWidgetsCount() const
CDockAreaTitleBar * TitleBar
Declaration of CDockAreaTitleBar class.
int indexOf(QWidget *w) const
QRect contentAreaGeometry() const
void insertDockWidget(int index, CDockWidget *DockWidget, bool Activate=true)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:47:34