code: def ensureVisible(self, viewType):
          
          # make sure we're not trying to switch to the same type
          view = self.currentView()
          if type(view) == viewType:
              return view
  
          self.blockSignals(True)
          self.setUpdatesEnabled(False)
  
          for i in xrange(self.count()):
              widget = self.widget(i)
              if type(widget) == viewType:
                  self.setCurrentIndex(i)
                  view = widget
                  break
          else:
              view = self.addView(viewType)
  
          self.blockSignals(False)
          self.setUpdatesEnabled(True)
  
          return view
docs: Find and switch to the first tab of the specified view type. If the
          type does not exist, add it.
  
          :param     viewType | <subclass of XView>
  
          :return    <XView> || None