File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,18 @@ class provider : public list_provider
33
33
34
34
const utki::shared_ref<table_list::provider> table_list_provider;
35
35
36
- provider (table_list& owner, utki::shared_ref<table_list::provider> table_list_provider) :
36
+ provider (
37
+ table_list& owner, //
38
+ utki::shared_ref<table_list::provider> table_list_provider
39
+ ) :
37
40
list_provider (table_list_provider.get().context),
38
41
owner (owner),
39
42
table_list_provider (std::move(table_list_provider))
40
- {}
43
+ {
44
+ this ->table_list_provider .get ().model_change_signal .connect ([this ]() {
45
+ this ->notify_model_change ();
46
+ });
47
+ }
41
48
42
49
size_t count () const noexcept override
43
50
{
@@ -195,6 +202,13 @@ void table_list::arrange_list_item_cells(ruis::semiconst_widget_list& cells)
195
202
}
196
203
}
197
204
205
+ void table_list::provider::notify_model_change ()
206
+ {
207
+ this ->context .get ().post_to_ui_thread ([this ]() {
208
+ this ->model_change_signal .emit ();
209
+ });
210
+ }
211
+
198
212
utki::shared_ref<ruis::table_list> make::table_list (
199
213
utki::shared_ref<ruis::context> context, //
200
214
ruis::table_list::all_parameters params
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ class table_list :
47
47
*/
48
48
class provider
49
49
{
50
+ friend class ruis ::internal::provider;
51
+
52
+ utki::signal<> model_change_signal;
53
+
50
54
public:
51
55
const utki::shared_ref<ruis::context> context;
52
56
@@ -73,6 +77,12 @@ class table_list :
73
77
* @return A list of widgets for table row cell.
74
78
*/
75
79
virtual widget_list get_row_widgets (size_t index) = 0;
80
+
81
+ /* *
82
+ * @brief Notify about change of items model.
83
+ * The user is supposed to invoke this function when items model change.
84
+ */
85
+ void notify_model_change ();
76
86
};
77
87
78
88
struct parameters {
You can’t perform that action at this time.
0 commit comments