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:
@@ -80,7 +80,7 @@ int ConsoleItemModel::sizeOfFile(const QFont &font)
|
||||
lastReadOnlyRow -= 2; // skip editable row
|
||||
if (lastReadOnlyRow < 0)
|
||||
return 0;
|
||||
QString filename = static_cast<ConsoleItem *>(rootItem()->child(lastReadOnlyRow))->file();
|
||||
QString filename = static_cast<ConsoleItem *>(rootItem()->childAt(lastReadOnlyRow))->file();
|
||||
const int pos = filename.lastIndexOf(QLatin1Char('/'));
|
||||
if (pos != -1)
|
||||
filename = filename.mid(pos + 1);
|
||||
|
||||
Reference in New Issue
Block a user