1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-01-14 20:00:54 +00:00

fix macos deprecation warnings

This commit is contained in:
Bret Curtis 2026-01-05 16:09:45 +01:00
parent 80a6d13be5
commit 52b129fe39
7 changed files with 8 additions and 7 deletions

View file

@ -735,6 +735,7 @@ endif()
if (APPLE)
target_compile_definitions(components PRIVATE GL_SILENCE_DEPRECATION=1)
target_compile_definitions(openmw PRIVATE GL_SILENCE_DEPRECATION=1)
target_compile_definitions(openmw-lib PRIVATE GL_SILENCE_DEPRECATION=1)
endif()
# Apple bundling

View file

@ -34,7 +34,7 @@ CSMPrefs::SettingWidgets CSMPrefs::BoolSetting::makeWidgets(QWidget* parent)
mWidget->setToolTip(tooltip);
}
connect(mWidget, &QCheckBox::stateChanged, this, &BoolSetting::valueChanged);
connect(mWidget, &QCheckBox::checkStateChanged, this, &BoolSetting::valueChanged);
return SettingWidgets{ .mLabel = nullptr, .mInput = mWidget };
}

View file

@ -431,7 +431,7 @@ namespace CSMPrefs
std::make_pair((int)Qt::Key_twosuperior, "twosuperior"),
std::make_pair((int)Qt::Key_threesuperior, "threesuperior"),
std::make_pair((int)Qt::Key_acute, "acute"),
std::make_pair((int)Qt::Key_mu, "mu"),
std::make_pair((int)Qt::Key_micro, "mu"),
std::make_pair((int)Qt::Key_paragraph, "paragraph"),
std::make_pair((int)Qt::Key_periodcentered, "periodcentered"),
std::make_pair((int)Qt::Key_cedilla, "cedilla"),

View file

@ -298,7 +298,7 @@ QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(
}
else if (qobject_cast<QCheckBox*>(editor))
{
connect(static_cast<QCheckBox*>(editor), &QCheckBox::stateChanged, proxy,
connect(static_cast<QCheckBox*>(editor), &QCheckBox::checkStateChanged, proxy,
qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
}
else if (qobject_cast<QPlainTextEdit*>(editor))

View file

@ -130,7 +130,7 @@ void CSVWorld::ExtendedCommandConfigurator::setupCheckBoxes(const std::vector<CS
for (int i = numTypes - numCheckBoxes; i > 0; --i)
{
QCheckBox* checkBox = new QCheckBox(mTypeGroup);
connect(checkBox, &QCheckBox::stateChanged, this, &ExtendedCommandConfigurator::checkBoxStateChanged);
connect(checkBox, &QCheckBox::checkStateChanged, this, &ExtendedCommandConfigurator::checkBoxStateChanged);
mTypeCheckBoxes.insert(std::make_pair(checkBox, CSMWorld::UniversalId::Type_None));
}
}

View file

@ -55,7 +55,7 @@ CSVWorld::TableSubView::TableSubView(
"\nCan be useful in finding the moved or modified"
"\nobject instance while 3D editing.");
autoJump->setCheckState(Qt::Unchecked);
connect(autoJump, &QCheckBox::stateChanged, mTable, &Table::jumpAfterModChanged);
connect(autoJump, &QCheckBox::checkStateChanged, mTable, &Table::jumpAfterModChanged);
optHLayout->insertWidget(0, autoJump);
optHLayout->setContentsMargins(QMargins(0, 3, 0, 0));
mOptions->setLayout(optHLayout);

View file

@ -54,9 +54,9 @@ namespace Misc::StringUtils
const int size = std::snprintf(nullptr, 0, fmt, argument(args)...);
if (size < 0)
throw std::system_error(errno, std::generic_category(), "Failed to compute resulting string size");
// Note: sprintf also writes a trailing null character. We should remove it.
// Note: snprintf also writes a trailing null character. We should remove it.
std::string ret(static_cast<std::size_t>(size) + 1, '\0');
if (std::sprintf(ret.data(), fmt, argument(args)...) < 0)
if (std::snprintf(ret.data(), ret.size(), fmt, argument(args)...) < 0)
throw std::system_error(errno, std::generic_category(), "Failed to format string");
ret.erase(static_cast<std::size_t>(size));
return ret;