code: def update_button_status(self):
          
          # enable/disable ok button
          if len(self.displaced.currentField()) > 0:
              self.button_box.button(
                  QtWidgets.QDialogButtonBox.Ok).setEnabled(True)
          else:
              self.button_box.button(
                  QtWidgets.QDialogButtonBox.Ok).setEnabled(False)
docs: Function to enable or disable the Ok button.