chore: 格式化ElaWidgetTools代码
This commit is contained in:
@@ -1,29 +1,18 @@
|
||||
#include "ElaSuggestModel.h"
|
||||
|
||||
ElaSuggestModel::ElaSuggestModel(QObject* parent)
|
||||
: QAbstractListModel{parent}
|
||||
{
|
||||
}
|
||||
ElaSuggestModel::ElaSuggestModel(QObject *parent) : QAbstractListModel{parent} {}
|
||||
|
||||
ElaSuggestModel::~ElaSuggestModel()
|
||||
{
|
||||
}
|
||||
ElaSuggestModel::~ElaSuggestModel() {}
|
||||
|
||||
int ElaSuggestModel::rowCount(const QModelIndex& parent) const
|
||||
{
|
||||
int ElaSuggestModel::rowCount(const QModelIndex &parent) const {
|
||||
Q_UNUSED(parent)
|
||||
return _suggestionVector.count();
|
||||
}
|
||||
|
||||
QVariant ElaSuggestModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
QVariant ElaSuggestModel::data(const QModelIndex &index, int role) const { return QVariant(); }
|
||||
|
||||
void ElaSuggestModel::setSearchSuggestion(QVector<ElaSuggestion*> suggestionVector)
|
||||
{
|
||||
if (suggestionVector.count() == 0)
|
||||
{
|
||||
void ElaSuggestModel::setSearchSuggestion(QVector<ElaSuggestion *> suggestionVector) {
|
||||
if (suggestionVector.count() == 0) {
|
||||
return;
|
||||
}
|
||||
beginResetModel();
|
||||
@@ -31,15 +20,10 @@ void ElaSuggestModel::setSearchSuggestion(QVector<ElaSuggestion*> suggestionVect
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void ElaSuggestModel::clearSearchNode()
|
||||
{
|
||||
this->_suggestionVector.clear();
|
||||
}
|
||||
void ElaSuggestModel::clearSearchNode() { this->_suggestionVector.clear(); }
|
||||
|
||||
ElaSuggestion* ElaSuggestModel::getSearchSuggestion(int row)
|
||||
{
|
||||
if (row >= _suggestionVector.count())
|
||||
{
|
||||
ElaSuggestion *ElaSuggestModel::getSearchSuggestion(int row) {
|
||||
if (row >= _suggestionVector.count()) {
|
||||
return nullptr;
|
||||
}
|
||||
return _suggestionVector[row];
|
||||
|
||||
Reference in New Issue
Block a user