From 5ecdb1a77b06956d3475f7d19dc573815233595a Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 17 Mar 2010 12:00:12 +0100 Subject: add default values to parameter of virtual methods in QProxyModel That makes it consistent with the other models. Task-number: QTBUG-8766 Reviewed-by: gabi --- src/gui/itemviews/qproxymodel.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/gui/itemviews/qproxymodel.h b/src/gui/itemviews/qproxymodel.h index 1a6b14b..f179a7a 100644 --- a/src/gui/itemviews/qproxymodel.h +++ b/src/gui/itemviews/qproxymodel.h @@ -67,19 +67,19 @@ public: // implementing model interface - QModelIndex index(int row, int column, const QModelIndex &parent) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &child) const; - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; - bool hasChildren(const QModelIndex &parent) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + bool hasChildren(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); - QVariant headerData(int section, Qt::Orientation orientation, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, - int role); + int role = Qt::EditRole); QStringList mimeTypes() const; QMimeData *mimeData(const QModelIndexList &indexes) const; @@ -87,16 +87,17 @@ public: int row, int column, const QModelIndex &parent); Qt::DropActions supportedDropActions() const; - bool insertRows(int row, int count, const QModelIndex &parent); - bool insertColumns(int column, int count, const QModelIndex &parent); + bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()); + bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()); void fetchMore(const QModelIndex &parent); Qt::ItemFlags flags(const QModelIndex &index) const; - void sort(int column, Qt::SortOrder order); + void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, - int hits, Qt::MatchFlags flags) const; + int hits = 1, Qt::MatchFlags flags = + Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const; QSize span(const QModelIndex &index) const; -- cgit v0.12