Hello community,

here is the log from the commit of package kitemmodels for openSUSE:Factory 
checked in at 2020-01-14 21:02:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kitemmodels (Old)
 and      /work/SRC/openSUSE:Factory/.kitemmodels.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kitemmodels"

Tue Jan 14 21:02:19 2020 rev:74 rq:763469 version:5.66.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kitemmodels/kitemmodels.changes  2019-12-18 
14:42:57.673791595 +0100
+++ /work/SRC/openSUSE:Factory/.kitemmodels.new.6675/kitemmodels.changes        
2020-01-14 21:05:03.790701208 +0100
@@ -1,0 +2,13 @@
+Sun Jan  5 09:02:13 UTC 2020 - Christophe Giboudeaux <christo...@krop.fr>
+
+- Update to 5.66.0
+  * New feature release
+  * For more details please see:
+  * https://www.kde.org/announcements/kde-frameworks-5.66.0.php
+- Changes since 5.65.0:
+  * Port deprecated QSet::toList method
+  * Update the obsolete projects.kde.org URL
+  * Add KColumnHeadersProxyModel
+  * Fix build of python bindings for kcolumnheadersmodel
+
+-------------------------------------------------------------------

Old:
----
  kitemmodels-5.65.0.tar.xz
  kitemmodels-5.65.0.tar.xz.sig

New:
----
  kitemmodels-5.66.0.tar.xz
  kitemmodels-5.66.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kitemmodels.spec ++++++
--- /var/tmp/diff_new_pack.lhDAqb/_old  2020-01-14 21:05:04.390701486 +0100
+++ /var/tmp/diff_new_pack.lhDAqb/_new  2020-01-14 21:05:04.390701486 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package kitemmodels
 #
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define clang_sonum 3.8
 %define lname   libKF5ItemModels5
-%define _tar_path 5.65
+%define _tar_path 5.66
 # Full KF5 version (e.g. 5.33.0)
 %{!?_kf5_version: %global _kf5_version %{version}}
 # Last major and minor KF5 version (e.g. 5.33)
@@ -27,7 +27,7 @@
 # Only needed for the package signature condition
 %bcond_without lang
 Name:           kitemmodels
-Version:        5.65.0
+Version:        5.66.0
 Release:        0
 Summary:        Set of item models extending the Qt model-view framework
 License:        LGPL-2.1-or-later


++++++ kitemmodels-5.65.0.tar.xz -> kitemmodels-5.66.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.65.0/CMakeLists.txt 
new/kitemmodels-5.66.0/CMakeLists.txt
--- old/kitemmodels-5.65.0/CMakeLists.txt       2019-12-07 20:44:03.000000000 
+0100
+++ new/kitemmodels-5.66.0/CMakeLists.txt       2020-01-05 18:20:21.000000000 
+0100
@@ -1,11 +1,11 @@
 cmake_minimum_required(VERSION 3.5)
 
-set(KF5_VERSION "5.65.0") # handled by release scripts
+set(KF5_VERSION "5.66.0") # handled by release scripts
 project(KItemModels VERSION ${KF5_VERSION})
 
 include(FeatureSummary)
-find_package(ECM 5.65.0  NO_MODULE)
-set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL 
"https://projects.kde.org/projects/kdesupport/extra-cmake-modules";)
+find_package(ECM 5.66.0  NO_MODULE)
+set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL "https://commits.kde.org/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
 
@@ -16,7 +16,7 @@
 include(KDECMakeSettings)
 include(ECMQtDeclareLoggingCategory)
 
-set(REQUIRED_QT_VERSION 5.11.0)
+set(REQUIRED_QT_VERSION 5.12.0)
 find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
 find_package(Qt5Qml ${REQUIRED_QT_VERSION} NO_MODULE)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.65.0/autotests/CMakeLists.txt 
new/kitemmodels-5.66.0/autotests/CMakeLists.txt
--- old/kitemmodels-5.65.0/autotests/CMakeLists.txt     2019-12-07 
20:44:03.000000000 +0100
+++ new/kitemmodels-5.66.0/autotests/CMakeLists.txt     2020-01-05 
18:20:21.000000000 +0100
@@ -25,6 +25,7 @@
   krecursivefilterproxymodeltest.cpp
   krearrangecolumnsproxymodeltest.cpp
   knumbermodeltest.cpp
+  kcolumnheadersmodeltest.cpp
   LINK_LIBRARIES KF5::ItemModels Qt5::Test Qt5::Widgets proxymodeltestsuite
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.65.0/autotests/kcolumnheadersmodeltest.cpp 
new/kitemmodels-5.66.0/autotests/kcolumnheadersmodeltest.cpp
--- old/kitemmodels-5.65.0/autotests/kcolumnheadersmodeltest.cpp        
1970-01-01 01:00:00.000000000 +0100
+++ new/kitemmodels-5.66.0/autotests/kcolumnheadersmodeltest.cpp        
2020-01-05 18:20:21.000000000 +0100
@@ -0,0 +1,189 @@
+/*
+    Copyright (c) 2019 Arjen Hiemstra <ahiems...@heimr.nl>
+
+    This library 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 of the License, or (at your
+    option) any later version.
+
+    This library 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 Library General Public
+    License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to the
+    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301, USA.
+*/
+
+#include <QTest>
+#include <QStandardItemModel>
+#include <QAbstractItemModelTester>
+#include <QSignalSpy>
+
+#include <KColumnHeadersModel>
+
+class KColumnHeadersModelTest : public QObject
+{
+    Q_OBJECT
+
+private Q_SLOTS:
+    void testStatic()
+    {
+        auto model = new KColumnHeadersModel{};
+
+        auto sourceModel = new QStandardItemModel{};
+        sourceModel->setHorizontalHeaderLabels({
+            QStringLiteral("Test 1"),
+            QStringLiteral("Test 2"),
+            QStringLiteral("Test 3"),
+            QStringLiteral("Test 4"),
+            QStringLiteral("Test 5")
+        });
+
+        model->setSourceModel(sourceModel);
+
+        auto tester = new QAbstractItemModelTester(model);
+        Q_UNUSED(tester);
+
+        QCOMPARE(model->rowCount(), 5);
+        QCOMPARE(model->data(model->index(0, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 1"));
+        QCOMPARE(model->data(model->index(1, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 2"));
+        QCOMPARE(model->data(model->index(2, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 3"));
+        QCOMPARE(model->data(model->index(3, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 4"));
+        QCOMPARE(model->data(model->index(4, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 5"));
+
+        QSignalSpy spy{model, &QAbstractItemModel::dataChanged};
+        QVERIFY(spy.isValid());
+
+        sourceModel->setHorizontalHeaderLabels({
+            QStringLiteral("Test 5"),
+            QStringLiteral("Test 4"),
+            QStringLiteral("Test 3"),
+            QStringLiteral("Test 2"),
+            QStringLiteral("Test 1")
+        });
+
+        QCOMPARE(spy.count(), 4);
+    }
+
+    void testAddColumns()
+    {
+        auto model = new KColumnHeadersModel{};
+        auto sourceModel = new QStandardItemModel{};
+        sourceModel->setHorizontalHeaderLabels({
+            QStringLiteral("Test 1"),
+            QStringLiteral("Test 2")
+        });
+        model->setSourceModel(sourceModel);
+
+        auto tester = new QAbstractItemModelTester(model);
+        Q_UNUSED(tester);
+
+        QSignalSpy spy{model, &QAbstractItemModel::rowsInserted};
+        QVERIFY(spy.isValid());
+
+        QCOMPARE(model->rowCount(), 2);
+        QCOMPARE(model->data(model->index(0, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 1"));
+        QCOMPARE(model->data(model->index(1, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 2"));
+
+        sourceModel->setHorizontalHeaderLabels({
+            QStringLiteral("Test 1"),
+            QStringLiteral("Test 2"),
+            QStringLiteral("Test 3")
+        });
+
+        QCOMPARE(spy.count(), 1);
+        QCOMPARE(model->rowCount(), 3);
+        QCOMPARE(model->data(model->index(0, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 1"));
+        QCOMPARE(model->data(model->index(1, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 2"));
+        QCOMPARE(model->data(model->index(2, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 3"));
+
+        sourceModel->setHorizontalHeaderLabels({
+            QStringLiteral("Test 1"),
+            QStringLiteral("Test 2"),
+            QStringLiteral("Test 3"),
+            QStringLiteral("Test 4"),
+            QStringLiteral("Test 5")
+        });
+
+        QCOMPARE(spy.count(), 2);
+        QCOMPARE(model->rowCount(), 5);
+        QCOMPARE(model->data(model->index(0, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 1"));
+        QCOMPARE(model->data(model->index(1, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 2"));
+        QCOMPARE(model->data(model->index(2, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 3"));
+        QCOMPARE(model->data(model->index(3, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 4"));
+        QCOMPARE(model->data(model->index(4, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 5"));
+
+        sourceModel->setHorizontalHeaderLabels({
+            QStringLiteral("Test 1"),
+            QStringLiteral("Test 2"),
+            QStringLiteral("Test 6"),
+            QStringLiteral("Test 3"),
+            QStringLiteral("Test 4"),
+            QStringLiteral("Test 5")
+        });
+
+        QCOMPARE(spy.count(), 3);
+        QCOMPARE(model->rowCount(), 6);
+        QCOMPARE(model->data(model->index(0, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 1"));
+        QCOMPARE(model->data(model->index(1, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 2"));
+        QCOMPARE(model->data(model->index(2, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 6"));
+        QCOMPARE(model->data(model->index(3, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 3"));
+        QCOMPARE(model->data(model->index(4, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 4"));
+        QCOMPARE(model->data(model->index(5, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 5"));
+    }
+
+    void testRemoveColumns()
+    {
+        auto model = new KColumnHeadersModel{};
+
+        auto sourceModel = new QStandardItemModel{};
+        sourceModel->setHorizontalHeaderLabels({
+            QStringLiteral("Test 1"),
+            QStringLiteral("Test 2"),
+            QStringLiteral("Test 3"),
+            QStringLiteral("Test 4"),
+            QStringLiteral("Test 5")
+        });
+
+        model->setSourceModel(sourceModel);
+
+        auto tester = new QAbstractItemModelTester(model);
+        Q_UNUSED(tester);
+
+        QSignalSpy spy{model, &QAbstractItemModel::rowsRemoved};
+        QVERIFY(spy.isValid());
+
+        QCOMPARE(model->rowCount(), 5);
+        QCOMPARE(model->data(model->index(0, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 1"));
+        QCOMPARE(model->data(model->index(1, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 2"));
+        QCOMPARE(model->data(model->index(2, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 3"));
+        QCOMPARE(model->data(model->index(3, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 4"));
+        QCOMPARE(model->data(model->index(4, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 5"));
+
+        sourceModel->takeColumn(4);
+
+        QCOMPARE(spy.count(), 1);
+
+        QCOMPARE(model->rowCount(), 4);
+        QCOMPARE(model->data(model->index(0, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 1"));
+        QCOMPARE(model->data(model->index(1, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 2"));
+        QCOMPARE(model->data(model->index(2, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 3"));
+        QCOMPARE(model->data(model->index(3, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 4"));
+
+        sourceModel->takeColumn(1);
+
+        QCOMPARE(spy.count(), 2);
+
+        QCOMPARE(model->rowCount(), 3);
+        QCOMPARE(model->data(model->index(0, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 1"));
+        QCOMPARE(model->data(model->index(1, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 3"));
+        QCOMPARE(model->data(model->index(2, 0), Qt::DisplayRole).toString(), 
QStringLiteral("Test 4"));
+    }
+};
+
+QTEST_MAIN(KColumnHeadersModelTest)
+
+#include "kcolumnheadersmodeltest.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.65.0/autotests/proxymodeltestsuite/proxymodeltest.h 
new/kitemmodels-5.66.0/autotests/proxymodeltestsuite/proxymodeltest.h
--- old/kitemmodels-5.65.0/autotests/proxymodeltestsuite/proxymodeltest.h       
2019-12-07 20:44:03.000000000 +0100
+++ new/kitemmodels-5.66.0/autotests/proxymodeltestsuite/proxymodeltest.h       
2020-01-05 18:20:21.000000000 +0100
@@ -397,7 +397,7 @@
 
     QStringList namedTests()
     {
-        return m_testNames.toList();
+        return m_testNames.values();
     }
 
     void noopTest(const QString &name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.65.0/src/core/CMakeLists.txt 
new/kitemmodels-5.66.0/src/core/CMakeLists.txt
--- old/kitemmodels-5.65.0/src/core/CMakeLists.txt      2019-12-07 
20:44:03.000000000 +0100
+++ new/kitemmodels-5.66.0/src/core/CMakeLists.txt      2020-01-05 
18:20:21.000000000 +0100
@@ -11,6 +11,7 @@
   krearrangecolumnsproxymodel.cpp
   krecursivefilterproxymodel.cpp
   kselectionproxymodel.cpp
+  kcolumnheadersmodel.cpp
 )
 
 ecm_qt_declare_logging_category(kitemmodels_SRCS HEADER kitemmodels_debug.h 
IDENTIFIER KITEMMODELS_LOG CATEGORY_NAME kf5.kitemmodels)
@@ -53,6 +54,7 @@
   KModelIndexProxyMapper
   KSelectionProxyModel
   KNumberModel
+  KColumnHeadersModel
   REQUIRED_HEADERS KItemModels_HEADERS
 )
 
@@ -76,6 +78,7 @@
       kdescendantsproxymodel.h
       kmodelindexproxymapper.h
       kselectionproxymodel.h
+      kcolumnheadersmodel.h
   )
 endif()
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.65.0/src/core/kcolumnheadersmodel.cpp 
new/kitemmodels-5.66.0/src/core/kcolumnheadersmodel.cpp
--- old/kitemmodels-5.65.0/src/core/kcolumnheadersmodel.cpp     1970-01-01 
01:00:00.000000000 +0100
+++ new/kitemmodels-5.66.0/src/core/kcolumnheadersmodel.cpp     2020-01-05 
18:20:21.000000000 +0100
@@ -0,0 +1,106 @@
+/*
+    Copyright (c) 2019 Arjen Hiemstra <ahiems...@heimr.nl>
+
+    This library 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 of the License, or (at your
+    option) any later version.
+
+    This library 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 Library General Public
+    License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to the
+    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301, USA.
+*/
+
+#include "kcolumnheadersmodel.h"
+
+class KColumnHeadersModelPrivate
+{
+public:
+    QAbstractItemModel *sourceModel = nullptr;
+};
+
+KColumnHeadersModel::KColumnHeadersModel(QObject *parent)
+    : QAbstractListModel(parent), d(new KColumnHeadersModelPrivate)
+{
+}
+
+KColumnHeadersModel::~KColumnHeadersModel()
+{
+}
+
+int KColumnHeadersModel::rowCount(const QModelIndex& parent) const
+{
+    if (!d->sourceModel || parent.isValid()) {
+        return 0;
+    }
+
+    return d->sourceModel->columnCount();
+}
+
+QVariant KColumnHeadersModel::data(const QModelIndex& index, int role) const
+{
+    if (!d->sourceModel || !index.isValid()) {
+        return QVariant{};
+    }
+
+    return sourceModel()->headerData(index.row(), Qt::Horizontal, role);
+}
+
+QHash<int, QByteArray> KColumnHeadersModel::roleNames() const
+{
+    if (!d->sourceModel) {
+        return QHash<int, QByteArray>{};
+    }
+
+    return d->sourceModel->roleNames();
+}
+
+QAbstractItemModel *KColumnHeadersModel::sourceModel() const
+{
+    return d->sourceModel;
+}
+
+void KColumnHeadersModel::setSourceModel(QAbstractItemModel* newSourceModel)
+{
+    if (newSourceModel == d->sourceModel) {
+        return;
+    }
+
+    if (d->sourceModel) {
+        d->sourceModel->disconnect(this);
+    }
+
+    beginResetModel();
+    d->sourceModel = newSourceModel;
+    endResetModel();
+
+    if (newSourceModel) {
+        connect(newSourceModel, &QAbstractItemModel::columnsAboutToBeInserted, 
this, [this](const QModelIndex&, int first, int last) {
+            beginInsertRows(QModelIndex{}, first, last);
+        });
+        connect(newSourceModel, &QAbstractItemModel::columnsInserted, this, 
[this]() { endInsertRows(); });
+        connect(newSourceModel, &QAbstractItemModel::columnsAboutToBeMoved, 
this, [this](const QModelIndex&, int start, int end, const QModelIndex&, int 
destination) {
+            beginMoveRows(QModelIndex{}, start, end, QModelIndex{}, 
destination);
+        });
+        connect(newSourceModel, &QAbstractItemModel::columnsMoved, this, 
[this]() { endMoveRows(); });
+        connect(newSourceModel, &QAbstractItemModel::columnsAboutToBeRemoved, 
this, [this](const QModelIndex &, int first, int last) {
+            beginRemoveRows(QModelIndex{}, first, last);
+        });
+        connect(newSourceModel, &QAbstractItemModel::columnsRemoved, this, 
[this]() { endRemoveRows(); });
+        connect(newSourceModel, &QAbstractItemModel::headerDataChanged, this, 
[this](Qt::Orientation orientation, int first, int last) {
+            if (orientation == Qt::Horizontal) {
+                Q_EMIT dataChanged(index(first, 0), index(last, 0));
+            }
+        });
+        connect(newSourceModel, &QAbstractItemModel::layoutAboutToBeChanged, 
this, &QAbstractItemModel::layoutAboutToBeChanged);
+        connect(newSourceModel, &QAbstractItemModel::layoutChanged, this, 
&QAbstractItemModel::layoutChanged);
+        connect(newSourceModel, &QAbstractItemModel::modelAboutToBeReset, 
this, [this]() { beginResetModel(); });
+        connect(newSourceModel, &QAbstractItemModel::modelReset, this, 
[this]() { endResetModel(); });
+    }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.65.0/src/core/kcolumnheadersmodel.h 
new/kitemmodels-5.66.0/src/core/kcolumnheadersmodel.h
--- old/kitemmodels-5.65.0/src/core/kcolumnheadersmodel.h       1970-01-01 
01:00:00.000000000 +0100
+++ new/kitemmodels-5.66.0/src/core/kcolumnheadersmodel.h       2020-01-05 
18:20:21.000000000 +0100
@@ -0,0 +1,65 @@
+/*
+    Copyright (c) 2019 Arjen Hiemstra <ahiems...@heimr.nl>
+
+    This library 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 of the License, or (at your
+    option) any later version.
+
+    This library 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 Library General Public
+    License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to the
+    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301, USA.
+*/
+
+#ifndef KCOLUMNHEADERSMODEL_H
+#define KCOLUMNHEADERSMODEL_H
+
+#include "kitemmodels_export.h"
+
+#include <memory>
+#include <QAbstractListModel>
+
+class KColumnHeadersModelPrivate;
+
+/**
+ * A model that converts a model's headers into a list model.
+ *
+ * This model will expose the source model's headers as a simple list. This is
+ * mostly useful as a helper for QML applications that want to display a 
model's
+ * headers.
+ *
+ * Each columns's header will be presented as a row in this model. Roles are
+ * forwarded directly to the source model's headerData() method.
+ *
+ * @since 5.66
+ */
+class KITEMMODELS_EXPORT KColumnHeadersModel : public QAbstractListModel
+{
+    Q_OBJECT
+    Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE 
setSourceModel NOTIFY sourceModelChanged)
+
+public:
+    explicit KColumnHeadersModel(QObject *parent = nullptr);
+    ~KColumnHeadersModel() override;
+
+    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+    QVariant data(const QModelIndex &index, int role) const override;
+    QHash<int, QByteArray> roleNames() const override;
+
+    QAbstractItemModel *sourceModel() const;
+    void setSourceModel(QAbstractItemModel *newSourceModel);
+
+Q_SIGNALS:
+    void sourceModelChanged();
+
+private:
+    const std::unique_ptr<KColumnHeadersModelPrivate> d;
+};
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.65.0/src/qml/plugin.cpp 
new/kitemmodels-5.66.0/src/qml/plugin.cpp
--- old/kitemmodels-5.65.0/src/qml/plugin.cpp   2019-12-07 20:44:03.000000000 
+0100
+++ new/kitemmodels-5.66.0/src/qml/plugin.cpp   2020-01-05 18:20:21.000000000 
+0100
@@ -24,6 +24,7 @@
 
 #include <KDescendantsProxyModel>
 #include <KNumberModel>
+#include <KColumnHeadersModel>
 #include "kconcatenaterowsproxymodel_qml.h"
 
 void Plugin::initializeEngine(QQmlEngine *engine, const char *uri)
@@ -42,6 +43,5 @@
     
qmlRegisterExtendedType<KConcatenateRowsProxyModel,KConcatenateRowsProxyModelQml>(uri,
 1, 0, "KConcatenateRowsProxyModel");
     qmlRegisterType<KDescendantsProxyModel>(uri, 1, 0, 
"KDescendantsProxyModel");
     qmlRegisterType<KNumberModel>(uri, 1, 0, "KNumberModel");
+    qmlRegisterType<KColumnHeadersModel>(uri, 1, 0, "KColumnHeadersModel");
 }
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.65.0/tests/qml/columnheaders.qml 
new/kitemmodels-5.66.0/tests/qml/columnheaders.qml
--- old/kitemmodels-5.65.0/tests/qml/columnheaders.qml  1970-01-01 
01:00:00.000000000 +0100
+++ new/kitemmodels-5.66.0/tests/qml/columnheaders.qml  2020-01-05 
18:20:21.000000000 +0100
@@ -0,0 +1,21 @@
+import QtQuick 2.0
+import org.kde.kitemmodels 1.0
+
+// This test is somewhat lame in that it should only display a single "1".
+// ListModel only has one column and no way of adding more. And there is not
+// really another model that is simple to create from QML that does have 
columns
+// and column headers.
+
+ListView {
+    model: KColumnHeadersProxyModel {
+        sourceModel: ListModel {
+            ListElement { display: "test1" }
+            ListElement { display: "test2" }
+        }
+    }
+
+    delegate: Text {
+        text: model.display
+    }
+}
+


Reply via email to