change: change code style to Linux style except indent.
This commit is contained in:
@@ -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 ¤t, const QModelIndex &previous)
|
||||
void HistoryWidget::currentRowChanged(const QModelIndex ¤t,
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user