mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Removes some auto keywords.
This commit is contained in:
parent
861d5187e3
commit
c74204d5b7
@ -5,16 +5,14 @@
|
|||||||
|
|
||||||
#include "ads/ContainerWidget.h"
|
#include "ads/ContainerWidget.h"
|
||||||
|
|
||||||
//const QString DragData::MIMETYPE = QString("qt/ads-dragdata");
|
|
||||||
|
|
||||||
ADS_NAMESPACE_BEGIN
|
ADS_NAMESPACE_BEGIN
|
||||||
|
|
||||||
void deleteEmptySplitter(ContainerWidget* container)
|
void deleteEmptySplitter(ContainerWidget* container)
|
||||||
{
|
{
|
||||||
auto splitters = container->findChildren<QSplitter*>();
|
QList<QSplitter*> splitters = container->findChildren<QSplitter*>();
|
||||||
for (auto i = 0; i < splitters.count(); ++i)
|
for (int i = 0; i < splitters.count(); ++i)
|
||||||
{
|
{
|
||||||
auto sp = splitters.at(i);
|
QSplitter* sp = splitters.at(i);
|
||||||
if (sp->count() == 0)
|
if (sp->count() == 0)
|
||||||
delete splitters[i];
|
delete splitters[i];
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ static QSplitter* newSplitter(Qt::Orientation orientation = Qt::Horizontal, QWid
|
|||||||
|
|
||||||
static void dropContentOuterHelper(ContainerWidget* cw, QLayout* l, const InternalContentData& data, Qt::Orientation orientation, bool append)
|
static void dropContentOuterHelper(ContainerWidget* cw, QLayout* l, const InternalContentData& data, Qt::Orientation orientation, bool append)
|
||||||
{
|
{
|
||||||
auto sw = new SectionWidget(cw);
|
SectionWidget* sw = new SectionWidget(cw);
|
||||||
sw->addContent(data, true);
|
sw->addContent(data, true);
|
||||||
|
|
||||||
QSplitter* oldsp = findImmediateSplitter(cw);
|
QSplitter* oldsp = findImmediateSplitter(cw);
|
||||||
@ -37,10 +37,10 @@ static void dropContentOuterHelper(ContainerWidget* cw, QLayout* l, const Intern
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto sp = newSplitter(orientation);
|
QSplitter* sp = newSplitter(orientation);
|
||||||
if (append)
|
if (append)
|
||||||
{
|
{
|
||||||
auto li = l->replaceWidget(oldsp, sp);
|
QLayoutItem* li = l->replaceWidget(oldsp, sp);
|
||||||
sp->addWidget(oldsp);
|
sp->addWidget(oldsp);
|
||||||
sp->addWidget(sw);
|
sp->addWidget(sw);
|
||||||
delete li;
|
delete li;
|
||||||
@ -48,7 +48,7 @@ static void dropContentOuterHelper(ContainerWidget* cw, QLayout* l, const Intern
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sp->addWidget(sw);
|
sp->addWidget(sw);
|
||||||
auto li = l->replaceWidget(oldsp, sp);
|
QLayoutItem* li = l->replaceWidget(oldsp, sp);
|
||||||
sp->addWidget(oldsp);
|
sp->addWidget(oldsp);
|
||||||
delete li;
|
delete li;
|
||||||
}
|
}
|
||||||
@ -153,17 +153,17 @@ void ContainerWidget::dropContent(const InternalContentData& data, SectionWidget
|
|||||||
}
|
}
|
||||||
case BottomDropArea:
|
case BottomDropArea:
|
||||||
{
|
{
|
||||||
auto sw = new SectionWidget(this);
|
SectionWidget* sw = new SectionWidget(this);
|
||||||
sw->addContent(data, true);
|
sw->addContent(data, true);
|
||||||
if (targetSectionSplitter->orientation() == Qt::Vertical)
|
if (targetSectionSplitter->orientation() == Qt::Vertical)
|
||||||
{
|
{
|
||||||
auto index = targetSectionSplitter->indexOf(targetSection);
|
int index = targetSectionSplitter->indexOf(targetSection);
|
||||||
targetSectionSplitter->insertWidget(index + 1, sw);
|
targetSectionSplitter->insertWidget(index + 1, sw);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto index = targetSectionSplitter->indexOf(targetSection);
|
int index = targetSectionSplitter->indexOf(targetSection);
|
||||||
auto s = newSplitter(Qt::Vertical);
|
QSplitter* s = newSplitter(Qt::Vertical);
|
||||||
s->addWidget(targetSection);
|
s->addWidget(targetSection);
|
||||||
s->addWidget(sw);
|
s->addWidget(sw);
|
||||||
targetSectionSplitter->insertWidget(index, s);
|
targetSectionSplitter->insertWidget(index, s);
|
||||||
@ -172,18 +172,18 @@ void ContainerWidget::dropContent(const InternalContentData& data, SectionWidget
|
|||||||
}
|
}
|
||||||
case LeftDropArea:
|
case LeftDropArea:
|
||||||
{
|
{
|
||||||
auto sw = new SectionWidget(this);
|
SectionWidget* sw = new SectionWidget(this);
|
||||||
sw->addContent(data, true);
|
sw->addContent(data, true);
|
||||||
if (targetSectionSplitter->orientation() == Qt::Horizontal)
|
if (targetSectionSplitter->orientation() == Qt::Horizontal)
|
||||||
{
|
{
|
||||||
auto index = targetSectionSplitter->indexOf(targetSection);
|
int index = targetSectionSplitter->indexOf(targetSection);
|
||||||
targetSectionSplitter->insertWidget(index, sw);
|
targetSectionSplitter->insertWidget(index, sw);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto s = newSplitter(Qt::Horizontal);
|
QSplitter* s = newSplitter(Qt::Horizontal);
|
||||||
s->addWidget(sw);
|
s->addWidget(sw);
|
||||||
auto index = targetSectionSplitter->indexOf(targetSection);
|
int index = targetSectionSplitter->indexOf(targetSection);
|
||||||
targetSectionSplitter->insertWidget(index, s);
|
targetSectionSplitter->insertWidget(index, s);
|
||||||
s->addWidget(targetSection);
|
s->addWidget(targetSection);
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ SectionWidget* ContainerWidget::sectionAt(const QPoint& pos) const
|
|||||||
const QPoint gpos = mapToGlobal(pos);
|
const QPoint gpos = mapToGlobal(pos);
|
||||||
for (int i = 0; i < _sections.size(); ++i)
|
for (int i = 0; i < _sections.size(); ++i)
|
||||||
{
|
{
|
||||||
auto sw = _sections[i];
|
SectionWidget* sw = _sections[i];
|
||||||
if (sw->rect().contains(sw->mapFromGlobal(gpos)))
|
if (sw->rect().contains(sw->mapFromGlobal(gpos)))
|
||||||
{
|
{
|
||||||
return sw;
|
return sw;
|
||||||
@ -247,29 +247,29 @@ SectionWidget* ContainerWidget::sectionAt(const QPoint& pos) const
|
|||||||
|
|
||||||
QRect ContainerWidget::outerTopDropRect() const
|
QRect ContainerWidget::outerTopDropRect() const
|
||||||
{
|
{
|
||||||
auto r = rect();
|
QRect r = rect();
|
||||||
auto h = r.height() / 100 * 5;
|
int h = r.height() / 100 * 5;
|
||||||
return QRect(r.left(), r.top(), r.width(), h);
|
return QRect(r.left(), r.top(), r.width(), h);
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect ContainerWidget::outerRightDropRect() const
|
QRect ContainerWidget::outerRightDropRect() const
|
||||||
{
|
{
|
||||||
auto r = rect();
|
QRect r = rect();
|
||||||
auto w = r.width() / 100 * 5;
|
int w = r.width() / 100 * 5;
|
||||||
return QRect(r.right() - w, r.top(), w, r.height());
|
return QRect(r.right() - w, r.top(), w, r.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect ContainerWidget::outerBottomDropRect() const
|
QRect ContainerWidget::outerBottomDropRect() const
|
||||||
{
|
{
|
||||||
auto r = rect();
|
QRect r = rect();
|
||||||
auto h = r.height() / 100 * 5;
|
int h = r.height() / 100 * 5;
|
||||||
return QRect(r.left(), r.bottom() - h, r.width(), h);
|
return QRect(r.left(), r.bottom() - h, r.width(), h);
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect ContainerWidget::outerLeftDropRect() const
|
QRect ContainerWidget::outerLeftDropRect() const
|
||||||
{
|
{
|
||||||
auto r = rect();
|
QRect r = rect();
|
||||||
auto w = r.width() / 100 * 5;
|
int w = r.width() / 100 * 5;
|
||||||
return QRect(r.left(), r.top(), w, r.height());
|
return QRect(r.left(), r.top(), w, r.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user