mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-12 16:20:25 +08:00
Replaced std:cout based debug output with qDebug()
This commit is contained in:
parent
aa8a52b845
commit
9af86c4136
@ -1 +0,0 @@
|
||||
theme: jekyll-theme-midnight
|
@ -1,6 +1,7 @@
|
||||
#include <QString>
|
||||
#include <QFile>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
@ -15,11 +16,39 @@ static void initStyleSheet(QApplication& a)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||
{
|
||||
QByteArray localMsg = msg.toLocal8Bit();
|
||||
switch (type) {
|
||||
case QtDebugMsg:
|
||||
fprintf(stdout, "Debug: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||
break;
|
||||
case QtInfoMsg:
|
||||
fprintf(stdout, "Info: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||
break;
|
||||
case QtWarningMsg:
|
||||
fprintf(stderr, "Warning: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||
break;
|
||||
case QtCriticalMsg:
|
||||
fprintf(stderr, "Critical: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||
break;
|
||||
case QtFatalMsg:
|
||||
fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||
abort();
|
||||
}
|
||||
|
||||
fflush(stderr);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
a.setQuitOnLastWindowClosed(true);
|
||||
initStyleSheet(a);
|
||||
qInstallMessageHandler(myMessageOutput);
|
||||
qDebug() << "Message handler test";
|
||||
|
||||
MainWindow mw;
|
||||
mw.show();
|
||||
|
@ -24,21 +24,25 @@
|
||||
|
||||
static int CONTENT_COUNT = 0;
|
||||
|
||||
|
||||
static ads::CDockWidget* createLongTextLabelDockWidget(QMenu* ViewMenu)
|
||||
{
|
||||
static int LabelCount = 0;
|
||||
QLabel* l = new QLabel();
|
||||
l->setWordWrap(true);
|
||||
l->setAlignment(Qt::AlignTop | Qt::AlignLeft);
|
||||
l->setText(QString("Label %1 %2 - Lorem Ipsum ist ein einfacher Demo-Text für die Print- "
|
||||
"und Schriftindustrie. Lorem Ipsum ist in der Industrie bereits der "
|
||||
"Standard Demo-Text seit 1500, als ein unbekannter Schriftsteller eine "
|
||||
"Hand voll Wörter nahm und diese durcheinander warf um ein Musterbuch zu "
|
||||
"erstellen. Es hat nicht nur 5 Jahrhunderte überlebt, sondern auch in "
|
||||
"Spruch in die elektronische Schriftbearbeitung geschafft (bemerke, nahezu "
|
||||
"unverändert). Bekannt wurde es 1960, mit dem erscheinen von Letrase, "
|
||||
"welches Passagen von Lorem Ipsum enhielt, so wie Desktop Software wie "
|
||||
"Aldus PageMaker - ebenfalls mit Lorem Ipsum.")
|
||||
l->setText(QString("Label %1 %2 - Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
|
||||
"Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque "
|
||||
"penatibus et magnis dis parturient montes, nascetur ridiculus mus. "
|
||||
"Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. "
|
||||
"Nulla consequat massa quis enim. Donec pede justo, fringilla vel, "
|
||||
"aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, "
|
||||
"imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede "
|
||||
"mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum "
|
||||
"semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, "
|
||||
"porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, "
|
||||
"dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla "
|
||||
"ut metus varius laoreet.")
|
||||
.arg(LabelCount)
|
||||
.arg(QTime::currentTime().toString("hh:mm:ss:zzz")));
|
||||
|
||||
@ -49,6 +53,7 @@ static ads::CDockWidget* createLongTextLabelDockWidget(QMenu* ViewMenu)
|
||||
return DockWidget;
|
||||
}
|
||||
|
||||
|
||||
static ads::CDockWidget* createCalendarDockWidget(QMenu* ViewMenu)
|
||||
{
|
||||
static int CalendarCount = 0;
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "DockManager.h"
|
||||
#include "DockOverlay.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace ads
|
||||
{
|
||||
@ -83,7 +82,6 @@ public:
|
||||
protected:
|
||||
virtual void wheelEvent(QWheelEvent* Event) override
|
||||
{
|
||||
std::cout << "CTabsScrollArea::wheelEvent" << std::endl;
|
||||
Event->accept();
|
||||
const int direction = Event->angleDelta().y();
|
||||
if (direction < 0)
|
||||
@ -117,7 +115,7 @@ protected:
|
||||
{
|
||||
if (ev->button() == Qt::LeftButton)
|
||||
{
|
||||
std::cout << "CTabsScrollArea::mouseReleaseEvent" << std::endl;
|
||||
qDebug() << "CTabsScrollArea::mouseReleaseEvent";
|
||||
ev->accept();
|
||||
m_FloatingWidget = nullptr;
|
||||
m_DragStartMousePos = QPoint();
|
||||
@ -154,7 +152,7 @@ protected:
|
||||
|
||||
if (!this->geometry().contains(ev->pos()))
|
||||
{
|
||||
std::cout << "CTabsScrollArea::startFloating" << std::endl;
|
||||
qDebug() << "CTabsScrollArea::startFloating";
|
||||
startFloating(m_DragStartMousePos);
|
||||
auto Overlay = m_DockArea->dockManager()->containerOverlay();
|
||||
Overlay->setAllowedAreas(OuterDockAreas);
|
||||
@ -404,7 +402,7 @@ CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget
|
||||
//============================================================================
|
||||
CDockAreaWidget::~CDockAreaWidget()
|
||||
{
|
||||
std::cout << "~CDockAreaWidget()" << std::endl;
|
||||
qDebug() << "~CDockAreaWidget()";
|
||||
delete d;
|
||||
}
|
||||
|
||||
@ -465,7 +463,7 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
|
||||
//============================================================================
|
||||
void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
||||
{
|
||||
std::cout << "CDockAreaWidget::removeDockWidget" << std::endl;
|
||||
qDebug() << "CDockAreaWidget::removeDockWidget";
|
||||
d->ContentsLayout->removeWidget(DockWidget);
|
||||
auto TitleBar = DockWidget->titleBar();
|
||||
TitleBar->hide();
|
||||
@ -478,7 +476,7 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
|
||||
CDockContainerWidget* DockContainer = dockContainer();
|
||||
if (d->ContentsLayout->isEmpty())
|
||||
{
|
||||
std::cout << "Dock Area empty" << std::endl;
|
||||
qDebug() << "Dock Area empty";
|
||||
dockContainer()->removeDockArea(this);
|
||||
this->deleteLater();;
|
||||
}
|
||||
@ -720,8 +718,8 @@ void CDockAreaWidget::onDockWidgetViewToggled(bool Open)
|
||||
void CDockAreaWidget::saveState(QDataStream& stream) const
|
||||
{
|
||||
stream << d->ContentsLayout->count() << d->ContentsLayout->currentIndex();
|
||||
std::cout << "CDockAreaWidget::saveState TabCount: " << d->ContentsLayout->count()
|
||||
<< " CurrentIndex: " << d->ContentsLayout->currentIndex() << std::endl;
|
||||
qDebug() << "CDockAreaWidget::saveState TabCount: " << d->ContentsLayout->count()
|
||||
<< " CurrentIndex: " << d->ContentsLayout->currentIndex();
|
||||
for (int i = 0; i < d->ContentsLayout->count(); ++i)
|
||||
{
|
||||
dockWidget(i)->saveState(stream);
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <QGridLayout>
|
||||
#include <QPointer>
|
||||
#include <QVariant>
|
||||
#include <QDebug>
|
||||
|
||||
#include "DockManager.h"
|
||||
#include "DockAreaWidget.h"
|
||||
@ -45,7 +46,6 @@
|
||||
#include "ads_globals.h"
|
||||
#include "DockSplitter.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace ads
|
||||
{
|
||||
@ -314,8 +314,8 @@ void DockContainerWidgetPrivate::saveChildNodesState(QDataStream& stream, QWidge
|
||||
if (Splitter)
|
||||
{
|
||||
stream << internal::SplitterMarker << Splitter->orientation() << Splitter->count();
|
||||
std::cout << "NodeSplitter orient: " << Splitter->orientation()
|
||||
<< " WidgetCont: " << Splitter->count() << std::endl;
|
||||
qDebug() << "NodeSplitter orient: " << Splitter->orientation()
|
||||
<< " WidgetCont: " << Splitter->count();
|
||||
for (int i = 0; i < Splitter->count(); ++i)
|
||||
{
|
||||
saveChildNodesState(stream, Splitter->widget(i));
|
||||
@ -341,8 +341,8 @@ bool DockContainerWidgetPrivate::restoreSplitter(QDataStream& stream,
|
||||
int Orientation;
|
||||
int WidgetCount;
|
||||
stream >> Orientation >> WidgetCount;
|
||||
std::cout << "Restore NodeSplitter Orientation: " << Orientation <<
|
||||
" WidgetCount: " << WidgetCount << std::endl;
|
||||
qDebug() << "Restore NodeSplitter Orientation: " << Orientation <<
|
||||
" WidgetCount: " << WidgetCount;
|
||||
QSplitter* Splitter = nullptr;
|
||||
if (!Testing)
|
||||
{
|
||||
@ -362,8 +362,8 @@ bool DockContainerWidgetPrivate::restoreSplitter(QDataStream& stream,
|
||||
continue;
|
||||
}
|
||||
|
||||
std::cout << "ChildNode isVisible " << ChildNode->isVisible()
|
||||
<< " isVisibleTo " << ChildNode->isVisibleTo(Splitter) << std::endl;
|
||||
qDebug() << "ChildNode isVisible " << ChildNode->isVisible()
|
||||
<< " isVisibleTo " << ChildNode->isVisibleTo(Splitter);
|
||||
Splitter->addWidget(ChildNode);
|
||||
Visible |= ChildNode->isVisibleTo(Splitter);
|
||||
}
|
||||
@ -399,8 +399,8 @@ bool DockContainerWidgetPrivate::restoreDockArea(QDataStream& stream,
|
||||
int Tabs;
|
||||
int CurrentIndex;
|
||||
stream >> Tabs >> CurrentIndex;
|
||||
std::cout << "Restore NodeDockArea Tabs: " << Tabs << " CurrentIndex: "
|
||||
<< CurrentIndex << std::endl;
|
||||
qDebug() << "Restore NodeDockArea Tabs: " << Tabs << " CurrentIndex: "
|
||||
<< CurrentIndex;
|
||||
|
||||
CDockAreaWidget* DockArea = nullptr;
|
||||
if (!Testing)
|
||||
@ -420,8 +420,7 @@ bool DockContainerWidgetPrivate::restoreDockArea(QDataStream& stream,
|
||||
QString ObjectName;
|
||||
bool Closed;
|
||||
stream >> ObjectName >> Closed;
|
||||
std::cout << "Restore DockWidget " << ObjectName.toStdString() << " Closed: "
|
||||
<< Closed << std::endl;
|
||||
qDebug() << "Restore DockWidget " << ObjectName << " Closed: " << Closed;
|
||||
|
||||
CDockWidget* DockWidget = DockManager->findDockWidget(ObjectName);
|
||||
if (!DockWidget || Testing)
|
||||
@ -429,8 +428,7 @@ bool DockContainerWidgetPrivate::restoreDockArea(QDataStream& stream,
|
||||
continue;
|
||||
}
|
||||
|
||||
std::cout << "Dock Widget found - parent " << DockWidget->parent()
|
||||
<< std::endl;
|
||||
qDebug() << "Dock Widget found - parent " << DockWidget->parent();
|
||||
DockArea->addDockWidget(DockWidget);
|
||||
DockWidget->toggleView(!Closed);
|
||||
DockWidget->setProperty("dirty", false);
|
||||
@ -536,8 +534,8 @@ void DockContainerWidgetPrivate::dumpRecursive(int level, QWidget* widget)
|
||||
buf.fill(' ', level * 4);
|
||||
if (Splitter)
|
||||
{
|
||||
std::cout << buf.toStdString() << "Splitter " << ((Splitter->orientation() == Qt::Vertical)
|
||||
? "-" : "|") << std::endl;
|
||||
qDebug("%sSplitter %s", (const char*)buf, (Splitter->orientation() == Qt::Vertical)
|
||||
? "-" : "|");
|
||||
for (int i = 0; i < Splitter->count(); ++i)
|
||||
{
|
||||
dumpRecursive(level + 1, Splitter->widget(i));
|
||||
@ -550,7 +548,7 @@ void DockContainerWidgetPrivate::dumpRecursive(int level, QWidget* widget)
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::cout << buf.toStdString() << "DockArea" << std::endl;
|
||||
qDebug("%sDockArea", (const char*)buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -574,12 +572,12 @@ CDockAreaWidget* DockContainerWidgetPrivate::dockWidgetIntoDockArea(DockWidgetAr
|
||||
int index = TargetAreaSplitter ->indexOf(TargetDockArea);
|
||||
if (TargetAreaSplitter->orientation() == InsertParam.orientation())
|
||||
{
|
||||
std::cout << "TargetAreaSplitter->orientation() == InsertParam.orientation()" << std::endl;
|
||||
qDebug() << "TargetAreaSplitter->orientation() == InsertParam.orientation()";
|
||||
TargetAreaSplitter->insertWidget(index + InsertParam.insertOffset(), NewDockArea);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "TargetAreaSplitter->orientation() != InsertParam.orientation()" << std::endl;
|
||||
qDebug() << "TargetAreaSplitter->orientation() != InsertParam.orientation()";
|
||||
QSplitter* NewSplitter = internal::newSplitter(InsertParam.orientation());
|
||||
NewSplitter->addWidget(TargetDockArea);
|
||||
insertWidgetIntoSplitter(NewSplitter, NewDockArea, InsertParam.append());
|
||||
@ -696,7 +694,7 @@ void CDockContainerWidget::addDockArea(CDockAreaWidget* DockAreaWidget,
|
||||
//============================================================================
|
||||
void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
{
|
||||
std::cout << "CDockContainerWidget::removeDockArea" << std::endl;
|
||||
qDebug() << "CDockContainerWidget::removeDockArea";
|
||||
d->DockAreas.removeAll(area);
|
||||
QSplitter* Splitter = internal::findParent<QSplitter*>(area);
|
||||
area->setParent(0);
|
||||
@ -708,7 +706,7 @@ void CDockContainerWidget::removeDockArea(CDockAreaWidget* area)
|
||||
|
||||
// It the splitter contains only one single widget, then we do not need
|
||||
// it anymore and can replace it with its content
|
||||
std::cout << "Replacing splitter with content" << std::endl;
|
||||
qDebug() << "Replacing splitter with content";
|
||||
QWidget* widget = Splitter->widget(0);
|
||||
widget->setParent(this);
|
||||
QSplitter* ParentSplitter = internal::findParent<QSplitter*>(Splitter);
|
||||
@ -759,7 +757,7 @@ int CDockContainerWidget::dockAreaCount() const
|
||||
void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWidget,
|
||||
const QPoint& TargetPos)
|
||||
{
|
||||
std::cout << "CDockContainerWidget::dropFloatingWidget" << std::endl;
|
||||
qDebug() << "CDockContainerWidget::dropFloatingWidget";
|
||||
CDockAreaWidget* DockArea = dockAreaAt(TargetPos);
|
||||
auto dropArea = InvalidDockWidgetArea;
|
||||
if (DockArea)
|
||||
@ -769,7 +767,7 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
dropArea = dropOverlay->showOverlay(DockArea);
|
||||
if (dropArea != InvalidDockWidgetArea)
|
||||
{
|
||||
std::cout << "Dock Area Drop Content: " << dropArea << std::endl;
|
||||
qDebug() << "Dock Area Drop Content: " << dropArea;
|
||||
d->dropIntoSection(FloatingWidget, DockArea, dropArea);
|
||||
}
|
||||
}
|
||||
@ -778,7 +776,7 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
if (InvalidDockWidgetArea == dropArea)
|
||||
{
|
||||
dropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor();
|
||||
std::cout << "Container Drop Content: " << dropArea << std::endl;
|
||||
qDebug() << "Container Drop Content: " << dropArea;
|
||||
if (dropArea != InvalidDockWidgetArea)
|
||||
{
|
||||
d->dropIntoContainer(FloatingWidget, dropArea);
|
||||
@ -806,8 +804,8 @@ QList<CDockAreaWidget*> CDockContainerWidget::openedDockAreas() const
|
||||
//============================================================================
|
||||
void CDockContainerWidget::saveState(QDataStream& stream) const
|
||||
{
|
||||
std::cout << "CDockContainerWidget::saveState isFloating "
|
||||
<< isFloating() << std::endl;
|
||||
qDebug() << "CDockContainerWidget::saveState isFloating "
|
||||
<< isFloating();
|
||||
stream << internal::ContainerMarker;
|
||||
stream << isFloating();
|
||||
if (isFloating())
|
||||
@ -832,7 +830,7 @@ bool CDockContainerWidget::restoreState(QDataStream& stream, bool Testing)
|
||||
}
|
||||
|
||||
stream >> IsFloating;
|
||||
std::cout << "Restore CDockContainerWidget Floating" << IsFloating << std::endl;
|
||||
qDebug() << "Restore CDockContainerWidget Floating" << IsFloating;
|
||||
|
||||
QWidget* NewRootSplitter;
|
||||
if (!Testing)
|
||||
@ -842,7 +840,7 @@ bool CDockContainerWidget::restoreState(QDataStream& stream, bool Testing)
|
||||
|
||||
if (IsFloating)
|
||||
{
|
||||
std::cout << "Restore floating widget" << std::endl;
|
||||
qDebug() << "Restore floating widget";
|
||||
QByteArray Geometry;
|
||||
stream >> Geometry;
|
||||
if (!Testing)
|
||||
|
@ -34,8 +34,7 @@
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <QVariant>
|
||||
|
||||
#include <iostream>
|
||||
#include <QDebug>
|
||||
|
||||
#include "FloatingDockContainer.h"
|
||||
#include "DockOverlay.h"
|
||||
@ -64,11 +63,6 @@ struct DockManagerPrivate
|
||||
*/
|
||||
DockManagerPrivate(CDockManager* _public);
|
||||
|
||||
/**
|
||||
* Restores a non existing container from stream
|
||||
*/
|
||||
bool restoreContainer(QDataStream& Stream);
|
||||
|
||||
/**
|
||||
* Checks if the given data stream is a valid docking system state
|
||||
* file.
|
||||
@ -95,15 +89,6 @@ DockManagerPrivate::DockManagerPrivate(CDockManager* _public) :
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
bool DockManagerPrivate::restoreContainer(QDataStream& Stream)
|
||||
{
|
||||
std::cout << "restoreContainer" << std::endl;
|
||||
CFloatingDockContainer* FloatingWidget = new CFloatingDockContainer(_this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
bool DockManagerPrivate::checkFormat(const QByteArray &state, int version)
|
||||
{
|
||||
@ -127,7 +112,6 @@ bool DockManagerPrivate::checkFormat(const QByteArray &state, int version)
|
||||
int Result = true;
|
||||
int ContainerCount;
|
||||
stream >> ContainerCount;
|
||||
std::cout << "ContainerCount " << ContainerCount << std::endl;
|
||||
int i;
|
||||
for (i = 0; i < ContainerCount; ++i)
|
||||
{
|
||||
@ -152,7 +136,7 @@ bool DockManagerPrivate::restoreContainer(int Index, QDataStream& stream, bool T
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "d->Containers[i]->restoreState " << Index << std::endl;
|
||||
qDebug() << "d->Containers[i]->restoreState ";
|
||||
return Containers[Index]->restoreState(stream, internal::Restore);
|
||||
}
|
||||
}
|
||||
@ -181,7 +165,7 @@ bool DockManagerPrivate::restoreState(const QByteArray &state, int version)
|
||||
int Result = true;
|
||||
int ContainerCount;
|
||||
stream >> ContainerCount;
|
||||
std::cout << "ContainerCount " << ContainerCount << std::endl;
|
||||
qDebug() << "ContainerCount " << ContainerCount;
|
||||
int i;
|
||||
for (i = 0; i < ContainerCount; ++i)
|
||||
{
|
||||
@ -236,8 +220,7 @@ CDockManager::~CDockManager()
|
||||
void CDockManager::registerFloatingWidget(CFloatingDockContainer* FloatingWidget)
|
||||
{
|
||||
d->FloatingWidgets.append(FloatingWidget);
|
||||
std::cout << "d->FloatingWidgets.count() " << d->FloatingWidgets.count()
|
||||
<< std::endl;
|
||||
qDebug() << "d->FloatingWidgets.count() " << d->FloatingWidgets.count();
|
||||
}
|
||||
|
||||
|
||||
@ -322,7 +305,7 @@ bool CDockManager::restoreState(const QByteArray &state, int version)
|
||||
{
|
||||
if (!d->checkFormat(state, version))
|
||||
{
|
||||
std::cout << "checkFormat: Error checking format!!!!!!!" << std::endl;
|
||||
qDebug() << "checkFormat: Error checking format!!!!!!!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -333,7 +316,7 @@ bool CDockManager::restoreState(const QByteArray &state, int version)
|
||||
|
||||
if (!d->restoreState(state, version))
|
||||
{
|
||||
std::cout << "restoreState: Error restoring state!!!!!!!" << std::endl;
|
||||
qDebug() << "restoreState: Error restoring state!!!!!!!";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,6 @@
|
||||
#include <QtGlobal>
|
||||
#include <QDebug>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "DockAreaWidget.h"
|
||||
|
||||
namespace ads
|
||||
@ -314,12 +312,10 @@ DockWidgetArea CDockOverlay::showOverlay(QWidget* target)
|
||||
{
|
||||
if (d->TargetWidget == target)
|
||||
{
|
||||
qInfo() << "_target == target";
|
||||
// Hint: We could update geometry of overlay here.
|
||||
DockWidgetArea da = dropAreaUnderCursor();
|
||||
if (da != d->LastLocation)
|
||||
{
|
||||
qInfo() << "repaint()";
|
||||
repaint();
|
||||
d->LastLocation = da;
|
||||
}
|
||||
@ -342,7 +338,6 @@ DockWidgetArea CDockOverlay::showOverlay(QWidget* target)
|
||||
//============================================================================
|
||||
void CDockOverlay::hideOverlay()
|
||||
{
|
||||
qInfo() << "hideDockOverlay() _fullAreaDrop = false";
|
||||
hide();
|
||||
d->TargetWidget.clear();
|
||||
d->TargetRect = QRect();
|
||||
|
@ -10,7 +10,7 @@
|
||||
//============================================================================
|
||||
#include <DockSplitter.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <QDebug>
|
||||
|
||||
namespace ads
|
||||
{
|
||||
@ -18,7 +18,7 @@ namespace ads
|
||||
//============================================================================
|
||||
CDockSplitter::~CDockSplitter()
|
||||
{
|
||||
std::cout << "~CDockSplitter" << std::endl;
|
||||
qDebug() << "~CDockSplitter";
|
||||
}
|
||||
|
||||
} // namespace ads
|
||||
|
@ -0,0 +1,32 @@
|
||||
/*******************************************************************************
|
||||
** QtAdcancedDockingSystem
|
||||
** Copyright (C) 2017 Uwe Kindler
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
//============================================================================
|
||||
/// \file DockStateSerialization.cpp
|
||||
/// \author Uwe Kindler
|
||||
/// \date 26.02.2017
|
||||
/// \brief Serialization related data, constants and stuff
|
||||
//============================================================================
|
||||
|
||||
|
||||
//============================================================================
|
||||
// INCLUDES
|
||||
//============================================================================
|
||||
#include "DockStateSerialization.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
/// \file DockStateSerialization.h
|
||||
/// \author Uwe Kindler
|
||||
/// \date 26.02.2017
|
||||
/// \brief
|
||||
/// \brief Declaration of serialization related data, constants and stuff
|
||||
//============================================================================
|
||||
|
||||
|
||||
|
@ -37,8 +37,7 @@
|
||||
#include <QTextStream>
|
||||
#include <QPointer>
|
||||
#include <QEvent>
|
||||
|
||||
#include <iostream>
|
||||
#include <QDebug>
|
||||
|
||||
#include "DockWidgetTitleBar.h"
|
||||
#include "DockContainerWidget.h"
|
||||
@ -227,7 +226,7 @@ CDockWidget::CDockWidget(const QString &title, QWidget *parent) :
|
||||
//============================================================================
|
||||
CDockWidget::~CDockWidget()
|
||||
{
|
||||
std::cout << "~CDockWidget()" << std::endl;
|
||||
qDebug() << "~CDockWidget()";
|
||||
delete d;
|
||||
}
|
||||
|
||||
@ -367,8 +366,7 @@ void CDockWidget::setDockArea(CDockAreaWidget* DockArea)
|
||||
void CDockWidget::saveState(QDataStream& stream) const
|
||||
{
|
||||
stream << internal::DockWidgetMarker;
|
||||
std::cout << "CDockWidget::saveState " << objectName().toStdString()
|
||||
<< " closed " << d->Closed << std::endl;
|
||||
qDebug() << "CDockWidget::saveState " << objectName() << " closed " << d->Closed;
|
||||
stream << objectName() << d->Closed;
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,7 @@
|
||||
#include <QStyle>
|
||||
#include <QApplication>
|
||||
#include <QSplitter>
|
||||
|
||||
#include <iostream>
|
||||
#include <QDebug>
|
||||
|
||||
#include "ads_globals.h"
|
||||
#include "DockWidget.h"
|
||||
@ -161,9 +160,9 @@ void DockWidgetTitleBarPrivate::moveTab(QMouseEvent* ev)
|
||||
//============================================================================
|
||||
bool DockWidgetTitleBarPrivate::startFloating(const QPoint& GlobalPos)
|
||||
{
|
||||
std::cout << "isFloating " << DockWidget->dockContainer()->isFloating() << std::endl;
|
||||
std::cout << "areaCount " << DockWidget->dockContainer()->dockAreaCount() << std::endl;
|
||||
std::cout << "widgetCount " << DockWidget->dockAreaWidget()->count() << std::endl;
|
||||
qDebug() << "isFloating " << DockWidget->dockContainer()->isFloating();
|
||||
qDebug() << "areaCount " << DockWidget->dockContainer()->dockAreaCount();
|
||||
qDebug() << "widgetCount " << DockWidget->dockAreaWidget()->count();
|
||||
// if this is the last dock widget inside of this floating widget,
|
||||
// then it does not make any sense, to make if floating because
|
||||
// it is already floating
|
||||
@ -174,7 +173,7 @@ bool DockWidgetTitleBarPrivate::startFloating(const QPoint& GlobalPos)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cout << "startFloating" << std::endl;
|
||||
qDebug() << "startFloating";
|
||||
DragState = DraggingFloatingWidget;
|
||||
QSize Size = DockArea->size();
|
||||
CFloatingDockContainer* FloatingWidget = nullptr;
|
||||
@ -185,7 +184,7 @@ bool DockWidgetTitleBarPrivate::startFloating(const QPoint& GlobalPos)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "DockWidgetTitleBarPrivate::startFloating DockArea" << std::endl;
|
||||
qDebug() << "DockWidgetTitleBarPrivate::startFloating DockArea";
|
||||
// If section widget has only one content widget, we can move the complete
|
||||
// dock area into floating widget
|
||||
auto splitter = internal::findParent<QSplitter*>(DockArea);
|
||||
@ -213,7 +212,7 @@ CDockWidgetTitleBar::CDockWidgetTitleBar(CDockWidget* DockWidget, QWidget *paren
|
||||
//============================================================================
|
||||
CDockWidgetTitleBar::~CDockWidgetTitleBar()
|
||||
{
|
||||
std::cout << "~CDockWidgetTitleBar()" << std::endl;
|
||||
qDebug() << "~CDockWidgetTitleBar()";
|
||||
delete d;
|
||||
}
|
||||
|
||||
@ -223,7 +222,7 @@ void CDockWidgetTitleBar::mousePressEvent(QMouseEvent* ev)
|
||||
{
|
||||
if (ev->button() == Qt::LeftButton)
|
||||
{
|
||||
std::cout << "CDockWidgetTitleBar::mousePressEvent" << std::endl;
|
||||
qDebug() << "CDockWidgetTitleBar::mousePressEvent";
|
||||
ev->accept();
|
||||
d->DragStartMousePosition = ev->pos();
|
||||
d->DragState = DraggingMousePressed;
|
||||
@ -237,7 +236,7 @@ void CDockWidgetTitleBar::mousePressEvent(QMouseEvent* ev)
|
||||
//============================================================================
|
||||
void CDockWidgetTitleBar::mouseReleaseEvent(QMouseEvent* ev)
|
||||
{
|
||||
std::cout << "CDockWidgetTitleBar::mouseReleaseEvent" << std::endl;
|
||||
qDebug() << "CDockWidgetTitleBar::mouseReleaseEvent";
|
||||
// End of tab moving, change order now
|
||||
if (d->isDraggingState(DraggingTab) && d->DockArea)
|
||||
{
|
||||
@ -249,7 +248,7 @@ void CDockWidgetTitleBar::mouseReleaseEvent(QMouseEvent* ev)
|
||||
{
|
||||
toIndex = d->DockArea->count() - 1;
|
||||
}
|
||||
std::cout << "Move tab from " << fromIndex << " to " << toIndex << std::endl;
|
||||
qDebug() << "Move tab from " << fromIndex << " to " << toIndex;
|
||||
d->DockArea->reorderDockWidget(fromIndex, toIndex);
|
||||
}
|
||||
|
||||
|
@ -35,8 +35,7 @@
|
||||
#include <QMouseEvent>
|
||||
#include <QPointer>
|
||||
#include <QAction>
|
||||
|
||||
#include <iostream>
|
||||
#include <QDebug>
|
||||
|
||||
#include "DockContainerWidget.h"
|
||||
#include "DockAreaWidget.h"
|
||||
@ -92,7 +91,6 @@ void FloatingDockContainerPrivate::titleMouseReleaseEvent()
|
||||
return;
|
||||
}
|
||||
|
||||
std::cout << "Dropped" << std::endl;
|
||||
DropContainer->dropFloatingWidget(_this, QCursor::pos());
|
||||
DockManager->containerOverlay()->hideOverlay();
|
||||
DockManager->dockAreaOverlay()->hideOverlay();
|
||||
@ -214,7 +212,7 @@ CFloatingDockContainer::CFloatingDockContainer(CDockWidget* DockWidget) :
|
||||
//============================================================================
|
||||
CFloatingDockContainer::~CFloatingDockContainer()
|
||||
{
|
||||
std::cout << "~CFloatingDockContainer" << std::endl;
|
||||
qDebug() << "~CFloatingDockContainer";
|
||||
if (d->DockManager)
|
||||
{
|
||||
d->DockManager->removeFloatingWidget(this);
|
||||
@ -236,7 +234,7 @@ void CFloatingDockContainer::changeEvent(QEvent *event)
|
||||
QWidget::changeEvent(event);
|
||||
if ((event->type() == QEvent::ActivationChange) && isActiveWindow())
|
||||
{
|
||||
std::cout << "FloatingWidget::changeEvent QEvent::ActivationChange " << std::endl;
|
||||
qDebug() << "FloatingWidget::changeEvent QEvent::ActivationChange ";
|
||||
d->zOrderIndex = ++zOrderCounter;
|
||||
return;
|
||||
}
|
||||
@ -311,18 +309,18 @@ bool CFloatingDockContainer::event(QEvent *e)
|
||||
{
|
||||
if (QGuiApplication::mouseButtons() == Qt::LeftButton)
|
||||
{
|
||||
std::cout << "FloatingWidget::event Event::NonClientAreaMouseButtonPress" << e->type() << std::endl;
|
||||
qDebug() << "FloatingWidget::event Event::NonClientAreaMouseButtonPress" << e->type();
|
||||
d->setDraggingActive(true);
|
||||
}
|
||||
}
|
||||
else if (e->type() == QEvent::NonClientAreaMouseButtonDblClick)
|
||||
{
|
||||
std::cout << "FloatingWidget::event QEvent::NonClientAreaMouseButtonDblClick" << std::endl;
|
||||
qDebug() << "FloatingWidget::event QEvent::NonClientAreaMouseButtonDblClick";
|
||||
d->setDraggingActive(false);
|
||||
}
|
||||
else if ((e->type() == QEvent::NonClientAreaMouseButtonRelease) && d->DraggingActive)
|
||||
{
|
||||
std::cout << "FloatingWidget::event QEvent::NonClientAreaMouseButtonRelease" << std::endl;
|
||||
qDebug() << "FloatingWidget::event QEvent::NonClientAreaMouseButtonRelease";
|
||||
d->titleMouseReleaseEvent();
|
||||
}
|
||||
|
||||
@ -335,7 +333,7 @@ bool CFloatingDockContainer::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonRelease && d->DraggingActive)
|
||||
{
|
||||
std::cout << "FloatingWidget::eventFilter QEvent::MouseButtonRelease" << std::endl;
|
||||
qDebug() << "FloatingWidget::eventFilter QEvent::MouseButtonRelease";
|
||||
d->titleMouseReleaseEvent();
|
||||
}
|
||||
|
||||
@ -367,7 +365,7 @@ void CFloatingDockContainer::moveFloating()
|
||||
//============================================================================
|
||||
void CFloatingDockContainer::onDockAreasAddedOrRemoved()
|
||||
{
|
||||
std::cout << "CFloatingDockContainer::onDockAreasAddedOrRemoved()" << std::endl;
|
||||
qDebug() << "CFloatingDockContainer::onDockAreasAddedOrRemoved()";
|
||||
if (d->DockContainer->dockAreaCount() == 1)
|
||||
{
|
||||
d->SingleDockArea = d->DockContainer->dockArea(0);
|
||||
|
Loading…
Reference in New Issue
Block a user