summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-14 12:35:44 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-14 12:35:44 (GMT)
commit05145be7e502d4330ced88d3e55207a99c0a841b (patch)
tree41a76a506b286cc1c0a6bbf317c89879be7a5079 /src/gui/itemviews
parentb770651f19741907cd415ea9ad6e087cb32cc948 (diff)
downloadQt-05145be7e502d4330ced88d3e55207a99c0a841b.zip
Qt-05145be7e502d4330ced88d3e55207a99c0a841b.tar.gz
Qt-05145be7e502d4330ced88d3e55207a99c0a841b.tar.bz2
Fixed coverity warnings
Some dead code removed Some member not initialized missing
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp2
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp2
-rw-r--r--src/gui/itemviews/qitemselectionmodel_p.h2
-rw-r--r--src/gui/itemviews/qlistwidget_p.h1
-rw-r--r--src/gui/itemviews/qstandarditemmodel_p.h1
-rw-r--r--src/gui/itemviews/qtreewidget.cpp2
-rw-r--r--src/gui/itemviews/qtreewidgetitemiterator_p.h3
7 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 4f32ecc..7b51483 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -584,7 +584,7 @@ void QAbstractItemView::setModel(QAbstractItemModel *model)
"QAbstractItemView::setModel",
"The parent of a top level index should be invalid");
- if (d->model && d->model != QAbstractItemModelPrivate::staticEmptyModel()) {
+ if (d->model != QAbstractItemModelPrivate::staticEmptyModel()) {
connect(d->model, SIGNAL(destroyed()),
this, SLOT(_q_modelDestroyed()));
connect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index 2cbde51..1e36f72 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -722,8 +722,6 @@ void QItemDelegate::drawDisplay(QPainter *painter, const QStyleOptionViewItem &o
//let's add the last line (after the last QChar::LineSeparator)
elided += option.fontMetrics.elidedText(text.mid(start),
option.textElideMode, textRect.width());
- if (end != -1)
- elided += QChar::LineSeparator;
}
d->textLayout.setText(elided);
textLayoutSize = d->doTextLayout(textRect.width());
diff --git a/src/gui/itemviews/qitemselectionmodel_p.h b/src/gui/itemviews/qitemselectionmodel_p.h
index 6e1046c..e9e6bb1 100644
--- a/src/gui/itemviews/qitemselectionmodel_p.h
+++ b/src/gui/itemviews/qitemselectionmodel_p.h
@@ -65,7 +65,7 @@ public:
QItemSelectionModelPrivate()
: model(0),
currentCommand(QItemSelectionModel::NoUpdate),
- tableSelected(false) {}
+ tableSelected(false), tableColCount(0), tableRowCount(0) {}
QItemSelection expandSelection(const QItemSelection &selection,
QItemSelectionModel::SelectionFlags command) const;
diff --git a/src/gui/itemviews/qlistwidget_p.h b/src/gui/itemviews/qlistwidget_p.h
index 124222c..0851e20 100644
--- a/src/gui/itemviews/qlistwidget_p.h
+++ b/src/gui/itemviews/qlistwidget_p.h
@@ -163,7 +163,6 @@ class QListWidgetItemPrivate
public:
QListWidgetItemPrivate(QListWidgetItem *item) : q(item), theid(-1) {}
QListWidgetItem *q;
- int id;
QVector<QWidgetItemData> values;
int theid;
};
diff --git a/src/gui/itemviews/qstandarditemmodel_p.h b/src/gui/itemviews/qstandarditemmodel_p.h
index e21ac9c..5984a59 100644
--- a/src/gui/itemviews/qstandarditemmodel_p.h
+++ b/src/gui/itemviews/qstandarditemmodel_p.h
@@ -75,6 +75,7 @@ public:
parent(0),
rows(0),
columns(0),
+ q_ptr(0),
lastIndexOf(2)
{ }
virtual ~QStandardItemPrivate();
diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp
index ee7cea3..025f83c 100644
--- a/src/gui/itemviews/qtreewidget.cpp
+++ b/src/gui/itemviews/qtreewidget.cpp
@@ -2074,6 +2074,8 @@ QList<QTreeWidgetItem*> QTreeWidgetItem::takeChildren()
void QTreeWidgetItemPrivate::sortChildren(int column, Qt::SortOrder order, bool climb)
{
QTreeModel *model = (q->view ? qobject_cast<QTreeModel*>(q->view->model()) : 0);
+ if (!model)
+ return;
model->sortItems(&q->children, column, order);
if (climb) {
QList<QTreeWidgetItem*>::iterator it = q->children.begin();
diff --git a/src/gui/itemviews/qtreewidgetitemiterator_p.h b/src/gui/itemviews/qtreewidgetitemiterator_p.h
index 3ffe823..ee0808c 100644
--- a/src/gui/itemviews/qtreewidgetitemiterator_p.h
+++ b/src/gui/itemviews/qtreewidgetitemiterator_p.h
@@ -73,7 +73,8 @@ public:
}
QTreeWidgetItemIteratorPrivate(const QTreeWidgetItemIteratorPrivate& other)
- : m_currentIndex(other.m_currentIndex), m_model(other.m_model), m_parentIndex(other.m_parentIndex)
+ : m_currentIndex(other.m_currentIndex), m_model(other.m_model),
+ m_parentIndex(other.m_parentIndex), q_ptr(other.q_ptr)
{
}