Using duic

duic is the equivalent to the Qt uic tool to convert .ui files produced by the Qt Designer to source code files.

In the C++, a generated ui_mywidget.h file from uic would be typically used in a multi inheritance style:

class Window : public QWidget, private Ui_MyDialog
{
  Windows(QWidget* parent = 0) : QWidget(parent)
  {
    setupUi(this);
  }

};

Since D doesn't allow multiple inheritance, you have two ways to accomplish the same:

class Window : QWidget
{
  mixin Ui_MyDialog;
    
  this(QWidget parent = null)
  {
    super(parent);
    setupUi(this);
  }
}
class Window : QWidget
{
  MyDialog ui;
    
  this(QWidget parent = null)
  {
    super(parent);
    ui.setupUi(this);
  }
}

Second snippet allows you to enclose all the form widgets in the ui namespace, while in the first one widgets are directly accessible as members of the Window class. It depends on you which approach you prefer.