1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-23 18:23:53 +00:00
openmw/apps/opencs/view/widget/completerpopup.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
796 B
C++
Raw Normal View History

#include "completerpopup.hpp"
CSVWidget::CompleterPopup::CompleterPopup(QWidget* parent)
: QListView(parent)
{
setEditTriggers(QAbstractItemView::NoEditTriggers);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setSelectionBehavior(QAbstractItemView::SelectRows);
setSelectionMode(QAbstractItemView::SingleSelection);
}
int CSVWidget::CompleterPopup::sizeHintForRow(int row) const
{
2018-10-09 06:21:12 +00:00
if (model() == nullptr)
{
return -1;
}
if (row < 0 || row >= model()->rowCount())
{
return -1;
}
ensurePolished();
QModelIndex index = model()->index(row, modelColumn());
QStyleOptionViewItem option = viewOptions();
QAbstractItemDelegate* delegate = itemDelegate(index);
return delegate->sizeHint(option, index).height();
}