Changeset View
Changeset View
Standalone View
Standalone View
src/iconsidepane.cpp
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Line(s) | 199 | public: | |||
---|---|---|---|---|---|
206 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override | 206 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override | ||
207 | { | 207 | { | ||
208 | if (!index.isValid() || !index.internalPointer()) { | 208 | if (!index.isValid() || !index.internalPointer()) { | ||
209 | return; | 209 | return; | ||
210 | } | 210 | } | ||
211 | 211 | | |||
212 | QStyleOptionViewItem optionCopy(*static_cast<const QStyleOptionViewItem *>(&option)); | 212 | QStyleOptionViewItem optionCopy(*static_cast<const QStyleOptionViewItem *>(&option)); | ||
213 | optionCopy.decorationPosition = QStyleOptionViewItem::Top; | 213 | optionCopy.decorationPosition = QStyleOptionViewItem::Top; | ||
214 | #if QT_VERSION < QT_VERSION_CHECK(5,9,0) | ||||
214 | const int height = QFontMetrics(painter->font()).height(); | 215 | const int height = QFontMetrics(painter->font()).height(); | ||
216 | #else | ||||
217 | const int height = 0; | ||||
218 | #endif | ||||
215 | optionCopy.decorationSize | 219 | optionCopy.decorationSize | ||
216 | = mNavigator->showIcons() ? QSize(mNavigator->iconSize(), mNavigator->iconSize() + height) : QSize(); | 220 | = mNavigator->showIcons() ? QSize(mNavigator->iconSize(), mNavigator->iconSize() + height) : QSize(); | ||
217 | optionCopy.textElideMode = Qt::ElideNone; | 221 | optionCopy.textElideMode = Qt::ElideNone; | ||
218 | QStyledItemDelegate::paint(painter, optionCopy, index); | 222 | QStyledItemDelegate::paint(painter, optionCopy, index); | ||
219 | } | 223 | } | ||
220 | 224 | | |||
221 | QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override | 225 | QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override | ||
222 | { | 226 | { | ||
▲ Show 20 Lines • Show All 364 Lines • Show Last 20 Lines |