1
0
mirror of https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git synced 2025-04-01 02:42:39 +08:00

Merge pull request #2 from simulton/feature/remove_debug

Remove debug messages
This commit is contained in:
Joel Bodenmann 2019-06-04 13:39:33 +02:00 committed by GitHub
commit 60a378b93a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 2 additions and 71 deletions

View File

@ -171,7 +171,6 @@ void CDockAreaTabBar::mouseReleaseEvent(QMouseEvent* ev)
{
if (ev->button() == Qt::LeftButton)
{
qDebug() << "CTabsScrollArea::mouseReleaseEvent";
ev->accept();
d->FloatingWidget = nullptr;
d->DragStartMousePos = QPoint();
@ -208,7 +207,6 @@ void CDockAreaTabBar::mouseMoveEvent(QMouseEvent* ev)
int DragDistance = (d->DragStartMousePos - ev->pos()).manhattanLength();
if (DragDistance >= CDockManager::startDragDistance())
{
qDebug() << "CTabsScrollArea::startFloating";
startFloating(d->DragStartMousePos);
auto Overlay = d->DockArea->dockManager()->containerOverlay();
Overlay->setAllowedAreas(OuterDockAreas);
@ -309,7 +307,6 @@ void CDockAreaTabBar::removeTab(CDockWidgetTab* Tab)
{
return;
}
qDebug() << "CDockAreaTabBar::removeTab ";
int NewCurrentIndex = currentIndex();
int RemoveIndex = d->TabsLayout->indexOf(Tab);
if (count() == 1)
@ -352,7 +349,6 @@ void CDockAreaTabBar::removeTab(CDockWidgetTab* Tab)
d->TabsLayout->removeWidget(Tab);
Tab->disconnect(this);
Tab->removeEventFilter(this);
qDebug() << "NewCurrentIndex " << NewCurrentIndex;
if (NewCurrentIndex != d->CurrentIndex)
{
setCurrentIndex(NewCurrentIndex);
@ -480,7 +476,6 @@ void CDockAreaTabBar::onTabWidgetMoved(const QPoint& GlobalPos)
{
if (MousePos.x() > tab(count() - 1)->geometry().right())
{
qDebug() << "after all tabs";
toIndex = count() - 1;
}
else
@ -493,7 +488,6 @@ void CDockAreaTabBar::onTabWidgetMoved(const QPoint& GlobalPos)
d->TabsLayout->insertWidget(toIndex, MovingTab);
if (toIndex >= 0)
{
qDebug() << "tabMoved from " << fromIndex << " to " << toIndex;
emit tabMoved(fromIndex, toIndex);
setCurrentIndex(toIndex);
}

View File

@ -36,7 +36,6 @@
#include <QMenu>
#include <QScrollArea>
#include <QMouseEvent>
#include <QDebug>
#include "ads_globals.h"
#include "FloatingDockContainer.h"
@ -273,7 +272,6 @@ void CDockAreaTitleBar::onTabsMenuAboutToShow()
//============================================================================
void CDockAreaTitleBar::onCloseButtonClicked()
{
qDebug() << "CDockAreaTitleBar::onCloseButtonClicked";
if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
{
d->TabBar->closeTab(d->TabBar->currentIndex());

View File

@ -354,7 +354,6 @@ CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget
//============================================================================
CDockAreaWidget::~CDockAreaWidget()
{
qDebug() << "~CDockAreaWidget()";
delete d->ContentsLayout;
delete d;
}
@ -407,7 +406,6 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
//============================================================================
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
{
qDebug() << "CDockAreaWidget::removeDockWidget";
auto NextOpenDockWidget = nextOpenDockWidget(DockWidget);
d->ContentsLayout->removeWidget(DockWidget);
@ -421,7 +419,6 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
}
else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() > 1)
{
qDebug() << "Dock Area empty";
DockContainer->removeDockArea(this);
this->deleteLater();
}
@ -481,7 +478,6 @@ void CDockAreaWidget::hideAreaWithNoVisibleContent()
//============================================================================
void CDockAreaWidget::onTabCloseRequested(int Index)
{
qDebug() << "CDockAreaWidget::onTabCloseRequested " << Index;
dockWidget(Index)->toggleView(false);
}
@ -644,11 +640,9 @@ CDockWidget* CDockAreaWidget::dockWidget(int Index) const
//============================================================================
void CDockAreaWidget::reorderDockWidget(int fromIndex, int toIndex)
{
qDebug() << "CDockAreaWidget::reorderDockWidget";
if (fromIndex >= d->ContentsLayout->count() || fromIndex < 0
|| toIndex >= d->ContentsLayout->count() || toIndex < 0 || fromIndex == toIndex)
{
qDebug() << "Invalid index for tab movement" << fromIndex << toIndex;
return;
}
@ -703,8 +697,6 @@ void CDockAreaWidget::saveState(QXmlStreamWriter& s) const
auto CurrentDockWidget = currentDockWidget();
QString Name = CurrentDockWidget ? CurrentDockWidget->objectName() : "";
s.writeAttribute("Current", Name);
qDebug() << "CDockAreaWidget::saveState TabCount: " << d->ContentsLayout->count()
<< " Current: " << Name;
for (int i = 0; i < d->ContentsLayout->count(); ++i)
{
dockWidget(i)->saveState(s);

View File

@ -35,9 +35,9 @@
#include <QGridLayout>
#include <QPointer>
#include <QVariant>
#include <QDebug>
#include <QXmlStreamWriter>
#include <QAbstractButton>
#include <QTextStream>
#include "DockManager.h"
#include "DockAreaWidget.h"
@ -557,8 +557,6 @@ void DockContainerWidgetPrivate::saveChildNodesState(QXmlStreamWriter& s, QWidge
s.writeStartElement("Splitter");
s.writeAttribute("Orientation", (Splitter->orientation() == Qt::Horizontal) ? "-" : "|");
s.writeAttribute("Count", QString::number(Splitter->count()));
qDebug() << "NodeSplitter orient: " << Splitter->orientation()
<< " WidgetCont: " << Splitter->count();
for (int i = 0; i < Splitter->count(); ++i)
{
saveChildNodesState(s, Splitter->widget(i));
@ -608,8 +606,6 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s,
{
return false;
}
qDebug() << "Restore NodeSplitter Orientation: " << Orientation <<
" WidgetCount: " << WidgetCount;
QSplitter* Splitter = nullptr;
if (!Testing)
{
@ -632,7 +628,6 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s,
else if (s.name() == "Sizes")
{
QString sSizes = s.readElementText().trimmed();
qDebug() << "Sizes: " << sSizes;
QTextStream TextStream(&sSizes);
while (!TextStream.atEnd())
{
@ -656,8 +651,6 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s,
continue;
}
qDebug() << "ChildNode isVisible " << ChildNode->isVisible()
<< " isVisibleTo " << ChildNode->isVisibleTo(Splitter);
Splitter->addWidget(ChildNode);
Visible |= ChildNode->isVisibleTo(Splitter);
}
@ -703,8 +696,6 @@ bool DockContainerWidgetPrivate::restoreDockArea(QXmlStreamReader& s,
QString CurrentDockWidget = s.attributes().value("Current").toString();
qDebug() << "Restore NodeDockArea Tabs: " << Tabs << " Current: "
<< CurrentDockWidget;
CDockAreaWidget* DockArea = nullptr;
if (!Testing)
@ -738,7 +729,6 @@ bool DockContainerWidgetPrivate::restoreDockArea(QXmlStreamReader& s,
continue;
}
qDebug() << "Dock Widget found - parent " << DockWidget->parent();
// We hide the DockArea here to prevent the short display (the flashing)
// of the dock areas during application startup
DockArea->hide();
@ -780,17 +770,14 @@ bool DockContainerWidgetPrivate::restoreChildNodes(QXmlStreamReader& s,
if (s.name() == "Splitter")
{
Result = restoreSplitter(s, CreatedWidget, Testing);
qDebug() << "Splitter";
}
else if (s.name() == "Area")
{
Result = restoreDockArea(s, CreatedWidget, Testing);
qDebug() << "DockAreaWidget";
}
else
{
s.skipCurrentElement();
qDebug() << "Unknown element";
}
}
@ -883,7 +870,6 @@ void DockContainerWidgetPrivate::dumpRecursive(int level, QWidget* widget)
{
return;
}
qDebug("%sDockArea", (const char*)buf);
std::cout << (const char*)buf
<< (DockArea->isHidden() ? " " : "v")
<< (DockArea->openDockWidgetsCount() > 0 ? " " : "c")
@ -923,12 +909,10 @@ CDockAreaWidget* DockContainerWidgetPrivate::dockWidgetIntoDockArea(DockWidgetAr
int index = TargetAreaSplitter ->indexOf(TargetDockArea);
if (TargetAreaSplitter->orientation() == InsertParam.orientation())
{
qDebug() << "TargetAreaSplitter->orientation() == InsertParam.orientation()";
TargetAreaSplitter->insertWidget(index + InsertParam.insertOffset(), NewDockArea);
}
else
{
qDebug() << "TargetAreaSplitter->orientation() != InsertParam.orientation()";
QSplitter* NewSplitter = newSplitter(InsertParam.orientation());
NewSplitter->addWidget(TargetDockArea);
insertWidgetIntoSplitter(NewSplitter, NewDockArea, InsertParam.append());
@ -1056,7 +1040,6 @@ void CDockContainerWidget::addDockArea(CDockAreaWidget* DockAreaWidget,
//============================================================================
void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
{
qDebug() << "CDockContainerWidget::removeDockArea";
area->disconnect(this);
d->DockAreas.removeAll(area);
CDockSplitter* Splitter = internal::findParent<CDockSplitter*>(area);
@ -1082,7 +1065,6 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
// avoid too many empty splitters
if (Splitter == d->RootSplitter)
{
qDebug() << "Removed from RootSplitter";
// If splitter is empty, we are finished
if (!Splitter->count())
{
@ -1104,11 +1086,9 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
QLayoutItem* li = d->Layout->replaceWidget(Splitter, ChildSplitter);
d->RootSplitter = ChildSplitter;
delete li;
qDebug() << "RootSplitter replaced by child splitter";
}
else if (Splitter->count() == 1)
{
qDebug() << "Replacing splitter with content";
QSplitter* ParentSplitter = internal::findParent<QSplitter*>(Splitter);
auto Sizes = ParentSplitter->sizes();
QWidget* widget = Splitter->widget(0);
@ -1187,7 +1167,6 @@ int CDockContainerWidget::visibleDockAreaCount() const
void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWidget,
const QPoint& TargetPos)
{
qDebug() << "CDockContainerWidget::dropFloatingWidget";
CDockAreaWidget* DockArea = dockAreaAt(TargetPos);
auto dropArea = InvalidDockWidgetArea;
auto ContainerDropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor();
@ -1207,7 +1186,6 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
if (dropArea != InvalidDockWidgetArea)
{
qDebug() << "Dock Area Drop Content: " << dropArea;
d->dropIntoSection(FloatingWidget, DockArea, dropArea);
}
}
@ -1216,7 +1194,6 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
if (InvalidDockWidgetArea == dropArea)
{
dropArea = ContainerDropArea;
qDebug() << "Container Drop Content: " << dropArea;
if (dropArea != InvalidDockWidgetArea)
{
d->dropIntoContainer(FloatingWidget, dropArea);
@ -1258,9 +1235,6 @@ QList<CDockAreaWidget*> CDockContainerWidget::openedDockAreas() const
//============================================================================
void CDockContainerWidget::saveState(QXmlStreamWriter& s) const
{
qDebug() << "CDockContainerWidget::saveState isFloating "
<< isFloating();
s.writeStartElement("Container");
s.writeAttribute("Floating", QString::number(isFloating() ? 1 : 0));
if (isFloating())
@ -1282,7 +1256,6 @@ void CDockContainerWidget::saveState(QXmlStreamWriter& s) const
bool CDockContainerWidget::restoreState(QXmlStreamReader& s, bool Testing)
{
bool IsFloating = s.attributes().value("Floating").toInt();
qDebug() << "Restore CDockContainerWidget Floating" << IsFloating;
QWidget*NewRootSplitter {};
if (!Testing)
@ -1294,7 +1267,6 @@ bool CDockContainerWidget::restoreState(QXmlStreamReader& s, bool Testing)
if (IsFloating)
{
qDebug() << "Restore floating widget";
if (!s.readNextStartElement() || s.name() != "Geometry")
{
return false;

View File

@ -38,7 +38,6 @@
#include <QList>
#include <QMap>
#include <QVariant>
#include <QDebug>
#include <QFile>
#include <QAction>
#include <QXmlStreamWriter>
@ -46,6 +45,7 @@
#include <QSettings>
#include <QMenu>
#include <QApplication>
#include <QTextStream>
#include "FloatingDockContainer.h"
#include "DockOverlay.h"
@ -170,7 +170,6 @@ bool DockManagerPrivate::restoreContainer(int Index, QXmlStreamReader& stream, b
}
else
{
qDebug() << "d->Containers[i]->restoreState ";
auto Container = Containers[Index];
if (Container->isFloating())
{
@ -207,7 +206,6 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi
{
return false;
}
qDebug() << s.attributes().value("Version");
bool ok;
int v = s.attributes().value("Version").toInt(&ok);
if (!ok || v != version)
@ -217,7 +215,6 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi
bool Result = true;
int DockContainers = s.attributes().value("Containers").toInt();
qDebug() << DockContainers;
int DockContainerCount = 0;
while (s.readNextStartElement())
{
@ -340,7 +337,6 @@ bool DockManagerPrivate::restoreState(const QByteArray &state, int version)
{
if (!checkFormat(state, version))
{
qDebug() << "checkFormat: Error checking format!!!!!!!";
return false;
}
@ -350,7 +346,6 @@ bool DockManagerPrivate::restoreState(const QByteArray &state, int version)
if (!restoreStateFromXml(state, version))
{
qDebug() << "restoreState: Error restoring state!!!!!!!";
return false;
}
@ -425,7 +420,6 @@ CDockManager::~CDockManager()
void CDockManager::registerFloatingWidget(CFloatingDockContainer* FloatingWidget)
{
d->FloatingWidgets.append(FloatingWidget);
qDebug() << "d->FloatingWidgets.count() " << d->FloatingWidgets.count();
}

View File

@ -32,7 +32,6 @@
#include <QIcon>
#include <QLabel>
#include <QtGlobal>
#include <QDebug>
#include <QMap>
#include <QWindow>

View File

@ -68,7 +68,6 @@ CDockSplitter::CDockSplitter(Qt::Orientation orientation, QWidget *parent)
//============================================================================
CDockSplitter::~CDockSplitter()
{
qDebug() << "~CDockSplitter";
delete d;
}

View File

@ -39,7 +39,6 @@
#include <QTextStream>
#include <QPointer>
#include <QEvent>
#include <QDebug>
#include <QToolBar>
#include <QXmlStreamWriter>
@ -224,7 +223,6 @@ CDockWidget::CDockWidget(const QString &title, QWidget *parent) :
//============================================================================
CDockWidget::~CDockWidget()
{
qDebug() << "~CDockWidget()";
delete d;
}

View File

@ -37,7 +37,6 @@
#include <QStyle>
#include <QApplication>
#include <QSplitter>
#include <QDebug>
#include <QToolButton>
#include <QPushButton>
#include <QMenu>
@ -192,9 +191,6 @@ void DockWidgetTabPrivate::moveTab(QMouseEvent* ev)
bool DockWidgetTabPrivate::startFloating(eDragState DraggingState)
{
auto dockContainer = DockWidget->dockContainer();
qDebug() << "isFloating " << dockContainer->isFloating();
qDebug() << "areaCount " << dockContainer->dockAreaCount();
qDebug() << "widgetCount " << DockWidget->dockAreaWidget()->dockWidgetsCount();
// if this is the last dock widget inside of this floating widget,
// then it does not make any sense, to make it floating because
// it is already floating
@ -205,7 +201,6 @@ bool DockWidgetTabPrivate::startFloating(eDragState DraggingState)
return false;
}
qDebug() << "startFloating";
DragState = DraggingState;
QSize Size = DockArea->size();
CFloatingDockContainer* FloatingWidget = nullptr;
@ -250,7 +245,6 @@ CDockWidgetTab::CDockWidgetTab(CDockWidget* DockWidget, QWidget *parent) :
//============================================================================
CDockWidgetTab::~CDockWidgetTab()
{
qDebug() << "~CDockWidgetTab()";
delete d;
}

View File

@ -257,7 +257,6 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget* DockWidget) :
//============================================================================
CFloatingDockContainer::~CFloatingDockContainer()
{
qDebug() << "~CFloatingDockContainer";
if (d->DockManager)
{
d->DockManager->removeFloatingWidget(this);
@ -279,7 +278,6 @@ void CFloatingDockContainer::changeEvent(QEvent *event)
QWidget::changeEvent(event);
if ((event->type() == QEvent::ActivationChange) && isActiveWindow())
{
qDebug() << "FloatingWidget::changeEvent QEvent::ActivationChange ";
d->zOrderIndex = ++zOrderCounter;
return;
}
@ -309,7 +307,6 @@ void CFloatingDockContainer::moveEvent(QMoveEvent *event)
//============================================================================
void CFloatingDockContainer::closeEvent(QCloseEvent *event)
{
qDebug() << "CFloatingDockContainer closeEvent";
d->setState(DraggingInactive);
if (isClosable())
@ -375,13 +372,11 @@ bool CFloatingDockContainer::event(QEvent *e)
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 2))
if (e->type() == QEvent::NonClientAreaMouseButtonPress /*&& QGuiApplication::mouseButtons().testFlag(Qt::LeftButton)*/)
{
qDebug() << "FloatingWidget::event Event::NonClientAreaMouseButtonPress" << e->type();
d->setState(DraggingMousePressed);
}
#else
if (e->type() == QEvent::NonClientAreaMouseButtonPress && QGuiApplication::mouseButtons().testFlag(Qt::LeftButton))
{
qDebug() << "FloatingWidget::event Event::NonClientAreaMouseButtonPress" << e->type();
d->setState(DraggingMousePressed);
}
#endif
@ -392,7 +387,6 @@ bool CFloatingDockContainer::event(QEvent *e)
switch (e->type())
{
case QEvent::NonClientAreaMouseButtonDblClick:
qDebug() << "FloatingWidget::event QEvent::NonClientAreaMouseButtonDblClick";
d->setState(DraggingInactive);
break;
@ -419,7 +413,6 @@ bool CFloatingDockContainer::event(QEvent *e)
case DraggingFloatingWidget:
if (e->type() == QEvent::NonClientAreaMouseButtonRelease)
{
qDebug() << "FloatingWidget::event QEvent::NonClientAreaMouseButtonRelease";
d->titleMouseReleaseEvent();
}
break;
@ -441,7 +434,6 @@ bool CFloatingDockContainer::eventFilter(QObject *watched, QEvent *event)
Q_UNUSED(watched);
if (event->type() == QEvent::MouseButtonRelease && d->isState(DraggingFloatingWidget))
{
qDebug() << "FloatingWidget::eventFilter QEvent::MouseButtonRelease";
d->titleMouseReleaseEvent();
}
@ -481,7 +473,6 @@ bool CFloatingDockContainer::isClosable() const
//============================================================================
void CFloatingDockContainer::onDockAreasAddedOrRemoved()
{
qDebug() << "CFloatingDockContainer::onDockAreasAddedOrRemoved()";
auto TopLevelDockArea = d->DockContainer->topLevelDockArea();
if (TopLevelDockArea)
{