Commit 56d96cd6 authored by Friedemann Kleint's avatar Friedemann Kleint Committed by Thomas Hartmann
Browse files

QML-Designer: Fix crash when loading form.

Change-Id: Ia540636acf13744a631e097377650d002fdc7e09
Reviewed-by: default avatarThomas Hartmann <>
parent 91dc7ddb
......@@ -188,8 +188,14 @@ void ResourceItemDelegate::paint(QPainter *painter,
QSize ResourceItemDelegate::sizeHint(const QStyleOptionViewItem &/*option*/,
const QModelIndex &index) const
QIcon icon(m_model->fileIcon(index));
return icon.availableSizes().front() + QSize(25, 4);
QSize result = QSize(25, 4);
const QIcon icon(m_model->fileIcon(index));
if (!icon.isNull()) {
const QList<QSize> sizes = icon.availableSizes();
if (!sizes.isEmpty())
result += sizes.front();
return result;
void ResourceItemDelegate::setModel(QFileSystemModel *model)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment