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


Python QStringList.prepend方法代码示例

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


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

示例1: path_from_index

# 需要导入模块: from PyQt4.QtCore import QStringList [as 别名]
# 或者: from PyQt4.QtCore.QStringList import prepend [as 别名]
    def path_from_index(self, index):
        """ Reimplemented. Finds part of a path given the index of
        the last part required.

        """
        data_list = QStringList()
        while index.isValid():
            data_list.prepend(self.model().data(index).toString())
            index = index.parent()
        ret = data_list.join("/")
        print "path from index: %s" % (data_list.join(" :: "))
        return ret
开发者ID:aminembarki,项目名称:eilat,代码行数:14,代码来源:MainWin.py

示例2: __qtReorderFilter

# 需要导入模块: from PyQt4.QtCore import QStringList [as 别名]
# 或者: from PyQt4.QtCore.QStringList import prepend [as 别名]
def __qtReorderFilter(filter, selectedFilter = None):
    """
    Private function to reorder the file filter to cope with a KDE issue introduced
    by distributors usage of KDE file dialogs.
    
    @param filter Qt file filter (QString or string)
    @param selectedFilter this is set to the selected filter (QString or string)
    @return the rearranged Qt file filter (QString)
    """
    if selectedFilter is not None and not Globals.isMacPlatform():
        fileFilters = QStringList(filter.split(';;'))
##        fileFilters.removeAll(selectedFilter)
        fileFilters.prepend(selectedFilter)
        return fileFilters.join(";;")
    else:
        return filter
开发者ID:usc-bbdl,项目名称:R01_HSC_cadaver_system,代码行数:18,代码来源:KQFileDialog.py

示例3: __convertFilter

# 需要导入模块: from PyQt4.QtCore import QStringList [as 别名]
# 或者: from PyQt4.QtCore.QStringList import prepend [as 别名]
 def __convertFilter(filter, selectedFilter = None):
     """
     Private function to convert a Qt file filter to a KDE file filter.
     
     @param filter Qt file filter (QString or string)
     @param selectedFilter this is set to the selected filter
     @return the corresponding KDE file filter (QString)
     """
     rx = QRegExp("^[^(]*\(([^)]*)\).*$")
     fileFilters = filter.split(';;')
     
     newfilter = QStringList()
     for fileFilter in fileFilters:
         sf = selectedFilter and selectedFilter.compare(fileFilter) == 0
         namefilter = QString(fileFilter).replace(rx, "\\1")
         fileFilter = QString(fileFilter).replace('/', '\\/')
         if sf:
             newfilter.prepend("%s|%s" % (namefilter, fileFilter))
         else:
             newfilter.append("%s|%s" % (namefilter, fileFilter))
     return newfilter.join('\n')
开发者ID:usc-bbdl,项目名称:R01_HSC_cadaver_system,代码行数:23,代码来源:KQFileDialog.py


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