From 08290d76fb7d4e1dce1da27c841a73da8bffd1ea Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 12 Aug 2019 11:29:34 +0200 Subject: [PATCH] Warnings fixes on recent compilers --- companion/src/simulation/joystickdialog.cpp | 6 +++--- companion/src/simulation/simulatorinterface.cpp | 2 +- companion/src/simulation/widgets/virtualjoystickwidget.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/companion/src/simulation/joystickdialog.cpp b/companion/src/simulation/joystickdialog.cpp index 39058a5bc..223e2d77d 100644 --- a/companion/src/simulation/joystickdialog.cpp +++ b/companion/src/simulation/joystickdialog.cpp @@ -45,14 +45,14 @@ joystickDialog::joystickDialog(QWidget *parent, int stick) : }; memcpy(jscal, jscaltmp, sizeof (jscal)); - foreach(QComboBox *cb, findChildren(QRegExp("jsmapCB_[0-9]+"))) { + foreach(QComboBox *cb, findChildren(QRegularExpression("jsmapCB_[0-9]+"))) { populateSourceCombo(cb); sticks[cb->property("channel").toUInt()] = cb; } - foreach(QCheckBox *ib, findChildren(QRegExp("ChInv_[0-9]+"))) { + foreach(QCheckBox *ib, findChildren(QRegularExpression("ChInv_[0-9]+"))) { invert[ib->property("channel").toUInt()] = ib; } - foreach(QSlider *sl, findChildren(QRegExp("Ch_[0-9]+"))) { + foreach(QSlider *sl, findChildren(QRegularExpression("Ch_[0-9]+"))) { sliders[sl->property("channel").toUInt()] = sl; } diff --git a/companion/src/simulation/simulatorinterface.cpp b/companion/src/simulation/simulatorinterface.cpp index 24919e055..1ed9cc520 100644 --- a/companion/src/simulation/simulatorinterface.cpp +++ b/companion/src/simulation/simulatorinterface.cpp @@ -100,7 +100,7 @@ void SimulatorLoader::registerSimulators() path.truncate(path.lastIndexOf('\\')); dir.setPath(path); #else - dir = SIMULATOR_LIB_SEARCH_PATH; + dir.setPath(SIMULATOR_LIB_SEARCH_PATH); #endif registerSimulators(dir); } diff --git a/companion/src/simulation/widgets/virtualjoystickwidget.cpp b/companion/src/simulation/widgets/virtualjoystickwidget.cpp index 8e9a4fa45..8ba63daa4 100644 --- a/companion/src/simulation/widgets/virtualjoystickwidget.cpp +++ b/companion/src/simulation/widgets/virtualjoystickwidget.cpp @@ -444,7 +444,7 @@ QLayout *VirtualJoystickWidget::createNodeValueLayout(QChar type, QLabel *& valL val->setObjectName(QString("val_%1").arg(type)); val->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); val->setAlignment(Qt::AlignCenter); - val->setMinimumWidth(val->fontMetrics().width("-100 ")); + val->setMinimumWidth(val->fontMetrics().horizontalAdvance("-100 ")); QVBoxLayout * layout = new QVBoxLayout(); layout->setContentsMargins(2, 2, 2, 2); layout->setSpacing(2);