mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Fixes compiler warning C4482 (enum usage with type name).
This commit is contained in:
parent
34d7bf6aeb
commit
3ec2d9d8f6
@ -20,8 +20,6 @@ windows {
|
||||
}
|
||||
# MSVC
|
||||
*-msvc* {
|
||||
#QMAKE_CXXFLAGS += /Za
|
||||
#QMAKE_CXXFLAGS += /FS
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ class QSplitter;
|
||||
#ifdef ADS_NAMESPACE_ENABLED
|
||||
#define ADS_NAMESPACE_BEGIN namespace ads {
|
||||
#define ADS_NAMESPACE_END }
|
||||
#define ADS_NS ads
|
||||
#define ADS_NS ::ads
|
||||
#else
|
||||
#define ADS_NAMESPACE_BEGIN
|
||||
#define ADS_NAMESPACE_END
|
||||
|
@ -56,8 +56,8 @@ private:
|
||||
};
|
||||
|
||||
|
||||
DropArea showDropOverlay(QWidget* parent, DropAreas areas = DropArea::AllAreas);
|
||||
void showDropOverlay(QWidget* parent, const QRect& areaRect, DropAreas areas = DropArea::AllAreas);
|
||||
DropArea showDropOverlay(QWidget* parent, DropAreas areas = AllAreas);
|
||||
void showDropOverlay(QWidget* parent, const QRect& areaRect, DropAreas areas = AllAreas);
|
||||
void hideDropOverlay();
|
||||
|
||||
ADS_NAMESPACE_END
|
||||
|
@ -83,19 +83,19 @@ void DropOverlay::paintEvent(QPaintEvent*)
|
||||
const DropArea da = cursorLocation();
|
||||
switch (da)
|
||||
{
|
||||
case DropArea::TopDropArea:
|
||||
case ADS_NS::TopDropArea:
|
||||
r.setHeight(r.height() / 2);
|
||||
break;
|
||||
case DropArea::RightDropArea:
|
||||
case ADS_NS::RightDropArea:
|
||||
r.setX(r.width() / 2);
|
||||
break;
|
||||
case DropArea::BottomDropArea:
|
||||
case ADS_NS::BottomDropArea:
|
||||
r.setY(r.height() / 2);
|
||||
break;
|
||||
case DropArea::LeftDropArea:
|
||||
case ADS_NS::LeftDropArea:
|
||||
r.setWidth(r.width() / 2);
|
||||
break;
|
||||
case DropArea::CenterDropArea:
|
||||
case ADS_NS::CenterDropArea:
|
||||
r = rect();
|
||||
break;
|
||||
default:
|
||||
@ -155,27 +155,27 @@ DropSplitAreas::DropSplitAreas(DropAreas areas, QWidget* parent) :
|
||||
grid->setContentsMargins(0, 0, 0, 0);
|
||||
grid->setSpacing(6);
|
||||
|
||||
if (areas.testFlag(DropArea::TopDropArea))
|
||||
if (areas.testFlag(ADS_NS::TopDropArea))
|
||||
{
|
||||
_top = createDropWidget(":/img/split-top.png");
|
||||
grid->addWidget(_top, 0, 1, Qt::AlignHCenter | Qt::AlignBottom);
|
||||
}
|
||||
if (areas.testFlag(DropArea::RightDropArea))
|
||||
if (areas.testFlag(ADS_NS::RightDropArea))
|
||||
{
|
||||
_right = createDropWidget(":/img/split-right.png");
|
||||
grid->addWidget(_right, 1, 2, Qt::AlignLeft | Qt::AlignVCenter);
|
||||
}
|
||||
if (areas.testFlag(DropArea::BottomDropArea))
|
||||
if (areas.testFlag(ADS_NS::BottomDropArea))
|
||||
{
|
||||
_bottom = createDropWidget(":/img/split-bottom.png");
|
||||
grid->addWidget(_bottom, 2, 1, Qt::AlignHCenter | Qt::AlignTop);
|
||||
}
|
||||
if (areas.testFlag(DropArea::LeftDropArea))
|
||||
if (areas.testFlag(ADS_NS::LeftDropArea))
|
||||
{
|
||||
_left = createDropWidget(":/img/split-left.png");
|
||||
grid->addWidget(_left, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
}
|
||||
if (areas.testFlag(DropArea::CenterDropArea))
|
||||
if (areas.testFlag(ADS_NS::CenterDropArea))
|
||||
{
|
||||
_center = createDropWidget(":/img/dock-center.png");
|
||||
grid->addWidget(_center, 1, 1, Qt::AlignCenter);
|
||||
|
@ -120,17 +120,17 @@ void SectionTitleWidget::mouseReleaseEvent(QMouseEvent* ev)
|
||||
// Mouse is over a outer-edge drop area
|
||||
else
|
||||
{
|
||||
DropArea dropArea = DropArea::InvalidDropArea;
|
||||
DropArea dropArea = ADS_NS::InvalidDropArea;
|
||||
if (cw->outerTopDropRect().contains(cw->mapFromGlobal(ev->globalPos())))
|
||||
dropArea = DropArea::TopDropArea;
|
||||
dropArea = ADS_NS::TopDropArea;
|
||||
if (cw->outerRightDropRect().contains(cw->mapFromGlobal(ev->globalPos())))
|
||||
dropArea = DropArea::RightDropArea;
|
||||
dropArea = ADS_NS::RightDropArea;
|
||||
if (cw->outerBottomDropRect().contains(cw->mapFromGlobal(ev->globalPos())))
|
||||
dropArea = DropArea::BottomDropArea;
|
||||
dropArea = ADS_NS::BottomDropArea;
|
||||
if (cw->outerLeftDropRect().contains(cw->mapFromGlobal(ev->globalPos())))
|
||||
dropArea = DropArea::LeftDropArea;
|
||||
dropArea = ADS_NS::LeftDropArea;
|
||||
|
||||
if (dropArea != DropArea::InvalidDropArea)
|
||||
if (dropArea != ADS_NS::InvalidDropArea)
|
||||
{
|
||||
#if !defined(ADS_ANIMATIONS_ENABLED)
|
||||
InternalContentData data;
|
||||
@ -197,19 +197,19 @@ void SectionTitleWidget::mouseMoveEvent(QMouseEvent* ev)
|
||||
// Top, Right, Bottom, Left
|
||||
else if (cw->outerTopDropRect().contains(cw->mapFromGlobal(QCursor::pos())))
|
||||
{
|
||||
showDropOverlay(cw, cw->outerTopDropRect(), DropArea::TopDropArea);
|
||||
showDropOverlay(cw, cw->outerTopDropRect(), ADS_NS::TopDropArea);
|
||||
}
|
||||
else if (cw->outerRightDropRect().contains(cw->mapFromGlobal(QCursor::pos())))
|
||||
{
|
||||
showDropOverlay(cw, cw->outerRightDropRect(), DropArea::RightDropArea);
|
||||
showDropOverlay(cw, cw->outerRightDropRect(), ADS_NS::RightDropArea);
|
||||
}
|
||||
else if (cw->outerBottomDropRect().contains(cw->mapFromGlobal(QCursor::pos())))
|
||||
{
|
||||
showDropOverlay(cw, cw->outerBottomDropRect(), DropArea::BottomDropArea);
|
||||
showDropOverlay(cw, cw->outerBottomDropRect(), ADS_NS::BottomDropArea);
|
||||
}
|
||||
else if (cw->outerLeftDropRect().contains(cw->mapFromGlobal(QCursor::pos())))
|
||||
{
|
||||
showDropOverlay(cw, cw->outerLeftDropRect(), DropArea::LeftDropArea);
|
||||
showDropOverlay(cw, cw->outerLeftDropRect(), ADS_NS::LeftDropArea);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -7,6 +7,8 @@ TEMPLATE = app
|
||||
|
||||
INCLUDEPATH += $$PWD/src
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): DEFINES += ADS_NAMESPACE_ENABLED
|
||||
|
||||
windows {
|
||||
# MinGW
|
||||
*-g++* {
|
||||
|
Loading…
Reference in New Issue
Block a user