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;
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;
252  bool UpdateTitleBarButtons = false;
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 
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 {
413 }
414 
415 
416 //============================================================================
418  bool Activate)
419 {
421  DockWidget->setDockArea(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);
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  {
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  {
442  }
445 }
446 
447 
448 //============================================================================
450 {
451  ADS_PRINT("CDockAreaWidget::removeDockWidget");
452  auto CurrentDockWidget = currentDockWidget();
453  auto NextOpenDockWidget = (DockWidget == CurrentDockWidget) ? nextOpenDockWidget(DockWidget) : nullptr;
454 
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 
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 {
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
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
DockSplitter.h
Declaration of CDockSplitter.
ads::CDockAreaTitleBar::markTabsMenuOutdated
void markTabsMenuOutdated()
Definition: DockAreaTitleBar.cpp:305
ads::CDockAreaWidget::saveState
void saveState(QXmlStreamWriter &Stream) const
Definition: DockAreaWidget.cpp:778
ads::CDockContainerWidget::dockAreaCount
int dockAreaCount() const
Definition: DockContainerWidget.cpp:1501
ads::CDockAreaWidget::toggleDockWidgetView
void toggleDockWidgetView(CDockWidget *DockWidget, bool Open)
Definition: DockAreaWidget.cpp:734
ads::CDockAreaWidget::onTabCloseRequested
void onTabCloseRequested(int Index)
Definition: DockAreaWidget.cpp:538
ads::CDockAreaLayout
Definition: DockAreaWidget.cpp:71
ads::DockAreaWidgetPrivate::createTitleBar
void createTitleBar()
Definition: DockAreaWidget.cpp:339
ads::CDockAreaLayout::removeWidget
void removeWidget(QWidget *Widget)
Definition: DockAreaWidget.cpp:125
ads::DockAreaWidgetPrivate
Definition: DockAreaWidget.cpp:245
ads::CDockAreaWidget::titleBar
CDockAreaTitleBar * titleBar() const
Definition: DockAreaWidget.cpp:956
ads::CDockAreaWidget::features
CDockWidget::DockWidgetFeatures features(eBitwiseOperator Mode=BitwiseAnd) const
Definition: DockAreaWidget.cpp:833
ads::CDockWidget::NoDockWidgetFeatures
@ NoDockWidgetFeatures
Definition: DockWidget.h:160
ads::CDockManager::HideSingleCentralWidgetTitleBar
@ HideSingleCentralWidgetTitleBar
Definition: DockManager.h:179
ads::CDockManager::centralWidget
CDockWidget * centralWidget() const
Definition: DockManager.cpp:919
ads::CDockContainerWidget::openedDockAreas
QList< CDockAreaWidget * > openedDockAreas() const
Definition: DockContainerWidget.cpp:1612
ads::DockAreaWidgetPrivate::dockWidgetTabAction
QAction * dockWidgetTabAction(CDockWidget *DockWidget) const
Definition: DockAreaWidget.cpp:287
ads::CDockAreaWidget::titleBarGeometry
QRect titleBarGeometry() const
Definition: DockAreaWidget.cpp:624
ads::CDockAreaWidget::dockAreaFlags
DockAreaFlags dockAreaFlags() const
Definition: DockAreaWidget.cpp:891
ads::CDockContainerWidget::dumpLayout
void dumpLayout()
Definition: DockContainerWidget.cpp:1732
ads::CDockManager::AlwaysShowTabs
@ AlwaysShowTabs
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
ads::CDockWidget::minimumSizeHint
virtual QSize minimumSizeHint() const override
Definition: DockWidget.cpp:802
ads::CDockAreaWidget::index
int index(CDockWidget *DockWidget)
Definition: DockAreaWidget.cpp:637
ads::CDockAreaWidget::minimumSizeHint
virtual QSize minimumSizeHint() const override
Definition: DockAreaWidget.cpp:975
DockContainerWidget.h
Declaration of CDockContainerWidget class.
ads::CDockAreaWidget::toggleView
void toggleView(bool Open)
Definition: DockAreaWidget.cpp:857
ads::CDockAreaWidget::onDockWidgetFeaturesChanged
void onDockWidgetFeaturesChanged()
Definition: DockAreaWidget.cpp:982
ads::CDockAreaWidget::setAllowedAreas
void setAllowedAreas(DockWidgetAreas areas)
Definition: DockAreaWidget.cpp:877
ads::CDockAreaWidget::titleBarButton
QAbstractButton * titleBarButton(TitleBarButton which) const
Definition: DockAreaWidget.cpp:919
ads::CDockAreaWidget::~CDockAreaWidget
virtual ~CDockAreaWidget()
Definition: DockAreaWidget.cpp:387
FloatingDockContainer.h
Declaration of CFloatingDockContainer class.
ads::CDockAreaLayout::geometry
QRect geometry() const
Definition: DockAreaWidget.cpp:230
s
XmlRpcServer s
ads::CDockWidget::setDockArea
void setDockArea(CDockAreaWidget *DockArea)
Definition: DockWidget.cpp:549
ads::CDockAreaWidget::closeArea
void closeArea()
Definition: DockAreaWidget.cpp:926
ads::eBitwiseOperator
eBitwiseOperator
Definition: ads_globals.h:123
ads::CDockAreaTabBar::removeTab
void removeTab(CDockWidgetTab *Tab)
Definition: DockAreaTabBar.cpp:224
ads::CDockAreaWidget::markTitleBarMenuOutdated
void markTitleBarMenuOutdated()
Definition: DockAreaWidget.cpp:767
ads::CDockAreaLayout::CDockAreaLayout
CDockAreaLayout(QBoxLayout *ParentLayout)
Definition: DockAreaWidget.cpp:83
ads::CDockAreaTitleBar
Definition: DockAreaTitleBar.h:50
ads::TitleBarButtonClose
@ TitleBarButtonClose
Definition: ads_globals.h:93
ads::CDockWidget::closeDockWidgetInternal
bool closeDockWidgetInternal(bool ForceClose=false)
Definition: DockWidget.cpp:843
ads::CDockContainerWidget::floatingWidget
CFloatingDockContainer * floatingWidget() const
Definition: DockContainerWidget.cpp:1831
ads::CDockAreaWidget::d
DockAreaWidgetPrivate * d
private data (pimpl)
Definition: DockAreaWidget.h:59
ads::CDockAreaWidget::isCentralWidgetArea
bool isCentralWidgetArea() const
Definition: DockAreaWidget.cpp:963
ads::DockAreaWidgetPrivate::ContentsLayout
DockAreaLayout * ContentsLayout
Definition: DockAreaWidget.cpp:249
TabWidget
Definition: tab_widget.h:20
DockOverlay.h
ads::DockAreaWidgetPrivate::dockWidgetAt
CDockWidget * dockWidgetAt(int index)
Definition: DockAreaWidget.cpp:270
ads::CDockAreaWidget::currentChanging
void currentChanging(int index)
DockWidget.h
Declaration of CDockWidget class.
ads::CDockAreaWidget::viewToggled
void viewToggled(bool Open)
ads::CDockContainerWidget::removeDockArea
void removeDockArea(CDockAreaWidget *area)
Definition: DockContainerWidget.cpp:1393
DockAreaTabBar.h
Declaration of CDockAreaTabBar class.
ads::BitwiseAnd
@ BitwiseAnd
Definition: ads_globals.h:125
ads::CDockWidget::emitTopLevelChanged
void emitTopLevelChanged(bool Floating)
Definition: DockWidget.cpp:784
ads::CDockComponentsFactory::createDockAreaTitleBar
virtual CDockAreaTitleBar * createDockAreaTitleBar(CDockAreaWidget *DockArea) const
Definition: DockComponentsFactory.cpp:41
QList< QWidget * >
ads::CDockAreaWidget
Definition: DockAreaWidget.h:55
ads::DefaultAllowedAreas
static const DockWidgetAreas DefaultAllowedAreas
Definition: DockAreaWidget.cpp:239
ads::CDockAreaWidget::reorderDockWidget
void reorderDockWidget(int fromIndex, int toIndex)
Definition: DockAreaWidget.cpp:716
ads::DockAreaWidgetPrivate::DockManager
CDockManager * DockManager
Definition: DockAreaWidget.cpp:251
ads::CDockContainerWidget::isFloating
bool isFloating() const
Definition: DockContainerWidget.cpp:1494
ads::CDockWidget::emitTopLevelEventForWidget
static void emitTopLevelEventForWidget(CDockWidget *TopLevelDockWidget, bool Floating)
Definition: DockWidget.cpp:773
ads::componentsFactory
const CDockComponentsFactory * componentsFactory()
Definition: DockComponentsFactory.h:82
ads::AllDockAreas
@ AllDockAreas
Definition: ads_globals.h:84
ads::CDockAreaWidget::insertDockWidget
void insertDockWidget(int index, CDockWidget *DockWidget, bool Activate=true)
Definition: DockAreaWidget.cpp:417
ads::TitleBarButtonUndock
@ TitleBarButtonUndock
Definition: ads_globals.h:92
ads::CDockAreaWidget::openDockWidgetsCount
int openDockWidgetsCount() const
Definition: DockAreaWidget.cpp:656
ads::CDockWidget::isClosed
bool isClosed() const
Definition: DockWidget.cpp:431
ads::CDockAreaWidget::nextOpenDockWidget
CDockWidget * nextOpenDockWidget(CDockWidget *DockWidget) const
Definition: DockAreaWidget.cpp:807
ads::DockAreaWidgetPrivate::UpdateTitleBarButtons
bool UpdateTitleBarButtons
Definition: DockAreaWidget.cpp:252
ads::CDockAreaWidget::currentIndex
int currentIndex() const
Definition: DockAreaWidget.cpp:617
ads::CDockAreaLayout::m_CurrentWidget
QWidget * m_CurrentWidget
Definition: DockAreaWidget.cpp:77
ads::DockAreaWidgetPrivate::tabWidgetAt
CDockWidgetTab * tabWidgetAt(int index)
Definition: DockAreaWidget.cpp:278
ads::CDockContainerWidget::topLevelDockWidget
CDockWidget * topLevelDockWidget() const
Definition: DockContainerWidget.cpp:1765
ads::DockAreaWidgetPrivate::Flags
CDockAreaWidget::DockAreaFlags Flags
Definition: DockAreaWidget.cpp:255
ads::CDockAreaLayout::m_Widgets
QList< QWidget * > m_Widgets
Definition: DockAreaWidget.cpp:75
ads::CDockManager
Definition: DockManager.h:69
Count
Count
ads::CFloatingDockContainer::updateWindowTitle
void updateWindowTitle()
Definition: FloatingDockContainer.cpp:963
ads::CDockAreaWidget::removeDockWidget
void removeDockWidget(CDockWidget *DockWidget)
Definition: DockAreaWidget.cpp:449
ads::CDockAreaWidget::currentChanged
void currentChanged(int index)
ads
Definition: ads_globals.h:69
ads::CDockWidget::DockWidgetClosable
@ DockWidgetClosable
dock widget has a close button
Definition: DockWidget.h:150
DockWidget
Definition: plot_docker.h:16
ads::CDockWidget::DockWidgetFloatable
@ DockWidgetFloatable
dock widget can be dragged into a floating window
Definition: DockWidget.h:152
DockComponentsFactory.h
Declaration of DockComponentsFactory.
ads::CDockWidget::tabWidget
CDockWidgetTab * tabWidget() const
Definition: DockWidget.cpp:328
ads::CDockManager::dockAreaCreated
void dockAreaCreated(ads::CDockAreaWidget *DockArea)
DockAreaTitleBar.h
Declaration of CDockAreaTitleBar class.
ads::CDockAreaWidget::updateTitleBarVisibility
void updateTitleBarVisibility()
Definition: DockAreaWidget.cpp:743
ADS_PRINT
#define ADS_PRINT(s)
Definition: ads_globals.h:60
ads::CDockAreaTabBar
Definition: DockAreaTabBar.h:53
ads::CDockWidget::saveState
void saveState(QXmlStreamWriter &Stream) const
Definition: DockWidget.cpp:558
ads::DockAreaWidgetPrivate::Layout
QBoxLayout * Layout
Definition: DockAreaWidget.cpp:248
ads::CDockWidget
Definition: DockWidget.h:54
ads::INDEX_PROPERTY
static const char *const INDEX_PROPERTY
Definition: DockAreaWidget.cpp:61
ads::DockAreaWidgetPrivate::DockAreaWidgetPrivate
DockAreaWidgetPrivate(CDockAreaWidget *_public)
Definition: DockAreaWidget.cpp:331
ads::CDockAreaWidget::currentDockWidget
CDockWidget * currentDockWidget() const
Definition: DockAreaWidget.cpp:554
ads::CDockAreaWidget::openedDockWidgets
QList< CDockWidget * > openedDockWidgets() const
Definition: DockAreaWidget.cpp:671
ads::CDockAreaLayout::currentIndex
int currentIndex() const
Definition: DockAreaWidget.cpp:198
ads::CDockAreaWidget::setDockAreaFlag
void setDockAreaFlag(eDockAreaFlag Flag, bool On)
Definition: DockAreaWidget.cpp:910
DockAreaWidget.h
Declaration of CDockAreaWidget class.
Name
@ Name
Definition: curvelist_view.h:46
ads::CDockAreaWidget::closeOtherAreas
void closeOtherAreas()
Definition: DockAreaWidget.cpp:949
ads::CDockWidget::toggleViewInternal
void toggleViewInternal(bool Open)
Definition: DockWidget.cpp:499
d
d
ads::CDockAreaWidget::indexOfFirstOpenDockWidget
int indexOfFirstOpenDockWidget() const
Definition: DockAreaWidget.cpp:687
ads::CDockAreaLayout::m_CurrentIndex
int m_CurrentIndex
Definition: DockAreaWidget.cpp:76
ads::CDockWidgetTab::setDockAreaWidget
void setDockAreaWidget(CDockAreaWidget *DockArea)
Definition: DockWidgetTab.cpp:553
ads::CDockAreaLayout::setCurrentIndex
void setCurrentIndex(int index)
Definition: DockAreaWidget.cpp:155
ads::CDockAreaTitleBar::updateDockWidgetActionsButtons
void updateDockWidgetActionsButtons()
Definition: DockAreaTitleBar.cpp:390
ads::CDockWidget::features
DockWidgetFeatures features() const
Definition: DockWidget.cpp:359
ads::CDockAreaTabBar::insertTab
void insertTab(int Index, CDockWidgetTab *Tab)
Definition: DockAreaTabBar.cpp:200
ads::CDockAreaWidget::dockWidgets
QList< CDockWidget * > dockWidgets() const
Definition: DockAreaWidget.cpp:644
ads::CDockAreaTitleBar::tabBarClicked
void tabBarClicked(int index)
ads::internal::hideEmptyParentSplitters
void hideEmptyParentSplitters(CDockSplitter *FirstParentSplitter)
Definition: ads_globals.cpp:328
ads::CDockAreaWidget::dockContainer
CDockContainerWidget * dockContainer() const
Definition: DockAreaWidget.cpp:403
ads::CDockAreaWidget::hideAreaWithNoVisibleContent
void hideAreaWithNoVisibleContent()
Definition: DockAreaWidget.cpp:504
ads::DockAreaWidgetPrivate::AllowedAreas
DockWidgetAreas AllowedAreas
Definition: DockAreaWidget.cpp:253
ads::CDockAreaTitleBar::setVisible
virtual void setVisible(bool Visible) override
Definition: DockAreaTitleBar.cpp:456
ads::CDockWidget::DockWidgetDeleteOnClose
@ DockWidgetDeleteOnClose
deletes the dock widget when it is closed
Definition: DockWidget.h:153
ads::CDockAreaLayout::widget
QWidget * widget(int index) const
Definition: DockAreaWidget.cpp:222
DockManager.h
Declaration of CDockManager class.
DockWidgetTab.h
Declaration of CDockWidgetTab class.
ads::CDockWidget::AllDockWidgetFeatures
@ AllDockWidgetFeatures
Definition: DockWidget.h:158
ads::CDockAreaWidget::dockManager
CDockManager * dockManager() const
Definition: DockAreaWidget.cpp:396
ads::DockAreaWidgetPrivate::MinSizeHint
QSize MinSizeHint
Definition: DockAreaWidget.cpp:254
ads::CDockAreaWidget::eDockAreaFlag
eDockAreaFlag
Definition: DockAreaWidget.h:150
ads::CDockAreaLayout::indexOf
int indexOf(QWidget *w) const
Definition: DockAreaWidget.cpp:214
ads::CDockAreaWidget::setCurrentDockWidget
void setCurrentDockWidget(CDockWidget *DockWidget)
Definition: DockAreaWidget.cpp:567
ads::DockAreaWidgetPrivate::dockWidgetIndex
int dockWidgetIndex(CDockWidget *DockWidget) const
Definition: DockAreaWidget.cpp:295
ads::CDockAreaLayout::insertWidget
void insertWidget(int index, QWidget *Widget)
Definition: DockAreaWidget.cpp:101
ads::CFloatingDockContainer
Definition: FloatingDockContainer.h:104
ads::TitleBarButton
TitleBarButton
Definition: ads_globals.h:89
ads::CDockAreaTitleBar::tabBar
CDockAreaTabBar * tabBar() const
Definition: DockAreaTitleBar.cpp:299
ads::CDockContainerWidget
Definition: DockContainerWidget.h:61
ads::CDockAreaLayout::m_ParentLayout
QBoxLayout * m_ParentLayout
Definition: DockAreaWidget.cpp:74
ads::CDockAreaTabBar::tabMoved
void tabMoved(int from, int to)
ads::CDockAreaWidget::setDockAreaFlags
void setDockAreaFlags(DockAreaFlags Flags)
Definition: DockAreaWidget.cpp:898
ads::CDockAreaTitleBar::button
QAbstractButton * button(TitleBarButton which) const
Definition: DockAreaTitleBar.cpp:442
ads::CDockAreaWidget::setVisible
virtual void setVisible(bool Visible) override
Definition: DockAreaWidget.cpp:866
ads::CDockAreaWidget::allowedAreas
DockWidgetAreas allowedAreas() const
Definition: DockAreaWidget.cpp:884
ads::DockAreaWidgetPrivate::updateTitleBarButtonStates
void updateTitleBarButtonStates()
Definition: DockAreaWidget.cpp:350
ads::CDockAreaTabBar::tabCloseRequested
void tabCloseRequested(int index)
ads::CDockContainerWidget::hasTopLevelDockWidget
bool hasTopLevelDockWidget() const
Definition: DockContainerWidget.cpp:1752
ads::CDockWidget::toggleView
void toggleView(bool Open=true)
Definition: DockWidget.cpp:475
ads::CDockAreaWidget::HideSingleWidgetTitleBar
@ HideSingleWidgetTitleBar
Definition: DockAreaWidget.h:152
ads::CDockAreaWidget::CDockAreaWidget
CDockAreaWidget(CDockManager *DockManager, CDockContainerWidget *parent)
Definition: DockAreaWidget.cpp:368
ads::DockAreaWidgetPrivate::TitleBar
CDockAreaTitleBar * TitleBar
Definition: DockAreaWidget.cpp:250
ads::CDockAreaLayout::isEmpty
bool isEmpty() const
Definition: DockAreaWidget.cpp:206
ads::CDockAreaWidget::setCurrentIndex
void setCurrentIndex(int index)
Definition: DockAreaWidget.cpp:592
ads::ACTION_PROPERTY
static const char *const ACTION_PROPERTY
Definition: DockAreaWidget.cpp:62
ads::DockAreaWidgetPrivate::tabBar
CDockAreaTabBar * tabBar() const
Definition: DockAreaWidget.cpp:303
next
#define next(ls)
Definition: llex.c:32
ads::CDockAreaWidget::dockWidgetsCount
int dockWidgetsCount() const
Definition: DockAreaWidget.cpp:702
ads::CDockWidget::DockWidgetForceCloseWithArea
@ DockWidgetForceCloseWithArea
dock widget will be closed when the dock area hosting it is closed
Definition: DockWidget.h:156
ads::CDockWidgetTab
Definition: DockWidgetTab.h:50
ads::CDockAreaWidget::dockWidget
CDockWidget * dockWidget(int Index) const
Definition: DockAreaWidget.cpp:709
ads::CDockAreaWidget::internalSetCurrentDockWidget
void internalSetCurrentDockWidget(CDockWidget *DockWidget)
Definition: DockAreaWidget.cpp:579
ads::CDockManager::testConfigFlag
static bool testConfigFlag(eConfigFlag Flag)
Definition: DockManager.cpp:1041
ads::CDockAreaLayout::count
int count() const
Definition: DockAreaWidget.cpp:92
ads::CDockAreaWidget::contentAreaGeometry
QRect contentAreaGeometry() const
Definition: DockAreaWidget.cpp:630
ads::CDockAreaLayout::currentWidget
QWidget * currentWidget() const
Definition: DockAreaWidget.cpp:147
ads::DockAreaLayout
CDockAreaLayout DockAreaLayout
Definition: DockAreaWidget.cpp:238
ads::CDockAreaWidget::DefaultFlags
@ DefaultFlags
Definition: DockAreaWidget.h:153
ads::DockAreaWidgetPrivate::_this
CDockAreaWidget * _this
Definition: DockAreaWidget.cpp:247
ads::internal::setFlag
void setFlag(T &Flags, typename T::enum_type flag, bool on=true)
Definition: ads_globals.h:230
ads::CDockContainerWidget::closeOtherAreas
void closeOtherAreas(CDockAreaWidget *KeepOpenArea)
Definition: DockContainerWidget.cpp:1838
ads::CDockAreaWidget::addDockWidget
void addDockWidget(CDockWidget *DockWidget)
Definition: DockAreaWidget.cpp:410
ads::DockAreaWidgetPrivate::updateMinimumSizeHint
void updateMinimumSizeHint()
Definition: DockAreaWidget.cpp:316


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