C++ (Qt)treeView->setModel(model);connect(treeView->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(directoryChanged(const QModelIndex &, const QModelIndex &)));
PythonQtCore.QObject.connect(self.treeview.selectionModel(), QtCore.SIGNAL('currentChanged(const QModelIndex, const QModelIndex)'), self.directoryChanged) def directoryChanged(self,a,b): c = self.treeview.model().filePath(a) print c
Pythonclass pyfileman_gui(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self, parent) ........................ ##описание формы def tree_columns(self): ....................... QtCore.QObject.connect(self.treeview.selectionModel(), QtCore.SIGNAL('currentChanged(const QModelIndex, const QModelIndex)'), self.selected_item_path) .......................