forked from qt-creator/qt-creator
AnalyzerBase: Return base sizeHint() for invalid indices
DetailedErrorDelegate::sizeHint() calls createDetailsWidget() even for
invalid indices, which does not make any sense.
With this change the following messages will not be displayed anymore
when switching to the the Clang Static Analyzer:
QWidget::setMinimumSize: (/QWidget) Negative sizes (636,-1) are not possible
QWidget::setMaximumSize: (/QWidget) Negative sizes (636,-1) are not possible
Task-number: QCE-28
Change-Id: I7d45b2625ad94ddccfbb2c22ff5c07ee0bdd1256
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -51,6 +51,9 @@ DetailedErrorDelegate::DetailedErrorDelegate(QListView *parent)
|
||||
QSize DetailedErrorDelegate::sizeHint(const QStyleOptionViewItem &opt,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return QStyledItemDelegate::sizeHint(opt, index);
|
||||
|
||||
const QListView *view = qobject_cast<const QListView *>(parent());
|
||||
const int viewportWidth = view->viewport()->width();
|
||||
const bool isSelected = view->selectionModel()->currentIndex() == index;
|
||||
|
||||
Reference in New Issue
Block a user