code: def refresh(self, reloadData=False, force=False):
          if not (self.isVisible() or force):
              self._refreshTimer.start()
              return
          if self.isLoading():
              return
          if reloadData:
              self.refreshQueryRecords()
          self._refreshTimer.stop()
          self.worker().cancel()
          if self._popup:
              self._popup.close()
          currset = self.currentRecordSet()
          self.worker().setBatched(self.isPaged())
          self.worker().setBatchSize(self.pageSize())
          if self._searchTerms:
              currset.setGroupBy(None)
              pageSize = 0
          elif self.groupBy() and self.isGroupingActive():
              currset.setGroupBy(self.groupBy())
          else:
              currset.setGroupBy(None)
          if self.order():
              currset.setOrdered(True)
              currset.setOrder(self.order())
          if self.useLoader():
              loader = XLoaderWidget.start(self)
          if self.specifiedColumnsOnly():
              currset.setColumns(map(lambda x: x.name(),
                                     self.specifiedColumns()))
          self._loadedColumns = set(self.visibleColumns())
          if self.isThreadEnabled() and currset.isThreadEnabled():
              self.worker().setPreloadColumns(self._preloadColumns)
              self.loadRequested.emit(currset)
          else:
              QApplication.setOverrideCursor(Qt.WaitCursor)
              self.worker().loadRecords(currset)
              QApplication.restoreOverrideCursor()