Fix build with MSVC.

This commit is contained in:
Roman Telezhynskyi 2022-11-22 17:01:01 +02:00
parent de664c3aa0
commit 78a123b266
5 changed files with 19 additions and 19 deletions

View File

@ -428,7 +428,7 @@ void VWidgetBackgroundImages::MoveImageOnTop()
if (item != nullptr)
{
QUuid id = item->data(Qt::UserRole).toUuid();
auto *command = new ZValueMoveBackgroundImage(id, ZValueMove::Top, m_doc);
auto *command = new ZValueMoveBackgroundImage(id, ZValueMoveType::Top, m_doc);
VAbstractApplication::VApp()->getUndoStack()->push(command);
}
}
@ -446,7 +446,7 @@ void VWidgetBackgroundImages::MoveImageUp()
if (item != nullptr)
{
QUuid id = item->data(Qt::UserRole).toUuid();
auto *command = new ZValueMoveBackgroundImage(id, ZValueMove::Up, m_doc);
auto *command = new ZValueMoveBackgroundImage(id, ZValueMoveType::Up, m_doc);
VAbstractApplication::VApp()->getUndoStack()->push(command);
}
}
@ -464,7 +464,7 @@ void VWidgetBackgroundImages::MoveImageDown()
if (item != nullptr)
{
QUuid id = item->data(Qt::UserRole).toUuid();
auto *command = new ZValueMoveBackgroundImage(id, ZValueMove::Down, m_doc);
auto *command = new ZValueMoveBackgroundImage(id, ZValueMoveType::Down, m_doc);
VAbstractApplication::VApp()->getUndoStack()->push(command);
}
}
@ -482,7 +482,7 @@ void VWidgetBackgroundImages::MoveImageBottom()
if (item != nullptr)
{
QUuid id = item->data(Qt::UserRole).toUuid();
auto *command = new ZValueMoveBackgroundImage(id, ZValueMove::Bottom, m_doc);
auto *command = new ZValueMoveBackgroundImage(id, ZValueMoveType::Bottom, m_doc);
VAbstractApplication::VApp()->getUndoStack()->push(command);
}
}

View File

@ -525,16 +525,16 @@ void VBackgroundImageItem::keyPressEvent(QKeyEvent *event)
(event->modifiers() & Qt::ControlModifier) ? ScaleImageByFactor(0.5) : ScaleImageByAdjustSize(-2);
return;
case Qt::Key_Home:
ZValueMove(static_cast<int>(ZValueMove::Top));
MoveImageZValue(static_cast<int>(ZValueMoveType::Top));
return;
case Qt::Key_PageUp:
ZValueMove(static_cast<int>(ZValueMove::Up));
MoveImageZValue(static_cast<int>(ZValueMoveType::Up));
return;
case Qt::Key_PageDown:
ZValueMove(static_cast<int>(ZValueMove::Down));
MoveImageZValue(static_cast<int>(ZValueMoveType::Down));
return;
case Qt::Key_End:
ZValueMove(static_cast<int>(ZValueMove::Bottom));
MoveImageZValue(static_cast<int>(ZValueMoveType::Bottom));
return;
default:
break;
@ -713,9 +713,9 @@ void VBackgroundImageItem::ScaleImageByFactor(qreal factor)
}
//---------------------------------------------------------------------------------------------------------------------
void VBackgroundImageItem::ZValueMove(int move)
void VBackgroundImageItem::MoveImageZValue(int move)
{
auto zMove = static_cast<enum ZValueMove>(move);
auto zMove = static_cast<ZValueMoveType>(move);
VAbstractApplication::VApp()->getUndoStack()->push(new ZValueMoveBackgroundImage(m_image.Id(), zMove, m_doc));
}

View File

@ -129,7 +129,7 @@ private:
void RotateImageByAngle(qreal angle);
void ScaleImageByAdjustSize(qreal value);
void ScaleImageByFactor(qreal factor);
void ZValueMove(int move);
void MoveImageZValue(int move);
void UpdateSceneRect();

View File

@ -49,7 +49,7 @@ auto CorrectedZValues(const QList<QVector<QUuid>> &order) -> QHash<QUuid, qreal>
} // namespace
//---------------------------------------------------------------------------------------------------------------------
ZValueMoveBackgroundImage::ZValueMoveBackgroundImage(QUuid id, ZValueMove move, VAbstractPattern *doc,
ZValueMoveBackgroundImage::ZValueMoveBackgroundImage(QUuid id, ZValueMoveType move, VAbstractPattern *doc,
QUndoCommand *parent)
: VUndoCommand(QDomElement(), doc, parent),
m_id(id),
@ -112,12 +112,12 @@ void ZValueMoveBackgroundImage::redo()
QList<QVector<QUuid>> order;
if (m_move == ZValueMove::Top)
if (m_move == ZValueMoveType::Top)
{
order = Levels(images, true);
order.prepend({m_id});
}
else if (m_move == ZValueMove::Up)
else if (m_move == ZValueMoveType::Up)
{
for (auto &image: images)
{
@ -129,7 +129,7 @@ void ZValueMoveBackgroundImage::redo()
order = Levels(images, false);
}
else if (m_move == ZValueMove::Down)
else if (m_move == ZValueMoveType::Down)
{
for (auto &image: images)
{
@ -141,7 +141,7 @@ void ZValueMoveBackgroundImage::redo()
order = Levels(images, false);
}
else if (m_move == ZValueMove::Bottom)
else if (m_move == ZValueMoveType::Bottom)
{
order = Levels(images, true);
order.append({m_id});

View File

@ -34,7 +34,7 @@
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
enum class ZValueMove
enum class ZValueMoveType
{
Top,
Up,
@ -45,7 +45,7 @@ enum class ZValueMove
class ZValueMoveBackgroundImage : public VUndoCommand
{
public:
ZValueMoveBackgroundImage(QUuid id, ZValueMove move, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
ZValueMoveBackgroundImage(QUuid id, ZValueMoveType move, VAbstractPattern *doc, QUndoCommand *parent = nullptr);
~ZValueMoveBackgroundImage() override =default;
void undo() override;
void redo() override;
@ -53,7 +53,7 @@ private:
// cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(ZValueMoveBackgroundImage) // NOLINT
QUuid m_id;
ZValueMove m_move;
ZValueMoveType m_move;
QHash<QUuid, qreal> m_oldValues{};
};