[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [krecipes] src/models: Set parents properly for models.
From: José_Manuel_Santamaría_Lema <panfaust () gmail ! com>
Date: 2016-04-08 12:47:47
Message-ID: E1aoVpD-0005cJ-2v () scm ! kde ! org
[Download RAW message or body]
Git commit 8effd13c3f0f246260fd8b8e4fb8067bd9d8a1e2 by José Manuel Santamaría Lema.
Committed on 08/04/2016 at 11:59.
Pushed by joselema into branch 'master'.
Set parents properly for models.
M +2 -2 src/models/kreallingredientsmodels.cpp
M +2 -2 src/models/kresinglecolumnproxymodel.cpp
M +1 -1 src/models/kresinglecolumnproxymodel.h
http://commits.kde.org/krecipes/8effd13c3f0f246260fd8b8e4fb8067bd9d8a1e2
diff --git a/src/models/kreallingredientsmodels.cpp b/src/models/kreallingredientsmodels.cpp
index aca6d89..d8425ab 100644
--- a/src/models/kreallingredientsmodels.cpp
+++ b/src/models/kreallingredientsmodels.cpp
@@ -18,8 +18,8 @@
KreAllIngredientsModels::KreAllIngredientsModels( RecipeDB * database ):
m_database( database )
{
- m_sourceModel = new QStandardItemModel;
- m_ingredientNameModel = new KreSingleColumnProxyModel( 1 );
+ m_sourceModel = new QStandardItemModel( this );
+ m_ingredientNameModel = new KreSingleColumnProxyModel( 1, this );
m_ingredientNameModel->setSortCaseSensitivity( Qt::CaseInsensitive );
m_ingredientNameModel->setSourceModel( m_sourceModel );
m_ingredientNameCompletion = new KCompletion;
diff --git a/src/models/kresinglecolumnproxymodel.cpp b/src/models/kresinglecolumnproxymodel.cpp
index c28ef35..eda4a96 100644
--- a/src/models/kresinglecolumnproxymodel.cpp
+++ b/src/models/kresinglecolumnproxymodel.cpp
@@ -9,8 +9,8 @@
#include "kresinglecolumnproxymodel.h"
-KreSingleColumnProxyModel::KreSingleColumnProxyModel( int column ):
- QSortFilterProxyModel( 0 ),
+KreSingleColumnProxyModel::KreSingleColumnProxyModel( int column, QObject * parent ):
+ QSortFilterProxyModel( parent ),
m_acceptedColumn( column )
{
}
diff --git a/src/models/kresinglecolumnproxymodel.h b/src/models/kresinglecolumnproxymodel.h
index fdeffa5..63de61e 100644
--- a/src/models/kresinglecolumnproxymodel.h
+++ b/src/models/kresinglecolumnproxymodel.h
@@ -16,7 +16,7 @@ class KreSingleColumnProxyModel: public QSortFilterProxyModel {
Q_OBJECT
public:
- KreSingleColumnProxyModel( int column );
+ KreSingleColumnProxyModel( int column, QObject * parent = 0 );
protected:
bool filterAcceptsColumn( int source_column,
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic