The index should point to the corresponding QtControl in the 
        enaml object hierarchy.
438117
def index(self, row, column, parent):
        
        item = parent.internalPointer()
        #: If the parent is None
        d = self.declaration if item is None else item.declaration
        if row < len(d._items):
            proxy = d._items[row].proxy
            assert isinstance(proxy, QtTreeViewItem), \
                "Invalid item {}".format(proxy)
        else:
            proxy = d.proxy
        return self.createIndex(row, column, proxy)
1048693
def index_to_widget(self, idx):
        """"""
        nchild = self.widget.get_nth_page(idx)
        return self._native_to_child(nchild)
525566
def flags(self, index):
        
        if not index.isValid():
            return 0

        cti = self.getItem(index)

        result = Qt.ItemIsSelectable

        if cti.enabled:
            result |= Qt.ItemIsEnabled

        if index.column() == self.COL_VALUE:
            result |= cti.valueColumnItemFlags

        return result
413981
def _itemComboBox(self, item, column):
        """"""
        if item.treeWidget() is not self:
            return None
        combobox = self.itemWidget(item, column)
        if not combobox:
            combobox = QComboBox(self)
            # combobox.setSizeAdjustPolicy(QComboBox.AdjustToContents)
            self.setItemWidget(item, column, combobox)
            width = 0
            for num, (name, icon) in enumerate(item._combobox_option_list[column]):
                if icon:
                    combobox.addItem(icon, name)
                else:
                    combobox.addItem(name)
                width = max(width, self._fontmetrics.width(name) + (icon and 16 or 0))
            combobox.setCurrentIndex(item._combobox_current_index[column])
            item._combobox_changed[column] = Kittens.utils.curry(self._updateItemComboBoxIndex, item, column)
            QObject.connect(combobox, SIGNAL("currentIndexChanged(int)"), item._combobox_changed[column])
            QObject.connect(combobox, SIGNAL("currentIndexChanged(int)"), self._emitUpdatedSignal)
            # resize section if needed
            width += 32
            if width > self.header().sectionSize(column):
                self.header().resizeSection(column, width)
        return combobox
166878
private int getNextChildIndex(InternalQName nameToAdd, InternalQName primaryTypeName, NodeData parentNode,
      NodeDefinitionData def) throws RepositoryException, ItemExistsException
   {
      boolean allowSns = def.isAllowsSameNameSiblings();

      int ind = 1;

      boolean hasSibling = dataManager.hasItemData(parentNode, new QPathEntry(nameToAdd, ind), ItemType.NODE);
      while (hasSibling)
      {
         if (allowSns)
         {
            ind++;
            hasSibling = dataManager.hasItemData(parentNode, new QPathEntry(nameToAdd, ind), ItemType.NODE);
         }
         else
         {
            throw new ItemExistsException("The node " + nameToAdd + " already exists in " + getPath()
               + " and same name sibling is not allowed ");
         }
      };

      return ind;
   }
157196
def _display_data(self, index):
        """"""
        return to_qvariant(self._data[index.row()][index.column()])
27869
def flags(self, index):
        
        if index.column() == 1:
            return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEditable
        else:
            return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable
1104127
def flags(self, index):
        """"""
        if not index.isValid():
            return Qt.ItemIsEnabled
        column = index.column()
        if column in [0, 1, 2, 3]:
            return Qt.ItemFlags(Qt.ItemIsEnabled)
        else:
            return Qt.ItemFlags(Qt.NoItemFlags)
308481
def getControllerRoleForTrackedDeviceIndex(self, unDeviceIndex):
        """"""

        fn = self.function_table.getControllerRoleForTrackedDeviceIndex
        result = fn(unDeviceIndex)
        return result
394465
def data(self, index, role=Qt.DisplayRole):
        
        try:
            if index.isValid():
                item = self.getItem(index, altItem=self.invisibleRootItem)
                return self.itemData(item, index.column(), role=role)
            else:
                return None
        except Exception as ex:
            # This Qt slot is called directly from the event loop so uncaught exception make the
            # application crash (exceptions can come from plugins here). Instead of crashing we
            # show the error message in the table/tree and hope the users report the error.
            if not DEBUGGING and role in (Qt.DisplayRole, Qt.EditRole, Qt.ToolTipRole,
                                          Qt.StatusTipRole, Qt.WhatsThisRole):
                return repr(ex)
            else:
                raise
83386
def initialize_ui(self):
        

        LOGGER.debug("> Initializing '{0}' Component ui.".format(self.__class__.__name__))

        self.Trace_Modules_Filter_lineEdit = Search_QLineEdit(self)
        self.Trace_Modules_Filter_lineEdit.search_active_label.hide()
        self.Trace_Modules_Filter_lineEdit.setPlaceholderText("Objects Trace Filter ...")
        self.Trace_Modules_Filter_horizontalLayout.addWidget(self.Trace_Modules_Filter_lineEdit)

        self.__model = ModulesModel(self, horizontal_headers=self.__headers)

        self.Modules_treeView.setParent(None)
        self.Modules_treeView = Modules_QTreeView(self, self.__model)
        self.Modules_treeView.setObjectName("Modules_treeView")
        self.Modules_treeView.setContextMenuPolicy(Qt.ActionsContextMenu)
        self.Trace_Ui_dockWidgetContents_gridLayout.addWidget(self.Modules_treeView, 0, 0)
        self.__view = self.Modules_treeView
        self.__view_add_actions()

        self.set_modules()

        # Signals / Slots.
        self.refresh_nodes.connect(self.__model__refresh_nodes)

        self.initialized_ui = True
        return True
846246
def setData(self, index, value, role):
        """"""
        if not index.isValid():
            return False

        item = self.item(index)
        column = index.column()

        if role == Qt.EditRole:
            items = list()
            items.append(item)

            if self.sync:
                parentIndex = self.parent(index)
                # Iterate over the siblings of the parent index.
                for sibling in self.siblings(parentIndex):
                    siblingNode = self.item(sibling)
                    for child in siblingNode.children:
                        if child.getItemData(0) == item.getItemData(0):
                            items.append(child)

            for item in items:
                columnData = str(item.getItemData(column))
                if columnData and columnData != value:
                    try:
                        item.setItemData(column, float(value))
                    except ValueError:
                        return False
                else:
                    return False

        elif role == Qt.CheckStateRole:
            item.setCheckState(value)
            if value == Qt.Unchecked or value == Qt.Checked:
                state = value
                self.itemCheckStateChanged.emit(index, state)

        self.dataChanged.emit(index, index)

        return True
1297239
def toggleModelIndex(self, modelIndex):
        
        if not self.isCheckable():
            return
            
        item = self.model().item(modelIndex.row())
        if item.checkState() == Qt.Checked:
            state = Qt.Unchecked
        else:
            state = Qt.Checked
        
        item.setCheckState(state)
647516
def select(self, index, command=QtGui.QItemSelectionModel.Toggle):
        """"""
        component = self.model().data(index, QtCore.Qt.UserRole)
        self.selectComponent(component, index)
1220971
def gotoPrevious(self):
        
        index = self._currentPanel.currentIndex() - 1
        if index < 0:
            index = self._currentPanel.count() - 1
        
        self._currentPanel.setCurrentIndex(index)
433755
def index(ctx, view):
    """"""
    adapter = ctx.obj['adapter']
    if view:
        click.echo(adapter.indexes())
        return
    adapter.ensure_indexes()
1307355
def data(self, index, role=Qt.DisplayRole):
        

        if not index.isValid():
            return QVariant()

        if role == Qt.DisplayRole:
            return QVariant(self.__languages[index.row()].name)
        return QVariant()