summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-17 10:01:21 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-17 10:52:07 (GMT)
commit213e2c937b667dba7e4996b0857ae5791c6d5fc8 (patch)
treeb8db403c4859966fa7a18fcf413a00cf8e3eecd4 /src/gui
parent83940f25dba51a9942ab55ed8475fc7fc8a8da84 (diff)
downloadQt-213e2c937b667dba7e4996b0857ae5791c6d5fc8.zip
Qt-213e2c937b667dba7e4996b0857ae5791c6d5fc8.tar.gz
Qt-213e2c937b667dba7e4996b0857ae5791c6d5fc8.tar.bz2
Fixed coverity warnings
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qlistview.cpp1
-rw-r--r--src/gui/itemviews/qlistview_p.h7
-rw-r--r--src/gui/itemviews/qtreewidget.cpp1
-rw-r--r--src/gui/painting/qpdf.cpp2
-rw-r--r--src/gui/styles/qstyleoption.cpp6
-rw-r--r--src/gui/text/qcssparser_p.h2
6 files changed, 10 insertions, 9 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 1870a3b..3ab3204 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -1957,7 +1957,6 @@ bool QListView::event(QEvent *e)
QListViewPrivate::QListViewPrivate()
: QAbstractItemViewPrivate(),
dynamicListView(0),
- staticListView(0),
wrap(false),
space(0),
flow(QListView::TopToBottom),
diff --git a/src/gui/itemviews/qlistview_p.h b/src/gui/itemviews/qlistview_p.h
index 1131059..6c8d324 100644
--- a/src/gui/itemviews/qlistview_p.h
+++ b/src/gui/itemviews/qlistview_p.h
@@ -351,9 +351,10 @@ public:
QItemViewPaintPairs draggablePaintPairs(const QModelIndexList &indexes, QRect *r) const;
- // ### FIXME: we only need one at a time
- QDynamicListViewBase *dynamicListView;
- QStaticListViewBase *staticListView;
+ union {
+ QDynamicListViewBase *dynamicListView;
+ QStaticListViewBase *staticListView;
+ };
// ### FIXME: see if we can move the members into the dynamic/static classes
diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp
index 025f83c..1ab69df 100644
--- a/src/gui/itemviews/qtreewidget.cpp
+++ b/src/gui/itemviews/qtreewidget.cpp
@@ -1768,6 +1768,7 @@ QVariant QTreeWidgetItem::data(int column, int role) const
// special case for check state in tristate
if (children.count() && (itemFlags & Qt::ItemIsTristate))
return childrenCheckState(column);
+ // fallthrough intended
default:
if (column >= 0 && column < values.size()) {
const QVector<QWidgetItemData> &column_values = values.at(column);
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 6a7889a..478a2a8 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -313,7 +313,7 @@ QByteArray QPdf::generatePath(const QPainterPath &path, const QTransform &matrix
Qt::FillRule fillRule = path.fillRule();
- const char *op = 0;
+ const char *op = "";
switch (flags) {
case ClipPath:
op = (fillRule == Qt::WindingFill) ? "W n\n" : "W* n\n";
diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp
index 98996e2..eabbb8d 100644
--- a/src/gui/styles/qstyleoption.cpp
+++ b/src/gui/styles/qstyleoption.cpp
@@ -712,7 +712,7 @@ QStyleOptionFrameV2 &QStyleOptionFrameV2::operator=(const QStyleOptionFrame &oth
Constructs a QStyleOptionFrameV3 object.
*/
QStyleOptionFrameV3::QStyleOptionFrameV3()
- : QStyleOptionFrameV2(Version), frameShape(QFrame::NoFrame)
+ : QStyleOptionFrameV2(Version), frameShape(QFrame::NoFrame), unused(0)
{
}
@@ -726,7 +726,7 @@ QStyleOptionFrameV3::QStyleOptionFrameV3()
\internal
*/
QStyleOptionFrameV3::QStyleOptionFrameV3(int version)
- : QStyleOptionFrameV2(version), frameShape(QFrame::NoFrame)
+ : QStyleOptionFrameV2(version), frameShape(QFrame::NoFrame), unused(0)
{
}
@@ -4845,7 +4845,7 @@ QStyleOptionTabBarBaseV2 &QStyleOptionTabBarBaseV2::operator = (const QStyleOpti
/*! \internal */
QStyleOptionTabBarBaseV2::QStyleOptionTabBarBaseV2(int version)
- : QStyleOptionTabBarBase(version)
+ : QStyleOptionTabBarBase(version), documentMode(false)
{
}
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h
index c685b08..6f73445 100644
--- a/src/gui/text/qcssparser_p.h
+++ b/src/gui/text/qcssparser_p.h
@@ -504,7 +504,7 @@ const int NumPseudos = 46;
struct Pseudo
{
- Pseudo() : negated(false) { }
+ Pseudo() : type(0), negated(false) { }
quint64 type;
QString name;
QString function;