1// qdatawidgetmapper.sip generated by MetaSIP
2//
3// This file is part of the QtWidgets Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QDataWidgetMapper : QObject
24{
25%TypeHeaderCode
26#include <qdatawidgetmapper.h>
27%End
28
29public:
30    enum SubmitPolicy
31    {
32        AutoSubmit,
33        ManualSubmit,
34    };
35
36    explicit QDataWidgetMapper(QObject *parent /TransferThis/ = 0);
37    virtual ~QDataWidgetMapper();
38    void setModel(QAbstractItemModel *model /KeepReference/);
39    QAbstractItemModel *model() const;
40    void setItemDelegate(QAbstractItemDelegate *delegate /KeepReference/);
41    QAbstractItemDelegate *itemDelegate() const;
42    void setRootIndex(const QModelIndex &index);
43    QModelIndex rootIndex() const;
44    void setOrientation(Qt::Orientation aOrientation);
45    Qt::Orientation orientation() const;
46    void setSubmitPolicy(QDataWidgetMapper::SubmitPolicy policy);
47    QDataWidgetMapper::SubmitPolicy submitPolicy() const;
48    void addMapping(QWidget *widget, int section);
49    void addMapping(QWidget *widget, int section, const QByteArray &propertyName);
50    void removeMapping(QWidget *widget);
51    QByteArray mappedPropertyName(QWidget *widget) const;
52    int mappedSection(QWidget *widget) const;
53    QWidget *mappedWidgetAt(int section) const;
54    void clearMapping();
55    int currentIndex() const;
56
57public slots:
58    void revert();
59    virtual void setCurrentIndex(int index);
60    void setCurrentModelIndex(const QModelIndex &index);
61    bool submit();
62    void toFirst();
63    void toLast();
64    void toNext();
65    void toPrevious();
66
67signals:
68    void currentIndexChanged(int index);
69};
70