QStandardItemModel behaves differently than other models. If it doesn't have any rows, it ignores its column count and thus you get an empty viewport. You need to provide info about the columns manually just like you did (another way would be to use QStandardItemModel::setHorizontalHeaderItem()).





Reply With Quote
Bookmarks