File indexing completed on 2024-05-12 05:36:51

0001 /*
0002  * SPDX-FileCopyrightText: 2021 David Redondo <kde@david-redondo.de>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 #pragma once
0008 
0009 #include <KRearrangeColumnsProxyModel>
0010 
0011 #include <qqmlregistration.h>
0012 
0013 /**
0014  * A proxy model to reverse the columns of a table. Needed because QML Tableview does not correctly
0015  * reverse its columns when using a RTL language.
0016  */
0017 class ReverseColumnsProxyModel : public KRearrangeColumnsProxyModel
0018 {
0019     Q_OBJECT
0020     QML_ELEMENT
0021 
0022 public:
0023     explicit ReverseColumnsProxyModel(QObject *parent = nullptr);
0024     void setSourceModel(QAbstractItemModel *sourceModel) override;
0025 
0026 private:
0027     void reverseColumns();
0028 };