From 16ef9988d7efd3a16dddf4825a99c5f14af5aff6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 3 Jul 2020 08:04:05 -0400 Subject: [PATCH] WVectorEditor: Make use of Qt 5 signals and slots --- src/Editor/Widgets/WVectorEditor.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Editor/Widgets/WVectorEditor.cpp b/src/Editor/Widgets/WVectorEditor.cpp index 1784fb65..0175fc3e 100644 --- a/src/Editor/Widgets/WVectorEditor.cpp +++ b/src/Editor/Widgets/WVectorEditor.cpp @@ -160,9 +160,9 @@ void WVectorEditor::SetZ(double Z) void WVectorEditor::SetupUI() { // Create and initialize widgets - mpLabelX = new QLabel("X", this); - mpLabelY = new QLabel("Y", this); - mpLabelZ = new QLabel("Z", this); + mpLabelX = new QLabel(tr("X"), this); + mpLabelY = new QLabel(tr("Y"), this); + mpLabelZ = new QLabel(tr("Z"), this); mpSpinBoxX = new WDraggableSpinBox(this); mpSpinBoxY = new WDraggableSpinBox(this); mpSpinBoxZ = new WDraggableSpinBox(this); @@ -175,12 +175,12 @@ void WVectorEditor::SetupUI() mpSpinBoxX->setContextMenuPolicy(Qt::NoContextMenu); mpSpinBoxY->setContextMenuPolicy(Qt::NoContextMenu); mpSpinBoxZ->setContextMenuPolicy(Qt::NoContextMenu); - connect(mpSpinBoxX, SIGNAL(valueChanged(double)), this, SLOT(SetX(double))); - connect(mpSpinBoxY, SIGNAL(valueChanged(double)), this, SLOT(SetY(double))); - connect(mpSpinBoxZ, SIGNAL(valueChanged(double)), this, SLOT(SetZ(double))); - connect(mpSpinBoxX, SIGNAL(editingFinished()), this, SLOT(OnSpinBoxEditingDone())); - connect(mpSpinBoxY, SIGNAL(editingFinished()), this, SLOT(OnSpinBoxEditingDone())); - connect(mpSpinBoxZ, SIGNAL(editingFinished()), this, SLOT(OnSpinBoxEditingDone())); + connect(mpSpinBoxX, qOverload(&WDraggableSpinBox::valueChanged), this, &WVectorEditor::SetX); + connect(mpSpinBoxY, qOverload(&WDraggableSpinBox::valueChanged), this, &WVectorEditor::SetY); + connect(mpSpinBoxZ, qOverload(&WDraggableSpinBox::valueChanged), this, &WVectorEditor::SetZ); + connect(mpSpinBoxX, &WDraggableSpinBox::editingFinished, this, &WVectorEditor::OnSpinBoxEditingDone); + connect(mpSpinBoxY, &WDraggableSpinBox::editingFinished, this, &WVectorEditor::OnSpinBoxEditingDone); + connect(mpSpinBoxZ, &WDraggableSpinBox::editingFinished, this, &WVectorEditor::OnSpinBoxEditingDone); // Create and initialize spinbox layouts mpXLayout = new QHBoxLayout();