For a reason I have not yet realized, the out-of-the-box QTableView
has row height about twice as large as QTreeView
or QListView
, at least on my system. I'm trying to figure out the default value Qt is supposed to have for this element type; sadly, the following code gets its second Q_ASSERT
triggered.
QStyle *style = QApplication::style();
Q_ASSERT(style);
QStyleOptionViewItem qsovi;
QRect rect = style->subElementRect(QStyle::SE_ItemViewItemText, &qsovi);
Q_ASSERT(rect.height() > 0); // <- triggered!
Obviously, I'm missing some initialization here. The only examples I could find copy the options data from some preexistent object, but I have nothing to copy them from - I need the default for the current style. Suggestions, anyone?