code: def create_dialog(self):
          
          self.bbox = QDialogButtonBox(QDialogButtonBox.Ok | 
                  QDialogButtonBox.Cancel)
          self.idx_ok = self.bbox.button(QDialogButtonBox.Ok)
          self.idx_cancel = self.bbox.button(QDialogButtonBox.Cancel)
  
          filebutton = QPushButton()
          filebutton.setText('Choose')
          self.idx_filename = filebutton
  
          self.new_format = FormMenu(['EDF', 'Wonambi'])
          self.all_time = FormBool('Entire length of record')
          self.all_chan = FormBool('All channels')
  
          self.times = {}
          self.times['beg'] = FormFloat()
          self.times['end'] = FormFloat()
  
          chan_box = QListWidget()
          chan_box.setSelectionMode(QAbstractItemView.ExtendedSelection)
          self.idx_chan = chan_box
  
          filebutton.clicked.connect(self.save_as)
          self.all_time.connect(self.toggle_buttons)
          self.all_chan.connect(self.toggle_buttons)
          self.bbox.clicked.connect(self.button_clicked)
  
          self.all_time.set_value(True)
          self.all_chan.set_value(True)
  
          form = QFormLayout()
          form.addRow('Filename',
                      filebutton)
          #form.addRow('Format', self.new_format)
          form.addRow(self.all_time)
          form.addRow('Start time (sec)',
                      self.times['beg'])
          form.addRow('End time (sec)',
                      self.times['end'])
          form.addRow(self.all_chan)
          form.addRow('Channel(s)',
                      self.idx_chan)
  
          btnlayout = QHBoxLayout()
          btnlayout.addStretch(1)
          btnlayout.addWidget(self.bbox)
  
          vlayout = QVBoxLayout()
          vlayout.addLayout(form)
          vlayout.addStretch(1)
          vlayout.addLayout(btnlayout)
  
          self.setLayout(vlayout)
docs: Create the dialog.