Safetey check in TabBox's Image Provider
We cannot provide pixmaps if the client is null or the index is for "there are no windows".
This commit is contained in:
parent
43109f7264
commit
571a87a0b7
1 changed files with 6 additions and 0 deletions
|
@ -63,7 +63,13 @@ QPixmap ImageProvider::requestPixmap(const QString &id, QSize *size, const QSize
|
|||
if (!index.isValid()) {
|
||||
return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize);
|
||||
}
|
||||
if (index.model()->data(index, ClientModel::EmptyRole).toBool()) {
|
||||
return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize);
|
||||
}
|
||||
TabBoxClient* client = static_cast< TabBoxClient* >(index.model()->data(index, ClientModel::ClientRole).value<void *>());
|
||||
if (!client) {
|
||||
return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize);
|
||||
}
|
||||
|
||||
QSize s(32, 32);
|
||||
if (requestedSize.isValid()) {
|
||||
|
|
Loading…
Reference in a new issue