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
+19 -13
View File
@@ -22,28 +22,34 @@
#include "core.h"
namespace olive {
HistoryWidget::HistoryWidget(QWidget *parent) :
QTreeView(parent)
namespace olive
{
stack_ = Core::instance()->undo_stack();
this->setModel(stack_);
this->setRootIsDecorated(false);
connect(stack_, &UndoStack::indexChanged, this, &HistoryWidget::indexChanged);
connect(this->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &HistoryWidget::currentRowChanged);
HistoryWidget::HistoryWidget(QWidget *parent)
: QTreeView(parent)
{
stack_ = Core::instance()->undo_stack();
this->setModel(stack_);
this->setRootIsDecorated(false);
connect(stack_, &UndoStack::indexChanged, this,
&HistoryWidget::indexChanged);
connect(this->selectionModel(), &QItemSelectionModel::currentRowChanged,
this, &HistoryWidget::currentRowChanged);
}
void HistoryWidget::indexChanged(int i)
{
this->selectionModel()->select(this->model()->index(i-1, 0), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
this->selectionModel()->select(this->model()->index(i - 1, 0),
QItemSelectionModel::ClearAndSelect |
QItemSelectionModel::Rows);
}
void HistoryWidget::currentRowChanged(const QModelIndex &current, const QModelIndex &previous)
void HistoryWidget::currentRowChanged(const QModelIndex &current,
const QModelIndex &previous)
{
size_t jump_to = (current.row() + 1);
stack_->jump(jump_to);
size_t jump_to = (current.row() + 1);
stack_->jump(jump_to);
}
}