2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2022-04-02 12:15:26 +02:00
|
|
|
|
|
|
|
|
#include "qmljscodestylesettingswidget.h"
|
2022-04-07 21:56:10 +02:00
|
|
|
|
2022-04-02 12:15:26 +02:00
|
|
|
#include "qmljscodestylesettings.h"
|
2022-04-07 21:56:10 +02:00
|
|
|
#include "ui_qmljscodestylesettingswidget.h"
|
2022-04-02 12:15:26 +02:00
|
|
|
|
|
|
|
|
#include <QTextStream>
|
|
|
|
|
|
|
|
|
|
namespace QmlJSTools {
|
|
|
|
|
|
|
|
|
|
QmlJSCodeStyleSettingsWidget::QmlJSCodeStyleSettingsWidget(QWidget *parent) :
|
|
|
|
|
QGroupBox(parent),
|
|
|
|
|
ui(new Internal::Ui::QmlJSCodeStyleSettingsWidget)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
2022-07-20 00:35:01 +02:00
|
|
|
connect(ui->lineLengthSpinBox, &QSpinBox::valueChanged,
|
2022-04-02 12:15:26 +02:00
|
|
|
this, &QmlJSCodeStyleSettingsWidget::slotSettingsChanged);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QmlJSCodeStyleSettingsWidget::~QmlJSCodeStyleSettingsWidget()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlJSCodeStyleSettingsWidget::setCodeStyleSettings(const QmlJSCodeStyleSettings& s)
|
|
|
|
|
{
|
|
|
|
|
QSignalBlocker blocker(this);
|
|
|
|
|
ui->lineLengthSpinBox->setValue(s.lineLength);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QmlJSCodeStyleSettings QmlJSCodeStyleSettingsWidget::codeStyleSettings() const
|
|
|
|
|
{
|
|
|
|
|
QmlJSCodeStyleSettings set;
|
|
|
|
|
|
|
|
|
|
set.lineLength = ui->lineLengthSpinBox->value();
|
|
|
|
|
|
|
|
|
|
return set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QmlJSCodeStyleSettingsWidget::slotSettingsChanged()
|
|
|
|
|
{
|
|
|
|
|
emit settingsChanged(codeStyleSettings());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace TextEditor
|