mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Merge pull request #41 from kozodeevv/Conditional_prints
Make debug messages conditional.
This commit is contained in:
commit
554f26a614
@ -171,7 +171,7 @@ void CDockAreaTabBar::mouseReleaseEvent(QMouseEvent* ev)
|
||||
{
|
||||
if (ev->button() == Qt::LeftButton)
|
||||
{
|
||||
qDebug() << "CTabsScrollArea::mouseReleaseEvent";
|
||||
ADS_PRINT("CTabsScrollArea::mouseReleaseEvent");
|
||||
ev->accept();
|
||||
d->FloatingWidget = nullptr;
|
||||
d->DragStartMousePos = QPoint();
|
||||
@ -215,7 +215,7 @@ void CDockAreaTabBar::mouseMoveEvent(QMouseEvent* ev)
|
||||
int DragDistance = (d->DragStartMousePos - ev->pos()).manhattanLength();
|
||||
if (DragDistance >= CDockManager::startDragDistance())
|
||||
{
|
||||
qDebug() << "CTabsScrollArea::startFloating";
|
||||
ADS_PRINT("CTabsScrollArea::startFloating");
|
||||
startFloating(d->DragStartMousePos);
|
||||
auto Overlay = d->DockArea->dockManager()->containerOverlay();
|
||||
Overlay->setAllowedAreas(OuterDockAreas);
|
||||
@ -321,7 +321,7 @@ void CDockAreaTabBar::removeTab(CDockWidgetTab* Tab)
|
||||
{
|
||||
return;
|
||||
}
|
||||
qDebug() << "CDockAreaTabBar::removeTab ";
|
||||
ADS_PRINT("CDockAreaTabBar::removeTab ");
|
||||
int NewCurrentIndex = currentIndex();
|
||||
int RemoveIndex = d->TabsLayout->indexOf(Tab);
|
||||
if (count() == 1)
|
||||
@ -364,7 +364,7 @@ void CDockAreaTabBar::removeTab(CDockWidgetTab* Tab)
|
||||
d->TabsLayout->removeWidget(Tab);
|
||||
Tab->disconnect(this);
|
||||
Tab->removeEventFilter(this);
|
||||
qDebug() << "NewCurrentIndex " << NewCurrentIndex;
|
||||
ADS_PRINT("NewCurrentIndex " << NewCurrentIndex);
|
||||
if (NewCurrentIndex != d->CurrentIndex)
|
||||
{
|
||||
setCurrentIndex(NewCurrentIndex);
|
||||
@ -492,7 +492,7 @@ void CDockAreaTabBar::onTabWidgetMoved(const QPoint& GlobalPos)
|
||||
{
|
||||
if (MousePos.x() > tab(count() - 1)->geometry().right())
|
||||
{
|
||||
qDebug() << "after all tabs";
|
||||
ADS_PRINT("after all tabs");
|
||||
toIndex = count() - 1;
|
||||
}
|
||||
else
|
||||
@ -505,7 +505,7 @@ void CDockAreaTabBar::onTabWidgetMoved(const QPoint& GlobalPos)
|
||||
d->TabsLayout->insertWidget(toIndex, MovingTab);
|
||||
if (toIndex >= 0)
|
||||
{
|
||||
qDebug() << "tabMoved from " << fromIndex << " to " << toIndex;
|
||||
ADS_PRINT("tabMoved from " << fromIndex << " to " << toIndex);
|
||||
emit tabMoved(fromIndex, toIndex);
|
||||
setCurrentIndex(toIndex);
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ void CDockAreaTitleBar::onTabsMenuAboutToShow()
|
||||
//============================================================================
|
||||
void CDockAreaTitleBar::onCloseButtonClicked()
|
||||
{
|
||||
qDebug() << "CDockAreaTitleBar::onCloseButtonClicked";
|
||||
ADS_PRINT("CDockAreaTitleBar::onCloseButtonClicked");
|
||||
if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
|
||||
{
|
||||
d->TabBar->closeTab(d->TabBar->currentIndex());
|
||||
|
@ -356,7 +356,7 @@ CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget
|
||||
//============================================================================
|
||||
CDockAreaWidget::~CDockAreaWidget()
|
||||
{
|
||||
qDebug() << "~CDockAreaWidget()";
|
||||
ADS_PRINT("~CDockAreaWidget()");
|
||||
delete d->ContentsLayout;
|
||||
delete d;
|
||||
}
|
||||
@ -409,7 +409,7 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
|
||||
//============================================================================
|
||||
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
||||
{
|
||||
qDebug() << "CDockAreaWidget::removeDockWidget";
|
||||
ADS_PRINT("CDockAreaWidget::removeDockWidget");
|
||||
auto NextOpenDockWidget = nextOpenDockWidget(DockWidget);
|
||||
|
||||
d->ContentsLayout->removeWidget(DockWidget);
|
||||
@ -423,7 +423,7 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
||||
}
|
||||
else if (d->ContentsLayout->isEmpty() && DockContainer->dockAreaCount() > 1)
|
||||
{
|
||||
qDebug() << "Dock Area empty";
|
||||
ADS_PRINT("Dock Area empty");
|
||||
DockContainer->removeDockArea(this);
|
||||
this->deleteLater();
|
||||
}
|
||||
@ -483,7 +483,7 @@ void CDockAreaWidget::hideAreaWithNoVisibleContent()
|
||||
//============================================================================
|
||||
void CDockAreaWidget::onTabCloseRequested(int Index)
|
||||
{
|
||||
qDebug() << "CDockAreaWidget::onTabCloseRequested " << Index;
|
||||
ADS_PRINT("CDockAreaWidget::onTabCloseRequested " << Index);
|
||||
dockWidget(Index)->toggleView(false);
|
||||
}
|
||||
|
||||
@ -646,11 +646,11 @@ CDockWidget* CDockAreaWidget::dockWidget(int Index) const
|
||||
//============================================================================
|
||||
void CDockAreaWidget::reorderDockWidget(int fromIndex, int toIndex)
|
||||
{
|
||||
qDebug() << "CDockAreaWidget::reorderDockWidget";
|
||||
ADS_PRINT("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;
|
||||
ADS_PRINT("Invalid index for tab movement" << fromIndex << toIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -705,8 +705,8 @@ 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;
|
||||
ADS_PRINT("CDockAreaWidget::saveState TabCount: " << d->ContentsLayout->count()
|
||||
<< " Current: " << Name);
|
||||
for (int i = 0; i < d->ContentsLayout->count(); ++i)
|
||||
{
|
||||
dockWidget(i)->saveState(s);
|
||||
|
@ -557,8 +557,8 @@ 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();
|
||||
ADS_PRINT("NodeSplitter orient: " << Splitter->orientation()
|
||||
<< " WidgetCont: " << Splitter->count());
|
||||
for (int i = 0; i < Splitter->count(); ++i)
|
||||
{
|
||||
saveChildNodesState(s, Splitter->widget(i));
|
||||
@ -608,8 +608,8 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s,
|
||||
{
|
||||
return false;
|
||||
}
|
||||
qDebug() << "Restore NodeSplitter Orientation: " << Orientation <<
|
||||
" WidgetCount: " << WidgetCount;
|
||||
ADS_PRINT("Restore NodeSplitter Orientation: " << Orientation <<
|
||||
" WidgetCount: " << WidgetCount);
|
||||
QSplitter* Splitter = nullptr;
|
||||
if (!Testing)
|
||||
{
|
||||
@ -632,7 +632,7 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s,
|
||||
else if (s.name() == "Sizes")
|
||||
{
|
||||
QString sSizes = s.readElementText().trimmed();
|
||||
qDebug() << "Sizes: " << sSizes;
|
||||
ADS_PRINT("Sizes: " << sSizes);
|
||||
QTextStream TextStream(&sSizes);
|
||||
while (!TextStream.atEnd())
|
||||
{
|
||||
@ -656,8 +656,8 @@ bool DockContainerWidgetPrivate::restoreSplitter(QXmlStreamReader& s,
|
||||
continue;
|
||||
}
|
||||
|
||||
qDebug() << "ChildNode isVisible " << ChildNode->isVisible()
|
||||
<< " isVisibleTo " << ChildNode->isVisibleTo(Splitter);
|
||||
ADS_PRINT("ChildNode isVisible " << ChildNode->isVisible()
|
||||
<< " isVisibleTo " << ChildNode->isVisibleTo(Splitter));
|
||||
Splitter->addWidget(ChildNode);
|
||||
Visible |= ChildNode->isVisibleTo(Splitter);
|
||||
}
|
||||
@ -703,8 +703,8 @@ bool DockContainerWidgetPrivate::restoreDockArea(QXmlStreamReader& s,
|
||||
|
||||
|
||||
QString CurrentDockWidget = s.attributes().value("Current").toString();
|
||||
qDebug() << "Restore NodeDockArea Tabs: " << Tabs << " Current: "
|
||||
<< CurrentDockWidget;
|
||||
ADS_PRINT("Restore NodeDockArea Tabs: " << Tabs << " Current: "
|
||||
<< CurrentDockWidget);
|
||||
|
||||
CDockAreaWidget* DockArea = nullptr;
|
||||
if (!Testing)
|
||||
@ -738,7 +738,7 @@ bool DockContainerWidgetPrivate::restoreDockArea(QXmlStreamReader& s,
|
||||
continue;
|
||||
}
|
||||
|
||||
qDebug() << "Dock Widget found - parent " << DockWidget->parent();
|
||||
ADS_PRINT("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 +780,17 @@ bool DockContainerWidgetPrivate::restoreChildNodes(QXmlStreamReader& s,
|
||||
if (s.name() == "Splitter")
|
||||
{
|
||||
Result = restoreSplitter(s, CreatedWidget, Testing);
|
||||
qDebug() << "Splitter";
|
||||
ADS_PRINT("Splitter");
|
||||
}
|
||||
else if (s.name() == "Area")
|
||||
{
|
||||
Result = restoreDockArea(s, CreatedWidget, Testing);
|
||||
qDebug() << "DockAreaWidget";
|
||||
ADS_PRINT("DockAreaWidget");
|
||||
}
|
||||
else
|
||||
{
|
||||
s.skipCurrentElement();
|
||||
qDebug() << "Unknown element";
|
||||
ADS_PRINT("Unknown element");
|
||||
}
|
||||
}
|
||||
|
||||
@ -862,15 +862,17 @@ void DockContainerWidgetPrivate::dumpRecursive(int level, QWidget* widget)
|
||||
buf.fill(' ', level * 4);
|
||||
if (Splitter)
|
||||
{
|
||||
#ifdef ADS_DEBUG_PRINT
|
||||
qDebug("%sSplitter %s v: %s c: %s",
|
||||
(const char*)buf,
|
||||
(Splitter->orientation() == Qt::Vertical) ? "--" : "|",
|
||||
Splitter->isHidden() ? " " : "v",
|
||||
QString::number(Splitter->count()).toStdString().c_str());
|
||||
std::cout << (const char*)buf << "Splitter "
|
||||
<< ((Splitter->orientation() == Qt::Vertical) ? "--" : "|") << " "
|
||||
<< (Splitter->isHidden() ? " " : "v") << " "
|
||||
<< QString::number(Splitter->count()).toStdString() << std::endl;
|
||||
std::cout << (const char*)buf << "Splitter "
|
||||
<< ((Splitter->orientation() == Qt::Vertical) ? "--" : "|") << " "
|
||||
<< (Splitter->isHidden() ? " " : "v") << " "
|
||||
<< QString::number(Splitter->count()).toStdString() << std::endl;
|
||||
#endif
|
||||
for (int i = 0; i < Splitter->count(); ++i)
|
||||
{
|
||||
dumpRecursive(level + 1, Splitter->widget(i));
|
||||
@ -883,6 +885,7 @@ void DockContainerWidgetPrivate::dumpRecursive(int level, QWidget* widget)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#ifdef ADS_DEBUG_PRINT
|
||||
qDebug("%sDockArea", (const char*)buf);
|
||||
std::cout << (const char*)buf
|
||||
<< (DockArea->isHidden() ? " " : "v")
|
||||
@ -896,7 +899,8 @@ void DockContainerWidgetPrivate::dumpRecursive(int level, QWidget* widget)
|
||||
std::cout << (DockWidget->isHidden() ? " " : "v");
|
||||
std::cout << (DockWidget->isClosed() ? "c" : " ") << " ";
|
||||
std::cout << DockWidget->windowTitle().toStdString() << std::endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(level);
|
||||
@ -923,12 +927,12 @@ CDockAreaWidget* DockContainerWidgetPrivate::dockWidgetIntoDockArea(DockWidgetAr
|
||||
int index = TargetAreaSplitter ->indexOf(TargetDockArea);
|
||||
if (TargetAreaSplitter->orientation() == InsertParam.orientation())
|
||||
{
|
||||
qDebug() << "TargetAreaSplitter->orientation() == InsertParam.orientation()";
|
||||
ADS_PRINT("TargetAreaSplitter->orientation() == InsertParam.orientation()");
|
||||
TargetAreaSplitter->insertWidget(index + InsertParam.insertOffset(), NewDockArea);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "TargetAreaSplitter->orientation() != InsertParam.orientation()";
|
||||
ADS_PRINT("TargetAreaSplitter->orientation() != InsertParam.orientation()");
|
||||
QSplitter* NewSplitter = newSplitter(InsertParam.orientation());
|
||||
NewSplitter->addWidget(TargetDockArea);
|
||||
insertWidgetIntoSplitter(NewSplitter, NewDockArea, InsertParam.append());
|
||||
@ -1056,7 +1060,7 @@ void CDockContainerWidget::addDockArea(CDockAreaWidget* DockAreaWidget,
|
||||
//============================================================================
|
||||
void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
{
|
||||
qDebug() << "CDockContainerWidget::removeDockArea";
|
||||
ADS_PRINT("CDockContainerWidget::removeDockArea");
|
||||
area->disconnect(this);
|
||||
d->DockAreas.removeAll(area);
|
||||
CDockSplitter* Splitter = internal::findParent<CDockSplitter*>(area);
|
||||
@ -1082,7 +1086,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
// avoid too many empty splitters
|
||||
if (Splitter == d->RootSplitter)
|
||||
{
|
||||
qDebug() << "Removed from RootSplitter";
|
||||
ADS_PRINT("Removed from RootSplitter");
|
||||
// If splitter is empty, we are finished
|
||||
if (!Splitter->count())
|
||||
{
|
||||
@ -1104,11 +1108,11 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
QLayoutItem* li = d->Layout->replaceWidget(Splitter, ChildSplitter);
|
||||
d->RootSplitter = ChildSplitter;
|
||||
delete li;
|
||||
qDebug() << "RootSplitter replaced by child splitter";
|
||||
ADS_PRINT("RootSplitter replaced by child splitter");
|
||||
}
|
||||
else if (Splitter->count() == 1)
|
||||
{
|
||||
qDebug() << "Replacing splitter with content";
|
||||
ADS_PRINT("Replacing splitter with content");
|
||||
QSplitter* ParentSplitter = internal::findParent<QSplitter*>(Splitter);
|
||||
auto Sizes = ParentSplitter->sizes();
|
||||
QWidget* widget = Splitter->widget(0);
|
||||
@ -1187,7 +1191,7 @@ int CDockContainerWidget::visibleDockAreaCount() const
|
||||
void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWidget,
|
||||
const QPoint& TargetPos)
|
||||
{
|
||||
qDebug() << "CDockContainerWidget::dropFloatingWidget";
|
||||
ADS_PRINT("CDockContainerWidget::dropFloatingWidget");
|
||||
CDockAreaWidget* DockArea = dockAreaAt(TargetPos);
|
||||
auto dropArea = InvalidDockWidgetArea;
|
||||
auto ContainerDropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor();
|
||||
@ -1207,7 +1211,7 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
|
||||
if (dropArea != InvalidDockWidgetArea)
|
||||
{
|
||||
qDebug() << "Dock Area Drop Content: " << dropArea;
|
||||
ADS_PRINT("Dock Area Drop Content: " << dropArea);
|
||||
d->dropIntoSection(FloatingWidget, DockArea, dropArea);
|
||||
}
|
||||
}
|
||||
@ -1216,7 +1220,7 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
if (InvalidDockWidgetArea == dropArea)
|
||||
{
|
||||
dropArea = ContainerDropArea;
|
||||
qDebug() << "Container Drop Content: " << dropArea;
|
||||
ADS_PRINT("Container Drop Content: " << dropArea);
|
||||
if (dropArea != InvalidDockWidgetArea)
|
||||
{
|
||||
d->dropIntoContainer(FloatingWidget, dropArea);
|
||||
@ -1258,8 +1262,8 @@ QList<CDockAreaWidget*> CDockContainerWidget::openedDockAreas() const
|
||||
//============================================================================
|
||||
void CDockContainerWidget::saveState(QXmlStreamWriter& s) const
|
||||
{
|
||||
qDebug() << "CDockContainerWidget::saveState isFloating "
|
||||
<< isFloating();
|
||||
ADS_PRINT("CDockContainerWidget::saveState isFloating "
|
||||
<< isFloating());
|
||||
|
||||
s.writeStartElement("Container");
|
||||
s.writeAttribute("Floating", QString::number(isFloating() ? 1 : 0));
|
||||
@ -1282,7 +1286,7 @@ 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;
|
||||
ADS_PRINT("Restore CDockContainerWidget Floating" << IsFloating);
|
||||
|
||||
QWidget*NewRootSplitter {};
|
||||
if (!Testing)
|
||||
@ -1294,7 +1298,7 @@ bool CDockContainerWidget::restoreState(QXmlStreamReader& s, bool Testing)
|
||||
|
||||
if (IsFloating)
|
||||
{
|
||||
qDebug() << "Restore floating widget";
|
||||
ADS_PRINT("Restore floating widget");
|
||||
if (!s.readNextStartElement() || s.name() != "Geometry")
|
||||
{
|
||||
return false;
|
||||
|
@ -174,7 +174,7 @@ bool DockManagerPrivate::restoreContainer(int Index, QXmlStreamReader& stream, b
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "d->Containers[i]->restoreState ";
|
||||
ADS_PRINT("d->Containers[i]->restoreState ");
|
||||
auto Container = Containers[Index];
|
||||
if (Container->isFloating())
|
||||
{
|
||||
@ -211,7 +211,7 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi
|
||||
{
|
||||
return false;
|
||||
}
|
||||
qDebug() << s.attributes().value("Version");
|
||||
ADS_PRINT(s.attributes().value("Version"));
|
||||
bool ok;
|
||||
int v = s.attributes().value("Version").toInt(&ok);
|
||||
if (!ok || v != version)
|
||||
@ -221,7 +221,7 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi
|
||||
|
||||
bool Result = true;
|
||||
int DockContainers = s.attributes().value("Containers").toInt();
|
||||
qDebug() << DockContainers;
|
||||
ADS_PRINT(DockContainers);
|
||||
int DockContainerCount = 0;
|
||||
while (s.readNextStartElement())
|
||||
{
|
||||
@ -345,7 +345,7 @@ bool DockManagerPrivate::restoreState(const QByteArray& State, int version)
|
||||
QByteArray state = State.startsWith("<?xml") ? State : qUncompress(State);
|
||||
if (!checkFormat(state, version))
|
||||
{
|
||||
qDebug() << "checkFormat: Error checking format!!!!!!!";
|
||||
ADS_PRINT("checkFormat: Error checking format!!!!!!!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -355,7 +355,7 @@ bool DockManagerPrivate::restoreState(const QByteArray& State, int version)
|
||||
|
||||
if (!restoreStateFromXml(state, version))
|
||||
{
|
||||
qDebug() << "restoreState: Error restoring state!!!!!!!";
|
||||
ADS_PRINT("restoreState: Error restoring state!!!!!!!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -430,7 +430,7 @@ CDockManager::~CDockManager()
|
||||
void CDockManager::registerFloatingWidget(CFloatingDockContainer* FloatingWidget)
|
||||
{
|
||||
d->FloatingWidgets.append(FloatingWidget);
|
||||
qDebug() << "d->FloatingWidgets.count() " << d->FloatingWidgets.count();
|
||||
ADS_PRINT("d->FloatingWidgets.count() " << d->FloatingWidgets.count());
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,7 +68,7 @@ CDockSplitter::CDockSplitter(Qt::Orientation orientation, QWidget *parent)
|
||||
//============================================================================
|
||||
CDockSplitter::~CDockSplitter()
|
||||
{
|
||||
qDebug() << "~CDockSplitter";
|
||||
ADS_PRINT("~CDockSplitter");
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ CDockWidget::CDockWidget(const QString &title, QWidget *parent) :
|
||||
//============================================================================
|
||||
CDockWidget::~CDockWidget()
|
||||
{
|
||||
qDebug() << "~CDockWidget()";
|
||||
ADS_PRINT("~CDockWidget()");
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
@ -193,9 +193,9 @@ 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();
|
||||
ADS_PRINT("isFloating " << dockContainer->isFloating());
|
||||
ADS_PRINT("areaCount " << dockContainer->dockAreaCount());
|
||||
ADS_PRINT("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
|
||||
@ -206,7 +206,7 @@ bool DockWidgetTabPrivate::startFloating(eDragState DraggingState)
|
||||
return false;
|
||||
}
|
||||
|
||||
qDebug() << "startFloating";
|
||||
ADS_PRINT("startFloating");
|
||||
DragState = DraggingState;
|
||||
QSize Size = DockArea->size();
|
||||
CFloatingDockContainer* FloatingWidget = nullptr;
|
||||
@ -251,7 +251,7 @@ CDockWidgetTab::CDockWidgetTab(CDockWidget* DockWidget, QWidget *parent) :
|
||||
//============================================================================
|
||||
CDockWidgetTab::~CDockWidgetTab()
|
||||
{
|
||||
qDebug() << "~CDockWidgetTab()";
|
||||
ADS_PRINT("~CDockWidgetTab()");
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget* DockWidget) :
|
||||
//============================================================================
|
||||
CFloatingDockContainer::~CFloatingDockContainer()
|
||||
{
|
||||
qDebug() << "~CFloatingDockContainer";
|
||||
ADS_PRINT("~CFloatingDockContainer");
|
||||
if (d->DockManager)
|
||||
{
|
||||
d->DockManager->removeFloatingWidget(this);
|
||||
@ -314,7 +314,7 @@ void CFloatingDockContainer::changeEvent(QEvent *event)
|
||||
QWidget::changeEvent(event);
|
||||
if ((event->type() == QEvent::ActivationChange) && isActiveWindow())
|
||||
{
|
||||
qDebug() << "FloatingWidget::changeEvent QEvent::ActivationChange ";
|
||||
ADS_PRINT("FloatingWidget::changeEvent QEvent::ActivationChange ");
|
||||
d->zOrderIndex = ++zOrderCounter;
|
||||
return;
|
||||
}
|
||||
@ -344,7 +344,7 @@ void CFloatingDockContainer::moveEvent(QMoveEvent *event)
|
||||
//============================================================================
|
||||
void CFloatingDockContainer::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
qDebug() << "CFloatingDockContainer closeEvent";
|
||||
ADS_PRINT("CFloatingDockContainer closeEvent");
|
||||
d->setState(DraggingInactive);
|
||||
|
||||
if (isClosable())
|
||||
@ -414,13 +414,13 @@ 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();
|
||||
ADS_PRINT("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();
|
||||
ADS_PRINT("FloatingWidget::event Event::NonClientAreaMouseButtonPress" << e->type());
|
||||
d->setState(DraggingMousePressed);
|
||||
}
|
||||
#endif
|
||||
@ -431,7 +431,7 @@ bool CFloatingDockContainer::event(QEvent *e)
|
||||
switch (e->type())
|
||||
{
|
||||
case QEvent::NonClientAreaMouseButtonDblClick:
|
||||
qDebug() << "FloatingWidget::event QEvent::NonClientAreaMouseButtonDblClick";
|
||||
ADS_PRINT("FloatingWidget::event QEvent::NonClientAreaMouseButtonDblClick");
|
||||
d->setState(DraggingInactive);
|
||||
break;
|
||||
|
||||
@ -458,7 +458,7 @@ bool CFloatingDockContainer::event(QEvent *e)
|
||||
case DraggingFloatingWidget:
|
||||
if (e->type() == QEvent::NonClientAreaMouseButtonRelease)
|
||||
{
|
||||
qDebug() << "FloatingWidget::event QEvent::NonClientAreaMouseButtonRelease";
|
||||
ADS_PRINT("FloatingWidget::event QEvent::NonClientAreaMouseButtonRelease");
|
||||
d->titleMouseReleaseEvent();
|
||||
}
|
||||
break;
|
||||
@ -480,7 +480,7 @@ bool CFloatingDockContainer::eventFilter(QObject *watched, QEvent *event)
|
||||
Q_UNUSED(watched);
|
||||
if (event->type() == QEvent::MouseButtonRelease && d->isState(DraggingFloatingWidget))
|
||||
{
|
||||
qDebug() << "FloatingWidget::eventFilter QEvent::MouseButtonRelease";
|
||||
ADS_PRINT("FloatingWidget::eventFilter QEvent::MouseButtonRelease");
|
||||
finishDragging();
|
||||
d->titleMouseReleaseEvent();
|
||||
}
|
||||
@ -536,7 +536,7 @@ bool CFloatingDockContainer::isClosable() const
|
||||
//============================================================================
|
||||
void CFloatingDockContainer::onDockAreasAddedOrRemoved()
|
||||
{
|
||||
qDebug() << "CFloatingDockContainer::onDockAreasAddedOrRemoved()";
|
||||
ADS_PRINT("CFloatingDockContainer::onDockAreasAddedOrRemoved()");
|
||||
auto TopLevelDockArea = d->DockContainer->topLevelDockArea();
|
||||
if (TopLevelDockArea)
|
||||
{
|
||||
@ -619,7 +619,7 @@ QList<CDockWidget*> CFloatingDockContainer::dockWidgets() const
|
||||
//============================================================================
|
||||
void CFloatingDockContainer::finishDragging()
|
||||
{
|
||||
qDebug() << "CFloatingDockContainer::finishDragging";
|
||||
ADS_PRINT("CFloatingDockContainer::finishDragging");
|
||||
#ifdef Q_OS_LINUX
|
||||
setAttribute(Qt::WA_X11NetWmWindowTypeDock, false);
|
||||
setWindowOpacity(1);
|
||||
|
@ -45,6 +45,12 @@
|
||||
#define ADS_EXPORT
|
||||
#endif
|
||||
|
||||
#ifdef ADS_DEBUG_PRINT
|
||||
#define ADS_PRINT(s) qDebug() << s
|
||||
#else
|
||||
#define ADS_PRINT(s)
|
||||
#endif
|
||||
|
||||
#define ADS_DEBUG_LEVEL 0
|
||||
|
||||
class QSplitter;
|
||||
|
Loading…
Reference in New Issue
Block a user