qt_cb/prelude.rs
1use cpp_core::Ref;
2use qt_core::{QPtr, QString};
3
4pub trait ButtonExt {
5 /// # Safety
6 /// The QObjects referenced by self and receiver must be alive.
7 unsafe fn connect_clicked<F: FnMut(&Self, bool) + 'static>(&self, cb: F);
8 /// # Safety
9 /// The QObjects referenced by self and receiver must be alive.
10 unsafe fn connect_pressed<F: FnMut(&Self) + 'static>(&self, cb: F);
11 /// # Safety
12 /// The QObjects referenced by self and receiver must be alive.
13 unsafe fn connect_toggled<F: FnMut(&Self, bool) + 'static>(&self, cb: F);
14 /// # Safety
15 /// The QObjects referenced by self and receiver must be alive.
16 unsafe fn connect_released<F: FnMut(&Self) + 'static>(&self, cb: F);
17}
18
19pub trait InputExt {
20 /// # Safety
21 /// The QObjects referenced by self and receiver must be alive.
22 unsafe fn connect_text_changed<F: FnMut(&Self, Ref<QString>) + 'static>(&self, cb: F);
23 /// # Safety
24 /// The QObjects referenced by self and receiver must be alive.
25 unsafe fn connect_return_pressed<F: FnMut(&Self) + 'static>(&self, cb: F);
26}
27
28pub trait TextExt {
29 /// # Safety
30 /// The QObjects referenced by self and receiver must be alive.
31 unsafe fn connect_redo_available<F: FnMut(&Self, bool) + 'static>(&self, cb: F);
32 /// # Safety
33 /// The QObjects referenced by self and receiver must be alive.
34 unsafe fn connect_selection_changed<F: FnMut(&Self) + 'static>(&self, cb: F);
35 /// # Safety
36 /// The QObjects referenced by self and receiver must be alive.
37 unsafe fn connect_text_changed<F: FnMut(&Self) + 'static>(&self, cb: F);
38 /// # Safety
39 /// The QObjects referenced by self and receiver must be alive.
40 unsafe fn connect_undo_available<F: FnMut(&Self, bool) + 'static>(&self, cb: F);
41}
42
43pub trait MenuExt {
44 /// # Safety
45 /// The QObjects referenced by self and receiver must be alive.
46 unsafe fn connect_triggered<F: FnMut(&Self, QPtr<qt_widgets::QAction>) + 'static>(&self, cb: F);
47}