summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-03-01 15:52:15 +0100
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-03-01 15:52:42 +0100
commite24247b07c6450881094200e729390b676f911aa (patch)
tree79f1432dc78bc1778f7886f7e2d6f3bb8b7f1d06 /demos
parentd628a467159b79c85885acb21510cb1e646a968b (diff)
downloadqt4-tools-e24247b07c6450881094200e729390b676f911aa.tar.gz
Interview Demo: Fix warning about pixmap leak on X11.
Reviewed-by: Trond Kjernåsen <trond.kjernasen@nokia.com>
Diffstat (limited to 'demos')
-rw-r--r--demos/interview/model.cpp2
-rw-r--r--demos/interview/model.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/demos/interview/model.cpp b/demos/interview/model.cpp
index 3f9548a6cd..840bc605df 100644
--- a/demos/interview/model.cpp
+++ b/demos/interview/model.cpp
@@ -45,6 +45,7 @@
Model::Model(int rows, int columns, QObject *parent)
: QAbstractItemModel(parent),
+ services(QPixmap(":/images/services.png")),
rc(rows), cc(columns),
tree(new QVector<Node>(rows, Node(0)))
{
@@ -105,7 +106,6 @@ QVariant Model::data(const QModelIndex &index, int role) const
QVariant Model::headerData(int section, Qt::Orientation orientation, int role) const
{
- static QIcon services(QPixmap(":/images/services.png"));
if (role == Qt::DisplayRole)
return QString::number(section);
if (role == Qt::DecorationRole)
diff --git a/demos/interview/model.h b/demos/interview/model.h
index bad83a800c..c7c15f7ebc 100644
--- a/demos/interview/model.h
+++ b/demos/interview/model.h
@@ -44,6 +44,7 @@
#include <QAbstractItemModel>
#include <QFileIconProvider>
+#include <QIcon>
#include <QVector>
class Model : public QAbstractItemModel
@@ -80,6 +81,7 @@ private:
Node *parent(Node *child) const;
int row(Node *node) const;
+ QIcon services;
int rc, cc;
QVector<Node> *tree;
QFileIconProvider iconProvider;