File: qabstractitemview.sip

package info (click to toggle)
pyqt5 5.11.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,956 kB
  • sloc: python: 93,806; cpp: 21,390; xml: 285; makefile: 266; sh: 31
file content (294 lines) | stat: -rw-r--r-- 10,576 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
// qabstractitemview.sip generated by MetaSIP
//
// This file is part of the QtWidgets Python extension module.
//
// Copyright (c) 2018 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt5.
// 
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file.  Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
// 
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license.  For more information contact
// info@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


class QAbstractItemView : QAbstractScrollArea
{
%TypeHeaderCode
#include <qabstractitemview.h>
%End

public:
    enum DragDropMode
    {
        NoDragDrop,
        DragOnly,
        DropOnly,
        DragDrop,
        InternalMove,
    };

    enum EditTrigger
    {
        NoEditTriggers,
        CurrentChanged,
        DoubleClicked,
        SelectedClicked,
        EditKeyPressed,
        AnyKeyPressed,
        AllEditTriggers,
    };

    typedef QFlags<QAbstractItemView::EditTrigger> EditTriggers;

    enum ScrollHint
    {
        EnsureVisible,
        PositionAtTop,
        PositionAtBottom,
        PositionAtCenter,
    };

    enum ScrollMode
    {
        ScrollPerItem,
        ScrollPerPixel,
    };

    enum SelectionBehavior
    {
        SelectItems,
        SelectRows,
        SelectColumns,
    };

    enum SelectionMode
    {
        NoSelection,
        SingleSelection,
        MultiSelection,
        ExtendedSelection,
        ContiguousSelection,
    };

    explicit QAbstractItemView(QWidget *parent /TransferThis/ = 0);
    virtual ~QAbstractItemView();
    virtual void setModel(QAbstractItemModel *model /KeepReference/);
    QAbstractItemModel *model() const;
    virtual void setSelectionModel(QItemSelectionModel *selectionModel /KeepReference/);
    QItemSelectionModel *selectionModel() const;
    void setItemDelegate(QAbstractItemDelegate *delegate /KeepReference/);
    QAbstractItemDelegate *itemDelegate() const;
    void setSelectionMode(QAbstractItemView::SelectionMode mode);
    QAbstractItemView::SelectionMode selectionMode() const;
    void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior);
    QAbstractItemView::SelectionBehavior selectionBehavior() const;
    QModelIndex currentIndex() const;
    QModelIndex rootIndex() const;
    void setEditTriggers(QAbstractItemView::EditTriggers triggers);
    QAbstractItemView::EditTriggers editTriggers() const;
    void setAutoScroll(bool enable);
    bool hasAutoScroll() const;
    void setTabKeyNavigation(bool enable);
    bool tabKeyNavigation() const;
    void setDropIndicatorShown(bool enable);
    bool showDropIndicator() const;
    void setDragEnabled(bool enable);
    bool dragEnabled() const;
    void setAlternatingRowColors(bool enable);
    bool alternatingRowColors() const;
    void setIconSize(const QSize &size);
    QSize iconSize() const;
    void setTextElideMode(Qt::TextElideMode mode);
    Qt::TextElideMode textElideMode() const;
    virtual void keyboardSearch(const QString &search);
    virtual QRect visualRect(const QModelIndex &index) const = 0;
    virtual void scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint = QAbstractItemView::EnsureVisible) = 0;
    virtual QModelIndex indexAt(const QPoint &p) const = 0;
    QSize sizeHintForIndex(const QModelIndex &index) const;
    virtual int sizeHintForRow(int row) const;
    virtual int sizeHintForColumn(int column) const;
    void openPersistentEditor(const QModelIndex &index);
    void closePersistentEditor(const QModelIndex &index);
    void setIndexWidget(const QModelIndex &index, QWidget *widget /Transfer/);
%MethodCode
        // We have to break the association with any existing widget.
        QWidget *w = sipCpp->indexWidget(*a0);
        
        if (w)
        {
            PyObject *wo = sipGetPyObject(w, sipType_QWidget);
        
            if (wo)
                sipTransferTo(wo, 0);
        }
        
        Py_BEGIN_ALLOW_THREADS
        sipCpp->setIndexWidget(*a0, a1);
        Py_END_ALLOW_THREADS
%End

    QWidget *indexWidget(const QModelIndex &index) const;

public slots:
    virtual void reset();
    virtual void setRootIndex(const QModelIndex &index);
    virtual void selectAll();
    void edit(const QModelIndex &index);
    void clearSelection();
    void setCurrentIndex(const QModelIndex &index);
    void scrollToTop();
    void scrollToBottom();
    void update();
    void update(const QModelIndex &index);

protected slots:
    virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>());
    virtual void rowsInserted(const QModelIndex &parent, int start, int end);
    virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
    virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
    virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous);
    virtual void updateEditorData();
    virtual void updateEditorGeometries();
    virtual void updateGeometries();
    virtual void verticalScrollbarAction(int action);
    virtual void horizontalScrollbarAction(int action);
    virtual void verticalScrollbarValueChanged(int value);
    virtual void horizontalScrollbarValueChanged(int value);
    virtual void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint);
    virtual void commitData(QWidget *editor);
    virtual void editorDestroyed(QObject *editor);

signals:
    void pressed(const QModelIndex &index);
    void clicked(const QModelIndex &index);
    void doubleClicked(const QModelIndex &index);
    void activated(const QModelIndex &index);
    void entered(const QModelIndex &index);
    void viewportEntered();
%If (Qt_5_5_0 -)
    void iconSizeChanged(const QSize &size);
%End

protected:
    enum CursorAction
    {
        MoveUp,
        MoveDown,
        MoveLeft,
        MoveRight,
        MoveHome,
        MoveEnd,
        MovePageUp,
        MovePageDown,
        MoveNext,
        MovePrevious,
    };

    virtual QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) = 0;
    virtual int horizontalOffset() const = 0;
    virtual int verticalOffset() const = 0;
    virtual bool isIndexHidden(const QModelIndex &index) const = 0;
    virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) = 0;
    virtual QRegion visualRegionForSelection(const QItemSelection &selection) const = 0;
    virtual QModelIndexList selectedIndexes() const;
    virtual bool edit(const QModelIndex &index, QAbstractItemView::EditTrigger trigger, QEvent *event);
    virtual QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex &index, const QEvent *event = 0) const;
    virtual void startDrag(Qt::DropActions supportedActions);
    virtual QStyleOptionViewItem viewOptions() const;

    enum State
    {
        NoState,
        DraggingState,
        DragSelectingState,
        EditingState,
        ExpandingState,
        CollapsingState,
        AnimatingState,
    };

    QAbstractItemView::State state() const;
    void setState(QAbstractItemView::State state);
    void scheduleDelayedItemsLayout();
    void executeDelayedItemsLayout();
    void scrollDirtyRegion(int dx, int dy);
    void setDirtyRegion(const QRegion &region);
    QPoint dirtyRegionOffset() const;
    virtual bool event(QEvent *event);
    virtual bool viewportEvent(QEvent *e);
    virtual void mousePressEvent(QMouseEvent *e);
    virtual void mouseMoveEvent(QMouseEvent *e);
    virtual void mouseReleaseEvent(QMouseEvent *e);
    virtual void mouseDoubleClickEvent(QMouseEvent *e);
    virtual void dragEnterEvent(QDragEnterEvent *e);
    virtual void dragMoveEvent(QDragMoveEvent *e);
    virtual void dragLeaveEvent(QDragLeaveEvent *e);
    virtual void dropEvent(QDropEvent *e);
    virtual void focusInEvent(QFocusEvent *e);
    virtual void focusOutEvent(QFocusEvent *e);
    virtual void keyPressEvent(QKeyEvent *e);
    virtual void resizeEvent(QResizeEvent *e);
    virtual void timerEvent(QTimerEvent *e);

    enum DropIndicatorPosition
    {
        OnItem,
        AboveItem,
        BelowItem,
        OnViewport,
    };

    QAbstractItemView::DropIndicatorPosition dropIndicatorPosition() const;

public:
    void setVerticalScrollMode(QAbstractItemView::ScrollMode mode);
    QAbstractItemView::ScrollMode verticalScrollMode() const;
    void setHorizontalScrollMode(QAbstractItemView::ScrollMode mode);
    QAbstractItemView::ScrollMode horizontalScrollMode() const;
    void setDragDropOverwriteMode(bool overwrite);
    bool dragDropOverwriteMode() const;
    void setDragDropMode(QAbstractItemView::DragDropMode behavior);
    QAbstractItemView::DragDropMode dragDropMode() const;
    void setItemDelegateForRow(int row, QAbstractItemDelegate *delegate /KeepReference/);
    QAbstractItemDelegate *itemDelegateForRow(int row) const;
    void setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate /KeepReference/);
    QAbstractItemDelegate *itemDelegateForColumn(int column) const;
    QAbstractItemDelegate *itemDelegate(const QModelIndex &index) const;
    virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
    void setAutoScrollMargin(int margin);
    int autoScrollMargin() const;

protected:
    virtual bool focusNextPrevChild(bool next);
    virtual void inputMethodEvent(QInputMethodEvent *event);
%If (Qt_5_2_0 -)
    virtual QSize viewportSizeHint() const;
%End
%If (Qt_5_11_0 -)
    virtual bool eventFilter(QObject *object, QEvent *event);
%End

public:
    void setDefaultDropAction(Qt::DropAction dropAction);
    Qt::DropAction defaultDropAction() const;
%If (Qt_5_7_0 -)
    void resetVerticalScrollMode();
%End
%If (Qt_5_7_0 -)
    void resetHorizontalScrollMode();
%End
%If (Qt_5_10_0 -)
    bool isPersistentEditorOpen(const QModelIndex &index) const;
%End
};

QFlags<QAbstractItemView::EditTrigger> operator|(QAbstractItemView::EditTrigger f1, QFlags<QAbstractItemView::EditTrigger> f2);