Added LC_ARRAY_SIZE_CHECK for static array checks.

This commit is contained in:
Leonardo Zide
2020-12-06 11:26:55 -08:00
parent c6c0718d18
commit e52ea0ab63
8 changed files with 24 additions and 15 deletions
+3 -1
View File
@@ -1771,7 +1771,7 @@ void lcMainWindow::SetTransformType(lcTransformType TransformType)
mTransformType = TransformType;
const char* IconNames[static_cast<int>(lcTransformType::Count)] =
constexpr const char* IconNames[] =
{
":/resources/edit_transform_absolute_translation.png",
":/resources/edit_transform_relative_translation.png",
@@ -1779,6 +1779,8 @@ void lcMainWindow::SetTransformType(lcTransformType TransformType)
":/resources/edit_transform_relative_rotation.png"
};
LC_ARRAY_SIZE_CHECK(IconNames, lcTransformType::Count);
int TransformIndex = static_cast<int>(TransformType);
mActions[LC_EDIT_TRANSFORM_ABSOLUTE_TRANSLATION + TransformIndex]->setChecked(true);
mActions[LC_EDIT_TRANSFORM]->setIcon(QIcon(IconNames[TransformIndex]));