chore: 格式化ElaWidgetTools代码

This commit is contained in:
sleepwithoutbz
2025-09-20 01:39:00 +08:00
parent d2fded145d
commit 4ab391f8a1
394 changed files with 10913 additions and 15860 deletions

View File

@@ -1,18 +1,11 @@
#include "ElaPivotModel.h"
ElaPivotModel::ElaPivotModel(QObject* parent)
: QAbstractListModel{parent}
{
}
ElaPivotModel::ElaPivotModel(QObject *parent) : QAbstractListModel{parent} {}
ElaPivotModel::~ElaPivotModel()
{
}
ElaPivotModel::~ElaPivotModel() {}
void ElaPivotModel::appendPivot(QString pivot)
{
if (!pivot.isEmpty())
{
void ElaPivotModel::appendPivot(QString pivot) {
if (!pivot.isEmpty()) {
beginInsertRows(QModelIndex(), _pivotList.count(), _pivotList.count());
_pivotList.append(pivot);
endInsertRows();
@@ -20,10 +13,8 @@ void ElaPivotModel::appendPivot(QString pivot)
}
}
void ElaPivotModel::removePivot(QString pivot)
{
if (_pivotList.contains(pivot))
{
void ElaPivotModel::removePivot(QString pivot) {
if (_pivotList.contains(pivot)) {
int index = _pivotList.lastIndexOf(pivot);
beginRemoveRows(QModelIndex(), index, index);
_pivotList.removeAt(index);
@@ -31,20 +22,12 @@ void ElaPivotModel::removePivot(QString pivot)
}
}
int ElaPivotModel::getPivotListCount() const
{
return _pivotList.count();
}
int ElaPivotModel::getPivotListCount() const { return _pivotList.count(); }
int ElaPivotModel::rowCount(const QModelIndex& parent) const
{
return _pivotList.count();
}
int ElaPivotModel::rowCount(const QModelIndex &parent) const { return _pivotList.count(); }
QVariant ElaPivotModel::data(const QModelIndex& index, int role) const
{
if (role == Qt::DisplayRole)
{
QVariant ElaPivotModel::data(const QModelIndex &index, int role) const {
if (role == Qt::DisplayRole) {
return _pivotList[index.row()];
}
return QVariant();