SortController
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| Object prettyqt.core.object The base class of all Qt objects. |
â‹” Inheritance diagram¶
graph TD
2244666392["sortcontroller.SortController"]
3251382671["core.Object"]
3227531497["core.ObjectMixin"]
2751680898["builtins.object"]
13951691["QtCore.QObject"]
395147830["sip.wrapper"]
46922758["sip.simplewrapper"]
3251382671 --> 2244666392
3227531497 --> 3251382671
2751680898 --> 3227531497
13951691 --> 3251382671
395147830 --> 13951691
46922758 --> 395147830
2751680898 --> 46922758
🛈 DocStrings¶
Bases: Object
Sort state and sorting of one DataFrameModel, driven by header clicks.
request_sort(column) (a header click) emits sort_requested(column, order)
(clicking the sorted column again reverses the order) and, if sortable, sorts:
sort_mode="copy": the model replaces the frame by a sorted copy (GUI thread).sort_mode="permutation": the row order is computed in a worker thread (sorting_changed(True)while it runs,sorting_changed(False)when it was applied or dropped). Only the latest request is applied, and only if the frame was not replaced or edited meanwhile;cancel_sort()drops a running one.
Replacing the frame, or clearing the row order, resets the sort state.
sort_state_changed is emitted with (column, order) or None whenever the
state changes, so a viewer can repaint its sort indicator.
Source code in src/cutepandas/pandaswidgets/sortcontroller.py
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 | |
cancel_sort
¶
clear_sort
¶
Drop a display-only sort (permutation mode) and the sort state.
get_sort_state
¶
(column, order) of the current sort, None if unsorted.
Source code in src/cutepandas/pandaswidgets/sortcontroller.py
is_sorting
¶
request_sort
¶
Header click on column: emit sort_requested, sort if sortable.
Source code in src/cutepandas/pandaswidgets/sortcontroller.py
set_sort_state
¶
Remember the current sort (the next request for column reverses it).
Replacing the frame resets it; an application that sorts on
sort_requested and then sets the sorted frame restores it here.
Source code in src/cutepandas/pandaswidgets/sortcontroller.py
sort_by
¶
Sort by a column position (in the model's sort_mode).
In permutation mode this returns right away; the order is computed in a
worker thread and applied later (see sorting_changed).