Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QStyleOptionViewItem QListView::viewOptions (  )  const [protected, virtual, inherited]

Reimplemented from QAbstractItemView.

Definition at line 989 of file qlistview.cpp.

References QStyleOptionViewItem::decorationPosition, QStyleOptionViewItem::decorationSize, QStyleOptionViewItem::displayAlignment, QStyle::pixelMetric(), QStyleOptionViewItem::showDecorationSelected, QWidget::style(), and QAbstractItemView::viewOptions().

{
    Q_D(const QListView);
    QStyleOptionViewItem option = QAbstractItemView::viewOptions();
    if (!d->iconSize.isValid()) { // otherwise it was already set in abstractitemview
        int pm = (d->viewMode == ListMode
                  ? style()->pixelMetric(QStyle::PM_ListViewIconSize)
                  : style()->pixelMetric(QStyle::PM_IconViewIconSize));
        option.decorationSize = QSize(pm, pm);
    }
    if (d->viewMode == IconMode) {
        option.showDecorationSelected = false;
        option.decorationPosition = QStyleOptionViewItem::Top;
        option.displayAlignment = Qt::AlignCenter;
    } else {
        option.decorationPosition = QStyleOptionViewItem::Left;
    }
    return option;
}


Generated by  Doxygen 1.6.0   Back to index