forked from qt-creator/qt-creator
TreeModel: Consolidate child()/childAt() and rowCount()/childCount()
We never used the possibility to overload the virtual child() and rowCount() functions, it's unlikely to be needed in future. Change-Id: I7ebdf4dfc70bb0bcadea9ef3fb88f16632a95696 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -279,7 +279,7 @@ QVariant FrameItem::data(int column, int role) const
|
||||
return QVariant::fromValue(getErrorItem()->error());
|
||||
case Qt::DisplayRole: {
|
||||
const int row = parent()->children().indexOf(const_cast<FrameItem *>(this)) + 1;
|
||||
const int padding = static_cast<int>(std::log10(parent()->rowCount()))
|
||||
const int padding = static_cast<int>(std::log10(parent()->childCount()))
|
||||
- static_cast<int>(std::log10(row));
|
||||
return QString::fromLatin1("%1%2: %3")
|
||||
.arg(QString(padding, QLatin1Char(' ')))
|
||||
|
||||
Reference in New Issue
Block a user