change: change code style to Linux style except indent.

This commit is contained in:
Mike Solar
2025-08-03 03:09:40 +08:00
parent 65ab76edc8
commit 74f73ab3be
789 changed files with 77113 additions and 68888 deletions
@@ -25,64 +25,70 @@
#include "node/node.h"
namespace olive {
NodeParamViewArrayWidget::NodeParamViewArrayWidget(Node *node, const QString &input, QWidget* parent) :
QWidget(parent),
node_(node),
input_(input)
namespace olive
{
QHBoxLayout* layout = new QHBoxLayout(this);
count_lbl_ = new QLabel();
layout->addWidget(count_lbl_);
NodeParamViewArrayWidget::NodeParamViewArrayWidget(Node *node,
const QString &input,
QWidget *parent)
: QWidget(parent)
, node_(node)
, input_(input)
{
QHBoxLayout *layout = new QHBoxLayout(this);
connect(node_, &Node::InputArraySizeChanged, this, &NodeParamViewArrayWidget::UpdateCounter);
count_lbl_ = new QLabel();
layout->addWidget(count_lbl_);
UpdateCounter(input_, 0, node_->InputArraySize(input_));
connect(node_, &Node::InputArraySizeChanged, this,
&NodeParamViewArrayWidget::UpdateCounter);
UpdateCounter(input_, 0, node_->InputArraySize(input_));
}
void NodeParamViewArrayWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
QWidget::mouseDoubleClickEvent(event);
QWidget::mouseDoubleClickEvent(event);
emit DoubleClicked();
emit DoubleClicked();
}
void NodeParamViewArrayWidget::UpdateCounter(const QString& input, int old_size, int new_size)
void NodeParamViewArrayWidget::UpdateCounter(const QString &input, int old_size,
int new_size)
{
Q_UNUSED(old_size)
if (input == input_) {
count_lbl_->setText(tr("%n element(s)", nullptr, new_size));
}
Q_UNUSED(old_size)
if (input == input_) {
count_lbl_->setText(tr("%n element(s)", nullptr, new_size));
}
}
NodeParamViewArrayButton::NodeParamViewArrayButton(NodeParamViewArrayButton::Type type, QWidget *parent) :
QPushButton(parent),
type_(type)
NodeParamViewArrayButton::NodeParamViewArrayButton(
NodeParamViewArrayButton::Type type, QWidget *parent)
: QPushButton(parent)
, type_(type)
{
Retranslate();
Retranslate();
int sz = sizeHint().height() / 3 * 2;
setFixedSize(sz, sz);
int sz = sizeHint().height() / 3 * 2;
setFixedSize(sz, sz);
}
void NodeParamViewArrayButton::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange) {
Retranslate();
}
if (event->type() == QEvent::LanguageChange) {
Retranslate();
}
QPushButton::changeEvent(event);
QPushButton::changeEvent(event);
}
void NodeParamViewArrayButton::Retranslate()
{
if (type_ == kAdd) {
setText(tr("+"));
} else {
setText(tr("-"));
}
if (type_ == kAdd) {
setText(tr("+"));
} else {
setText(tr("-"));
}
}
}