当前位置: 首页>>代码示例>>Python>>正文


Python QFileSystemModel.filePath方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QFileSystemModel.filePath方法的典型用法代码示例。如果您正苦于以下问题:Python QFileSystemModel.filePath方法的具体用法?Python QFileSystemModel.filePath怎么用?Python QFileSystemModel.filePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QFileSystemModel的用法示例。


在下文中一共展示了QFileSystemModel.filePath方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: AttachmentView

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]
class AttachmentView(QListView):
    """ A dockWidget displaying attachments of the current note.
    """

    def __init__(self, parent=None):
        super(AttachmentView, self).__init__(parent)
        self.parent = parent
        self.settings = parent.settings

        self.model = QFileSystemModel()
        self.model.setFilter(QDir.Files)
        self.model.setRootPath(self.settings.attachmentPath)
        self.setModel(self.model)

        # self.setRootIndex(self.model.index(self.settings.attachmentPath))
        self.setViewMode(QListView.IconMode)
        self.setUniformItemSizes(True)
        self.setResizeMode(QListView.Adjust)
        self.setItemDelegate(AttachmentItemDelegate(self))
        self.clicked.connect(self.click)

    def contextMenuEvent(self, event):
        menu = QMenu()
        indice = self.selectedIndexes()
        if len(indice):
            menu.addAction("Insert into note", self.insert)
            menu.addAction("Delete", self.delete)
        else:
            pass
        menu.exec_(event.globalPos())

    def mousePressEvent(self, event):
        """ Trigger click() when an item is pressed.
        """
        self.clearSelection()
        QListView.mousePressEvent(self, event)

    def mouseReleaseEvent(self, event):
        """ Trigger click() when an item is pressed.
        """
        self.clearSelection()
        QListView.mouseReleaseEvent(self, event)

    def insert(self):
        indice = self.selectedIndexes()
        for i in indice:
            filePath = self.model.filePath(i)
            filePath = filePath.replace(self.settings.notebookPath, "..")
            fileName = os.path.basename(filePath)
            text = "![%s](%s)" % (fileName, filePath)
            self.parent.notesEdit.insertPlainText(text)

    def delete(self):
        indice = self.selectedIndexes()
        for i in indice:
            filePath = self.model.filePath(i)
            QFile(filePath).remove()

    def click(self, index):
        self.setCurrentIndex(index)
开发者ID:mjnaderi,项目名称:mikidown,代码行数:62,代码来源:attachment.py

示例2: Explorador

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]
class Explorador(custom_dock.CustomDock):

    def __init__(self, parent=None):
        custom_dock.CustomDock.__init__(self)
        self.explorador = QTreeView()
        self.setWidget(self.explorador)
        self.explorador.header().setHidden(True)
        self.explorador.setAnimated(True)

        # Modelo
        self.modelo = QFileSystemModel(self.explorador)
        path = QDir.toNativeSeparators(QDir.homePath())
        self.modelo.setRootPath(path)
        self.explorador.setModel(self.modelo)
        self.modelo.setNameFilters(["*.c", "*.h", "*.s"])
        self.explorador.setRootIndex(QModelIndex(self.modelo.index(path)))
        self.modelo.setNameFilterDisables(False)

        # Se ocultan algunas columnas
        self.explorador.hideColumn(1)
        self.explorador.hideColumn(2)
        self.explorador.hideColumn(3)

        # Conexion
        self.explorador.doubleClicked.connect(self._abrir_archivo)

        EDIS.cargar_lateral("explorador", self)

    def _abrir_archivo(self, i):
        if not self.modelo.isDir(i):
            indice = self.modelo.index(i.row(), 0, i.parent())
            archivo = self.modelo.filePath(indice)
            principal = EDIS.componente("principal")
            principal.abrir_archivo(archivo)
开发者ID:ekimdev,项目名称:edis,代码行数:36,代码来源:explorador.py

示例3: Explorer

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]
class Explorer(QTreeView):

    def __init__(self, parent=None):
        QTreeView.__init__(self)
        self.header().setHidden(True)
        self.setAnimated(True)

        # Modelo
        self.model = QFileSystemModel(self)
        path = QDir.toNativeSeparators(QDir.homePath())
        self.model.setRootPath(path)
        self.setModel(self.model)
        self.model.setNameFilters(["*.c", "*.h", "*.s"])
        self.setRootIndex(QModelIndex(self.model.index(path)))
        self.model.setNameFilterDisables(False)

        # Se ocultan algunas columnas
        self.hideColumn(1)
        self.hideColumn(2)
        self.hideColumn(3)

        # Conexion
        self.doubleClicked.connect(self._open_file)

        Edis.load_lateral("explorer", self)

    def _open_file(self, i):
        if not self.model.isDir(i):
            indice = self.model.index(i.row(), 0, i.parent())
            archivo = self.model.filePath(indice)
            principal = Edis.get_component("principal")
            principal.open_file(archivo)
开发者ID:centaurialpha,项目名称:edis,代码行数:34,代码来源:explorer.py

示例4: DirectoryWidget

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]

#.........这里部分代码省略.........
        setButton.setDefaultAction(self.setAction)
        setButton.setAutoRaise(True)
        hiddenButton = QToolButton()
        hiddenButton.setDefaultAction(hiddenAction)
        hiddenButton.setAutoRaise(True)

        hbox = QHBoxLayout()
        hbox.addWidget(upButton)
        hbox.addWidget(synchButton)
        hbox.addWidget(newButton)
        hbox.addWidget(setButton)
        hbox.addWidget(hiddenButton)
        vbox = QVBoxLayout(self)
        vbox.addLayout(hbox)
        vbox.addWidget(self.lineEdit)
        vbox.addWidget(self.listView)
        vbox.addWidget(filterLabel)
        vbox.addWidget(filterLineEdit)

    def toggleHidden(self, toggled):
        base = QDir.AllDirs|QDir.AllEntries|QDir.NoDotAndDotDot
        if toggled:
            self.model.setFilter(base|QDir.Hidden)
        else:
            self.model.setFilter(base)

    def gotoFolder(self):
        text = self.lineEdit.text()
        self.listView.setRootIndex(self.proxyModel.mapFromSource(self.model.index(text, 0)))

    def rootChanged(self):
        index1 = self.listView.rootIndex()
        index2 = self.proxyModel.mapToSource(index1)
        self.lineEdit.setText(self.model.filePath(index2))
        self.listView.setCurrentIndex(index1)

    def customContext(self, pos):
        index = self.listView.indexAt(pos)
        index = self.proxyModel.mapToSource(index)
        if not index.isValid():
            self.rmAction.setEnabled(False)
            self.openAction.setEnabled(False)
            self.loadAction.setEnabled(False)
        elif not self.model.isDir(index):
            info = self.model.fileInfo(index)
            suffix = info.suffix()
            if suffix in ("Rd","Rdata","RData"):
                self.loadAction.setEnabled(True)
                self.openAction.setEnabled(False)
                self.loadExternal.setEnabled(False)
            elif suffix in ("txt","csv","R","r"):
                self.openAction.setEnabled(True)
                self.loadAction.setEnabled(False)
                self.loadExternal.setEnabled(True)
            else:
                self.loadAction.setEnabled(False)
                self.openAction.setEnabled(False)
                self.loadExternal.setEnabled(True)
        menu = QMenu(self)
        for action in self.actions:
            menu.addAction(action)
        menu.exec_(self.listView.mapToGlobal(pos))

    def openItem(self):
        index = self.listView.currentIndex()
        index = self.proxyModel.mapToSource(index)
开发者ID:wioota,项目名称:ftools-qgis,代码行数:70,代码来源:widgets.py

示例5: DirView

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]
class DirView(QTreeView):
    """Base file/directory tree view"""

    def __init__(self, parent=None):
        super(DirView, self).__init__(parent)
        self.name_filters = None
        self.parent_widget = parent
        self.valid_types = None
        self.show_all = None
        self.menu = None
        self.common_actions = None
        self.__expanded_state = None
        self._to_be_loaded = None
        self.fsmodel = None
        self.setup_fs_model()
        self._scrollbar_positions = None

    # ---- Model
    def setup_fs_model(self):
        """Setup filesystem model"""
        filters = QDir.AllDirs | QDir.Files | QDir.Drives | QDir.NoDotAndDotDot
        self.fsmodel = QFileSystemModel(self)
        self.fsmodel.setFilter(filters)
        self.fsmodel.setNameFilterDisables(False)

    def install_model(self):
        """Install filesystem model"""
        self.setModel(self.fsmodel)

    def setup_view(self):
        """Setup view"""
        self.install_model()
        self.connect(self.fsmodel, SIGNAL("directoryLoaded(QString)"), lambda: self.resizeColumnToContents(0))
        self.setAnimated(False)
        self.setSortingEnabled(True)
        self.sortByColumn(0, Qt.AscendingOrder)

    def set_name_filters(self, name_filters):
        """Set name filters"""
        self.name_filters = name_filters
        self.fsmodel.setNameFilters(name_filters)

    def set_show_all(self, state):
        """Toggle 'show all files' state"""
        if state:
            self.fsmodel.setNameFilters([])
        else:
            self.fsmodel.setNameFilters(self.name_filters)

    def get_filename(self, index):
        """Return filename associated with *index*"""
        if index:
            return osp.normpath(unicode(self.fsmodel.filePath(index)))

    def get_index(self, filename):
        """Return index associated with filename"""
        return self.fsmodel.index(filename)

    def get_selected_filenames(self):
        """Return selected filenames"""
        if self.selectionMode() == self.ExtendedSelection:
            return [self.get_filename(idx) for idx in self.selectedIndexes()]
        else:
            return [self.get_filename(self.currentIndex())]

    def get_dirname(self, index):
        """Return dirname associated with *index*"""
        fname = self.get_filename(index)
        if fname:
            if osp.isdir(fname):
                return fname
            else:
                return osp.dirname(fname)

    # ---- Tree view widget
    def setup(self, name_filters=["*.py", "*.pyw"], valid_types=(".py", ".pyw"), show_all=False):
        """Setup tree widget"""
        self.setup_view()

        self.set_name_filters(name_filters)
        self.valid_types = valid_types
        self.show_all = show_all

        # Setup context menu
        self.menu = QMenu(self)
        self.common_actions = self.setup_common_actions()

    # ---- Context menu
    def setup_common_actions(self):
        """Setup context menu common actions"""
        # Filters
        filters_action = create_action(
            self, _("Edit filename filters..."), None, get_icon("filter.png"), triggered=self.edit_filter
        )
        # Show all files
        all_action = create_action(self, _("Show all files"), toggled=self.toggle_all)
        all_action.setChecked(self.show_all)
        self.toggle_all(self.show_all)

        return [filters_action, all_action]
#.........这里部分代码省略.........
开发者ID:koll00,项目名称:Gui_SM,代码行数:103,代码来源:explorer.py

示例6: Window

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]

#.........这里部分代码省略.........
    self._splitter.setCollapsible(0, False)

    self._layout = QGridLayout()
    self._layout.addWidget(self._splitter)
    self._switch_to_normal()
    central_widget.setLayout(self._layout)

    self._file_tree.installEventFilter(self);

    self.resize(800, 600)
    self.setWindowTitle('pyQtures')
    self.setCentralWidget(central_widget)
    self.show()

  def eventFilter(self, widget, event):
    if event.type() == QEvent.KeyPress:
      if event.key() == Qt.Key_Tab:
        self._toggle_path_suffix()
        return True
    return QMainWindow.eventFilter(self, widget, event)

  def _toggle_path_suffix(self):
    self._use_suffix = not self._use_suffix
    self._update_path()

  def _switch_to_fullscreen(self):
    self._splitter.widget(0).hide()
    self._layout.setMargin(0)
    self.showFullScreen()

  def _switch_to_normal(self):
    self._splitter.widget(0).show()
    self._layout.setMargin(4)
    self.showNormal()

  def keyPressEvent(self, key_event):  # Signal handler.
    key = key_event.key()
    if self.isFullScreen():
      self._full_screen_key_handler(key)
    else:
      self._normal_key_handler(key)

  def _full_screen_key_handler(self, key):
    if Qt.Key_Escape == key:
      self._switch_to_normal()
    elif Qt.Key_Return == key:
      self._switch_to_normal()
    elif Qt.Key_Up == key:
      self._go_to_sibling_image(-1)
    elif Qt.Key_Down == key:
      self._go_to_sibling_image(1)
    elif Qt.Key_Tab == key:
      self._toggle_path_suffix()

  def _go_to_sibling_image(self, offset):
    current = self._file_selection_model.currentIndex()
    nxt = current.sibling(current.row() + offset, current.column())
    if (nxt.parent() != current.parent()):
      return
    # TODO(eustas): Iterate through dirs?
    self._file_selection_model.setCurrentIndex(nxt, QItemSelectionModel.SelectCurrent)

  def _normal_key_handler(self, key):
    if Qt.Key_Escape == key:
      QCoreApplication.instance().quit()
    elif Qt.Key_Return == key:
      self._switch_to_fullscreen()

  def _on_current_file_changed(self, new_current):
    new_path = self._file_model.filePath(new_current)
    if not self._current_path == new_path:
        self._current_path = new_path
        self._update_path()

  def _update_path(self):
    if not self._use_suffix:
      self._viewer.set_path(self._current_path)
      return

    self._viewer.reset_path()
    if not self._current_path:
      return

    selected_file = QFileInfo(self._current_path)
    if not selected_file.exists():
      return

    selected_dir = selected_file.absoluteDir()
    file_name = selected_file.fileName()
    if not selected_dir.exists():
      return

    if not selected_dir.cd('converted'):
      return

    suffixed_path = selected_dir.absoluteFilePath(file_name)
    self._viewer.set_path(suffixed_path)

  def _on_tree_expanded_collapsed(self, unused_index):
    QTimer.singleShot(1, lambda: self._file_tree.resizeColumnToContents(0))
开发者ID:eustas,项目名称:PyQtures,代码行数:104,代码来源:main.py

示例7: MainWindow

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]
class MainWindow(QWidget):
    
    '''
    The initial method creates the window and connects the rename method.
    '''
    def __init__(self):
        QWidget.__init__(self)
        
        self.setWindowTitle("cuteRenamer")

        #Set Data-Model for showing the directories
        self.dirModel = QFileSystemModel()
        self.dirModel.setRootPath('/')
        self.dirModel.setFilter(QDir.AllDirs | QDir.NoDotAndDotDot)#Show only directories without '.' and '..'
        #Set the view for the directories
        self.dirView = QTreeView()
        self.dirView.setModel(self.dirModel)
        #Show only the directories in the view
        self.dirView.setColumnHidden(1, True)
        self.dirView.setColumnHidden(2, True)
        self.dirView.setColumnHidden(3, True)
        
        self.dirView.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        
        #Listedit for the optional listfile
        listPathLabel = QLabel("Path to list:")
        self.listPathEdit = QLineEdit()
        
        #Start renaming with number...
        startLabel = QLabel("Start (default is 1)")
        self.startEdit = QLineEdit()
        
        #LineEdit for the prefix
        prefixLabel = QLabel("Prefix")
        self.prefixEdit = QLineEdit()
        
        #LineEdit for the postfix
        postfixLabel = QLabel("Postfix")
        self.postfixEdit = QLineEdit()
        
        #Checkbox to conserve file extensions
        self.checkboxConserve = QCheckBox("Conserve file extensions")
        checkboxLayout = QHBoxLayout()
        checkboxLayout.addStretch(1)
        checkboxLayout.addWidget(self.checkboxConserve)
        
        #The button to start renaming
        renameButton = QPushButton('Rename!')
        buttonsLayout = QHBoxLayout()
        buttonsLayout.addStretch(1)
        buttonsLayout.addWidget(renameButton)
        
        vertical = QVBoxLayout()
        vertical.addWidget(self.dirView)
        vertical.addSpacing(10)
        vertical.addWidget(listPathLabel)
        vertical.addWidget(self.listPathEdit)
        vertical.addSpacing(10)
        vertical.addWidget(startLabel)
        vertical.addWidget(self.startEdit)
        vertical.addSpacing(10)
        vertical.addWidget(prefixLabel)
        vertical.addWidget(self.prefixEdit)
        vertical.addSpacing(10)
        vertical.addWidget(postfixLabel)
        vertical.addWidget(self.postfixEdit)
        vertical.addSpacing(10)
        vertical.addLayout(checkboxLayout)
        vertical.addSpacing(20)
        vertical.addLayout(buttonsLayout)
        
        self.setLayout(vertical)
        
        #If the button is clicked start the renaming
        self.connect(renameButton, SIGNAL('clicked()'), self.rename)
    
    '''
    This method prepares all options and starts the rename progress.
    '''
    def rename(self):
        selectedIndex = self.dirView.selectedIndexes()
        
        if self.listPathEdit.text() == "":
            print "Read the whole directory"
            
            files = os.listdir(self.dirModel.filePath(selectedIndex[0]))
        
        elif (not self.listPathEdit.text() == "") and os.path.isfile(self.listPathEdit.text()):
            print "Read filenames from %s" % self.listPathEdit.text()
            
            files = [i.rstrip('\n') for i in open(self.listPathEdit.text(), "r")]
        
        else:
            print "Path to list doesn't exist or is not a file!"
        
        if not self.startEdit.text() == "":
            start = int(self.startEdit.text())
        
        else:
            start = 1
#.........这里部分代码省略.........
开发者ID:raymontag,项目名称:cuteRenamer,代码行数:103,代码来源:classes.py

示例8: SourceFileTreeWidget

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]
class SourceFileTreeWidget(QWidget):
    """ Config window"""
    def __init__(self, parent):
        super(SourceFileTreeWidget, self).__init__(parent)
        self.ui = Ui_SourceFileTreeWidget()
        self.ui.setupUi(self)
        self.file_model = QFileSystemModel()
        #self.file_model.setFilter(QDir.AllEntries | QDir.NoDot)
        self.set_filter()
        self.ui.tree.setModel(self.file_model)
        self.ui.tree.resizeColumnToContents(0)
        self.ui.custom_root.setText(QDir.currentPath())
        self.set_root()

        header = self.ui.tree.header()
        header.setResizeMode(QHeaderView.ResizeToContents)
        #header.setStretchLastSection(True)
        #header.setSortIndicator(0, Qt.AscendingOrder)
        #header.setSortIndicatorShown(True)
        #header.setClickable(True)
        self.connect(self.ui.tree, QtCore.SIGNAL('doubleClicked(QModelIndex)'), self.open_file)
        self.connect(self.ui.ok_filter, QtCore.SIGNAL('clicked()'), self.set_filter)
        self.connect(self.ui.custom_filter, QtCore.SIGNAL('returnPressed()'), self.set_filter)
        self.connect(self.ui.ok_root, QtCore.SIGNAL('clicked()'), self.set_root)
        self.connect(self.ui.custom_root, QtCore.SIGNAL('returnPressed()'), self.set_root)
        self.open_file_signal = None

    def set_open_file_signal(self, signal):
        """ callback to signal file opening """
        self.open_file_signal = signal

    def set_root(self, root=None, use_common_prefix=True):
        """ set the root path of the widget """
        curr = str(self.ui.custom_root.text())
        if not root:
            use_common_prefix = False # input text box will override it.
            root = self.ui.custom_root.text()
        else:
            self.ui.custom_root.setText(root)
        idx = self.file_model.index(root)
        self.ui.tree.setExpanded(idx, True)
        if use_common_prefix and curr == os.path.commonprefix([root, curr]):
            return

        idx = self.file_model.setRootPath(root)
        if not idx.isValid():
            logging.warn('Invalid path')
            return
        self.ui.tree.setRootIndex(idx)
        self.ui.tree.setExpanded(idx, True)

    def set_filter(self):
        """ set filter by extension """
        filters = str(self.ui.custom_filter.text()).split(';')
        self.file_model.setNameFilters(filters)
        self.file_model.setNameFilterDisables(False)

    def open_file(self, idx):
        """ emit file opening signal """
        if self.file_model.isDir(idx):
            return
        fullpath = self.file_model.filePath(idx)
        if self.open_file_signal:
            self.open_file_signal.emit(str(fullpath), 0)

    def set_file_selected(self, tab_idx):
        """ slot to associate the file in active tab """
        filename = self.sender().tabToolTip(tab_idx)
        idx = self.file_model.index(filename)
        if idx.isValid():
            self.ui.tree.selectionModel().select(idx, QItemSelectionModel.ClearAndSelect)
开发者ID:c0deforfun,项目名称:LLL,代码行数:73,代码来源:SourceFileTreeWidget.py

示例9: mainInitial

# 需要导入模块: from PyQt4.QtGui import QFileSystemModel [as 别名]
# 或者: from PyQt4.QtGui.QFileSystemModel import filePath [as 别名]
class mainInitial(QtGui.QMainWindow):
  def  __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_MainWindow() #treeview  UI
        self.ui.setupUi(self)
        self.showMaximized()
        self.home=os.getcwd()
        self.fileSystemModel = QFileSystemModel()


        #self.home=self.home + "/connections"
        #print (self.home)
        self.fillGrid2(self.home)
        #self.ui.treeWidget.isSortingEnabled()
        #self.ui.treeWidget.setSortingEnabled(True)
        self.ui.treeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.connect(self.ui.treeView, QtCore.SIGNAL("customContextMenuRequested(const QPoint &)"), self.onclick)
        #self.connect(self.ui.treeView.selectionModel(),
        #    SIGNAL("customContextMenuRequested(pressed)"), self.onclick)


#  def eventFilter(self, obj, event):
#        if event.type() in (QtCore.QEvent.MouseButtonPress, QtCore.QEvent.MouseButtonDblClick):
#            if event.button() == QtCore.Qt.LeftButton:
#                print "left"
#                return True
#            elif event.button() == QtCore.Qt.RightButton:
#                print "Right"
#                return True
#        return super(mainInitial, self).eventFilter(obj, event)
#
#       #self.button2.clicked.connect(self.on_button_clicked)
#
#       #self.button1.installEventFilter(self)

  @QtCore.pyqtSlot(QtCore.QModelIndex)
  def onclick(self,selected):
      index=self.ui.treeView.indexAt(selected)
      #getSelected= self.ui.treeView.selectedItems()
      print (index)
      fileinfo = QtCore.QFileInfo(self.fileSystemModel.fileInfo(index) )
      print (fileinfo)
      path = self.fileSystemModel.filePath(index)
      #pathABS =self.fileSystemModel.rootPath(index)
      print path
      #print pathABS
      if self.fileSystemModel.isDir(index):
          print ("es directorio")
      else:
          print ("es archivo")

      menu=QtGui.QMenu(self)
      action_1=menu.addAction("crear coneccion")
      action_1.triggered.connect(self.action1)
      action_2=menu.addAction("borrar coneccion")
      action_3=menu.addAction("Modificar coneccion")
      action_4=menu.addAction("Crear Carpeta")
      menu.exec_(QtGui.QCursor.pos())
      #menu1=self.menu.addAction(u'algo')

      #menu1.triggered.connect(self.M1clear)
      #print ("determinar si esta vacio, es archivo o carpeta derecho")

  def action1(self, index):
      print "accion lanzada action_1"
      #self.fileSystemModel.mkdir()
      #print (self.ui.treeView.indexAt(index))

  def fillGrid2(self,home):
        print (QDir.currentPath())
        self.fileSystemModel.setRootPath(QDir.currentPath())
        self.ui.treeView.setModel(self.fileSystemModel)
        self.ui.treeView.setRootIndex(self.fileSystemModel.index(QDir.currentPath()))
        self.ui.treeView.hideColumn(1)
        self.ui.treeView.hideColumn(2)
        self.ui.treeView.hideColumn(3)
开发者ID:yeimiJuarez,项目名称:SSHingON,代码行数:78,代码来源:SSHingON.py


注:本文中的PyQt4.QtGui.QFileSystemModel.filePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。