February 2019
Intermediate to advanced
450 pages
11h 59m
English
The GoMail compose layout is even simpler: we use widgets.QFormLayout again, though the To field is the only line with a label included. For this simpler window, we create widgets.QDialog and set the layout directly on the dialog widget. To add the buttons at the bottom of the screen, we use a new widgets.QWidget with the layout set to widgets.NewQHBoxLayout() to lay the buttons out horizontally. To manage the right alignment, we first include widgets.NewQSpacerItem() in the button box before the buttons. Note lastly that we call SetDefault(true) on the send button so it becomes the default action:
package mainimport "github.com/therecipe/qt/widgets"func showCompose() { dialog := widgets.NewQDialog(nil, 0) dialog.SetModal( ...
Read now
Unlock full access