Files
qt5-legatus-legacy/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_rotate_dialog.cpp
T
2026-08-13 18:33:10 +02:00

50 lines
1.2 KiB
C++
Executable File

/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#include "asb_rotate_dialog.h"
#include "ui_asb_rotate_dialog.h"
namespace AdvancedSymbology
{
RotateDialog::RotateDialog(QWidget *parent)
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Popup)
, m_ui(new Ui_RotateDialog)
{
m_ui->setupUi(this);
m_ui->spinBoxDegree->setSuffix(QStringLiteral(" °"));
connect(m_ui->sliderHDegree, &QSlider::valueChanged, this, &RotateDialog::handleValue);
connect(m_ui->spinBoxDegree, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &RotateDialog::handleValue);
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &LtsWidgets::LtsFramelessDialog::reject);
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked, this, &LtsWidgets::LtsFramelessDialog::accept);
}
RotateDialog::~RotateDialog()
{
delete m_ui;
}
void RotateDialog::handleValue(double val)
{
sync(val);
emit rotationValueChanged(val);
}
void RotateDialog::sync(double val)
{
m_ui->sliderHDegree->setValue(int(val));
m_ui->spinBoxDegree->setValue(val);
}
}