File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ Module with all the utility functions, to make our programming lives easier.
14
14
15
15
use qt_widgets:: QGridLayout ;
16
16
use qt_widgets:: QStatusBar ;
17
+ use qt_widgets:: QVBoxLayout ;
17
18
use qt_widgets:: { QMessageBox , q_message_box:: { Icon , StandardButton } } ;
18
19
use qt_widgets:: QWidget ;
19
20
@@ -154,8 +155,14 @@ pub unsafe fn load_template(parent: impl CastInto<Ptr<QWidget>>, path: &str) ->
154
155
let mut file = BufReader :: new ( File :: open ( path) ?) ;
155
156
file. read_to_end ( & mut data) ?;
156
157
158
+ let parent: Ptr < QWidget > = parent. cast_into ( ) ;
159
+ let layout = QVBoxLayout :: new_1a ( parent. clone ( ) ) ;
160
+ parent. set_layout ( & layout) ;
161
+
157
162
let ui_loader = QUiLoader :: new_0a ( ) ;
158
163
let main_widget = ui_loader. load_bytes_with_parent ( & data, parent) ;
159
164
165
+ layout. add_widget ( & main_widget) ;
166
+
160
167
Ok ( main_widget)
161
168
}
You can’t perform that action at this time.
0 commit comments