[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [pykde5] /: Added kitemmodels.
From: Simon Edwards <simon () simonzone ! com>
Date: 2014-01-18 15:09:34
Message-ID: E1W4XWg-0000qQ-Pc () scm ! kde ! org
[Download RAW message or body]
Git commit 8bf0ad729d458c69612086ab01c8babcd108d882 by Simon Edwards.
Committed on 18/01/2014 at 15:08.
Pushed by sedwards into branch 'master'.
Added kitemmodels.
M +12 -6 CMakeLists.txt
A +41 -0 sip/kitemmodels/kbreadcrumbselectionmodel.sip
A +37 -0 sip/kitemmodels/kcheckableproxymodel.sip
A +49 -0 sip/kitemmodels/kdescendantsproxymodel.sip
A +34 -0 sip/kitemmodels/kitemmodelsmod.sip
A +31 -0 sip/kitemmodels/klinkitemselectionmodel.sip
A +33 -0 sip/kitemmodels/kmodelindexproxymapper.sip
A +34 -0 sip/kitemmodels/krecursivefilterproxymodel.sip
A +60 -0 sip/kitemmodels/kselectionproxymodel.sip
http://commits.kde.org/pykde5/8bf0ad729d458c69612086ab01c8babcd108d882
diff --git a/CMakeLists.txt b/CMakeLists.txt
index abb7782..a761b5e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@ include(PythonMacros)
include(FeatureSummary)
include(ECMSetupVersion)
-find_package(KF5 CONFIG REQUIRED Auth)
+find_package(KF5 CONFIG REQUIRED Auth ItemModels)
#option(PYKDEUIC4_ALTINSTALL "Enable parallel-installation of the PyKDE4 tools" FALSE)
@@ -35,8 +35,6 @@ set_package_properties(PythonInterp PROPERTIES
URL "http://www.python.org" TYPE REQUIRED
PURPOSE "Required to build PyKDE4")
-#include_directories(${KDE4_INCLUDES})
-
find_package(SIP)
set_package_properties(SIP PROPERTIES DESCRIPTION "The SIP binding generator"
URL "http://riverbankcomputing.com" TYPE REQUIRED
@@ -83,6 +81,9 @@ else (PYTHON_VERSION_MAJOR GREATER 2)
endif()
endif ()
+include_directories(
+ ${SIP_INCLUDE_DIR})
+
add_definitions(-D_REENTRANT -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public)
###############################################################################
@@ -90,9 +91,14 @@ add_definitions(-D_REENTRANT -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public)
###############################################################################
# kauth
-file(GLOB kauth_files_sip sip/kauth/*.sip)
-set(SIP_EXTRA_FILES_DEPEND ${kauth_files_sip})
-add_sip_python_module(PyKDE5.kauth sip/kauth/kauthmod.sip KF5::Auth)
+#file(GLOB kauth_files_sip sip/kauth/*.sip)
+#set(SIP_EXTRA_FILES_DEPEND ${kauth_files_sip})
+#add_sip_python_module(PyKDE5.kauth sip/kauth/kauthmod.sip KF5::Auth)
+
+# kitemmodels
+file(GLOB kitemmodels_files_sip sip/kitemmodels/*.sip)
+set(SIP_EXTRA_FILES_DEPEND ${kitemmodels_files_sip})
+add_sip_python_module(PyKDE5.kitemmodels sip/kitemmodels/kitemmodelsmod.sip KF5::ItemModels)
set(PYKDE_MODULES "kauth")
###############################################################################
diff --git a/sip/kitemmodels/kbreadcrumbselectionmodel.sip \
b/sip/kitemmodels/kbreadcrumbselectionmodel.sip new file mode 100644
index 0000000..e0ab18c
--- /dev/null
+++ b/sip/kitemmodels/kbreadcrumbselectionmodel.sip
@@ -0,0 +1,41 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class KBreadcrumbSelectionModel : QItemSelectionModel
+{
+%TypeHeaderCode
+#include <kbreadcrumbselectionmodel.h>
+%End
+
+public:
+ enum BreadcrumbTarget
+ {
+ MakeBreadcrumbSelectionInOther,
+ MakeBreadcrumbSelectionInSelf
+ };
+ explicit KBreadcrumbSelectionModel (QItemSelectionModel* selectionModel, QObject* \
parent = 0); + KBreadcrumbSelectionModel (QItemSelectionModel* selectionModel, \
KBreadcrumbSelectionModel::BreadcrumbTarget target, QObject* parent = 0); + virtual \
~KBreadcrumbSelectionModel (); + bool isActualSelectionIncluded () const;
+ void setActualSelectionIncluded (bool isActualSelectionIncluded);
+ int breadcrumbLength () const;
+ void setBreadcrumbLength (int breadcrumbLength);
+ void select (const QModelIndex& index, QItemSelectionModel::SelectionFlags \
command); + void select (const QItemSelection& selection, \
QItemSelectionModel::SelectionFlags command); +};
diff --git a/sip/kitemmodels/kcheckableproxymodel.sip b/sip/kitemmodels/kcheckableproxymodel.sip
new file mode 100644
index 0000000..c4d3e04
--- /dev/null
+++ b/sip/kitemmodels/kcheckableproxymodel.sip
@@ -0,0 +1,37 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class KCheckableProxyModel : QIdentityProxyModel
+{
+%TypeHeaderCode
+#include <kcheckableproxymodel.h>
+%End
+
+public:
+ KCheckableProxyModel (QObject* parent = 0);
+ ~KCheckableProxyModel ();
+ void setSelectionModel (QItemSelectionModel* itemSelectionModel);
+ QItemSelectionModel* selectionModel () const;
+ Qt::ItemFlags flags (const QModelIndex& index) const;
+ QVariant data (const QModelIndex& index, int role = Qt::DisplayRole) const;
+ bool setData (const QModelIndex& index, const QVariant& value, int role = \
Qt::EditRole); + void setSourceModel (QAbstractItemModel* sourceModel);
+protected:
+ virtual bool select (const QItemSelection& selection, QItemSelectionModel::SelectionFlags \
command); +};
diff --git a/sip/kitemmodels/kdescendantsproxymodel.sip b/sip/kitemmodels/kdescendantsproxymodel.sip
new file mode 100644
index 0000000..1cd1320
--- /dev/null
+++ b/sip/kitemmodels/kdescendantsproxymodel.sip
@@ -0,0 +1,49 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class KDescendantsProxyModel : QAbstractProxyModel
+{
+%TypeHeaderCode
+#include <kdescendantsproxymodel.h>
+%End
+
+public:
+ explicit KDescendantsProxyModel (QObject* parent = 0);
+ virtual ~KDescendantsProxyModel ();
+ virtual void setSourceModel (QAbstractItemModel* model);
+ void setRootIndex (const QModelIndex& index);
+ void setDisplayAncestorData (bool display);
+ bool displayAncestorData () const;
+ void setAncestorSeparator (const QString& separator);
+ QString ancestorSeparator () const;
+ QModelIndex mapFromSource (const QModelIndex& sourceIndex) const;
+ QModelIndex mapToSource (const QModelIndex& proxyIndex) const;
+ virtual Qt::ItemFlags flags (const QModelIndex& index) const;
+ QVariant data (const QModelIndex& index, int role = Qt::DisplayRole) const;
+ virtual int rowCount (const QModelIndex& parent = QModelIndex()) const;
+ virtual QVariant headerData (int section, Qt::Orientation orientation, int role) const;
+ virtual QMimeData* mimeData (const QModelIndexList& indexes) const;
+ virtual QStringList mimeTypes () const;
+ virtual bool hasChildren (const QModelIndex& parent = QModelIndex()) const;
+ virtual QModelIndex index (int, int, const QModelIndex& parent = QModelIndex()) const;
+ virtual QModelIndex parent (const QModelIndex&) const;
+ virtual int columnCount (const QModelIndex& index = QModelIndex()) const;
+ virtual Qt::DropActions supportedDropActions () const;
+ virtual QModelIndexList match (const QModelIndex& start, int role, const QVariant& value, int hits \
= 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const; +};
diff --git a/sip/kitemmodels/kitemmodelsmod.sip b/sip/kitemmodels/kitemmodelsmod.sip
new file mode 100644
index 0000000..8de4d5c
--- /dev/null
+++ b/sip/kitemmodels/kitemmodelsmod.sip
@@ -0,0 +1,34 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+%Module PyKDE5.kitemmodels
+
+%ModuleHeaderCode
+#pragma GCC visibility push(default)
+%End
+
+%Import QtCore/QtCoremod.sip
+
+%Include kbreadcrumbselectionmodel.sip
+%Include kcheckableproxymodel.sip
+%Include kdescendantsproxymodel.sip
+%Include klinkitemselectionmodel.sip
+%Include kmodelindexproxymapper.sip
+%Include krecursivefilterproxymodel.sip
+%Include kselectionproxymodel.sip
diff --git a/sip/kitemmodels/klinkitemselectionmodel.sip b/sip/kitemmodels/klinkitemselectionmodel.sip
new file mode 100644
index 0000000..dd4c763
--- /dev/null
+++ b/sip/kitemmodels/klinkitemselectionmodel.sip
@@ -0,0 +1,31 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class KLinkItemSelectionModel : QItemSelectionModel
+{
+%TypeHeaderCode
+#include <klinkitemselectionmodel.h>
+%End
+
+public:
+ KLinkItemSelectionModel (QAbstractItemModel* targetModel, \
QItemSelectionModel* linkedItemSelectionModel, QObject* parent = 0); + ~KLinkItemSelectionModel ();
+ void select (const QModelIndex& index, QItemSelectionModel::SelectionFlags \
command); + void select (const QItemSelection& selection, \
QItemSelectionModel::SelectionFlags command); +};
diff --git a/sip/kitemmodels/kmodelindexproxymapper.sip b/sip/kitemmodels/kmodelindexproxymapper.sip
new file mode 100644
index 0000000..d871c3d
--- /dev/null
+++ b/sip/kitemmodels/kmodelindexproxymapper.sip
@@ -0,0 +1,33 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class KModelIndexProxyMapper : QObject
+{
+%TypeHeaderCode
+#include <kmodelindexproxymapper.h>
+%End
+
+public:
+ KModelIndexProxyMapper (const QAbstractItemModel* leftModel, const \
QAbstractItemModel* rightModel, QObject* parent = 0); + ~KModelIndexProxyMapper ();
+ QModelIndex mapLeftToRight (const QModelIndex& index) const;
+ QModelIndex mapRightToLeft (const QModelIndex& index) const;
+ QItemSelection mapSelectionLeftToRight (const QItemSelection& selection) const;
+ QItemSelection mapSelectionRightToLeft (const QItemSelection& selection) const;
+};
diff --git a/sip/kitemmodels/krecursivefilterproxymodel.sip \
b/sip/kitemmodels/krecursivefilterproxymodel.sip new file mode 100644
index 0000000..584edd1
--- /dev/null
+++ b/sip/kitemmodels/krecursivefilterproxymodel.sip
@@ -0,0 +1,34 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class KRecursiveFilterProxyModel : QSortFilterProxyModel
+{
+%TypeHeaderCode
+#include <krecursivefilterproxymodel.h>
+%End
+
+public:
+ explicit KRecursiveFilterProxyModel (QObject* parent = 0);
+ virtual ~KRecursiveFilterProxyModel ();
+ void setSourceModel (QAbstractItemModel* model);
+ virtual QModelIndexList match (const QModelIndex& start, int role, const QVariant& value, int hits \
= 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const; +protected:
+ virtual bool acceptRow (int sourceRow, const QModelIndex& sourceParent) const;
+ virtual bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const;
+};
diff --git a/sip/kitemmodels/kselectionproxymodel.sip b/sip/kitemmodels/kselectionproxymodel.sip
new file mode 100644
index 0000000..a0daf4d
--- /dev/null
+++ b/sip/kitemmodels/kselectionproxymodel.sip
@@ -0,0 +1,60 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+class KSelectionProxyModel : QAbstractProxyModel
+{
+%TypeHeaderCode
+#include <kselectionproxymodel.h>
+%End
+
+public:
+ explicit KSelectionProxyModel (QItemSelectionModel* selectionModel, QObject* parent = \
0); + virtual ~KSelectionProxyModel ();
+ virtual void setSourceModel (QAbstractItemModel* sourceModel);
+ QItemSelectionModel* selectionModel () const;
+ enum FilterBehavior
+ {
+ SubTrees,
+ SubTreeRoots,
+ SubTreesWithoutRoots,
+ ExactSelection,
+ ChildrenOfExactSelection
+ };
+ void setFilterBehavior (KSelectionProxyModel::FilterBehavior behavior);
+ KSelectionProxyModel::FilterBehavior filterBehavior () const;
+ QModelIndex mapFromSource (const QModelIndex& sourceIndex) const;
+ QModelIndex mapToSource (const QModelIndex& proxyIndex) const;
+ QItemSelection mapSelectionFromSource (const QItemSelection& selection) const;
+ QItemSelection mapSelectionToSource (const QItemSelection& selection) const;
+ virtual Qt::ItemFlags flags (const QModelIndex& index) const;
+ QVariant data (const QModelIndex& index, int role = Qt::DisplayRole) const;
+ virtual int rowCount (const QModelIndex& parent = QModelIndex()) const;
+ virtual QVariant headerData (int section, Qt::Orientation orientation, int role = \
Qt::DisplayRole) const; + virtual QMimeData* mimeData (const QModelIndexList& indexes) const;
+ virtual QStringList mimeTypes () const;
+ virtual Qt::DropActions supportedDropActions () const;
+ virtual bool dropMimeData (const QMimeData* data, Qt::DropAction action, int row, int \
column, const QModelIndex& parent); + virtual bool hasChildren (const QModelIndex& parent = \
QModelIndex()) const; + virtual QModelIndex index (int, int, const QModelIndex& = QModelIndex()) \
const; + virtual QModelIndex parent (const QModelIndex&) const;
+ virtual int columnCount (const QModelIndex& = QModelIndex()) const;
+ virtual QModelIndexList match (const QModelIndex& start, int role, const QVariant& value, int hits \
= 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const; +protected:
+ QList<QPersistentModelIndex> sourceRootIndexes () const;
+};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic