本文整理汇总了Python中PyQt4.QtCore.QStringList类的典型用法代码示例。如果您正苦于以下问题:Python QStringList类的具体用法?Python QStringList怎么用?Python QStringList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QStringList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
"""
Constructor
"""
ConfigurationPageBase.__init__(self)
self.setupUi(self)
self.setObjectName("EditorKeywordsPage")
# set initial values
self.__keywords = {
"": QStringList(["", "", "", "", "", "", "", "", "", ""])
}
languages = [''] + QScintilla.Lexers.getSupportedLanguages().keys()
languages.sort()
for lang in languages:
if lang:
lex = QScintilla.Lexers.getLexer(lang)
if isinstance(lex, LexerContainer):
continue
keywords = Preferences.getEditorKeywords(lang)[:]
if keywords.isEmpty():
keywords = QStringList("")
for kwSet in range(1, 10):
kw = lex.keywords(kwSet)
if kw is None:
kw = ""
keywords.append(kw)
self.__keywords[lang] = keywords
self.languageCombo.addItem(lang)
self.currentLanguage = QString()
self.currentSet = 1
self.on_languageCombo_activated(self.currentLanguage)
示例2: __init__
def __init__(self, methodName):
"""Run once on class initialisation."""
unittest.TestCase.__init__(self, methodName)
myPath = os.path.join(TEST_DATA_DIR, 'landsat.tif')
rasterFileInfo = QFileInfo(myPath)
mRasterLayer = QgsRasterLayer(rasterFileInfo.filePath(),
rasterFileInfo.completeBaseName())
rasterRenderer = QgsMultiBandColorRenderer(
mRasterLayer.dataProvider(), 2, 3, 4)
mRasterLayer.setRenderer(rasterRenderer)
#pipe = mRasterLayer.pipe()
#assert pipe.set(rasterRenderer), 'Cannot set pipe renderer'
QgsMapLayerRegistry.instance().addMapLayers([mRasterLayer])
# create composition with composer map
self.mMapRenderer = QgsMapRenderer()
layerStringList = QStringList()
layerStringList.append(mRasterLayer.id())
self.mMapRenderer.setLayerSet(layerStringList)
self.mMapRenderer.setProjectionsEnabled(False)
self.mComposition = QgsComposition(self.mMapRenderer)
self.mComposition.setPaperSize(297, 210)
self.mComposerMap = QgsComposerMap(self.mComposition, 20, 20, 200, 100)
self.mComposerMap.setFrameEnabled(True)
self.mComposition.addComposerMap(self.mComposerMap)
示例3: onSelectFolder
def onSelectFolder(self):
Fdialog = QFileDialog()
Fdialog.setFileMode(QFileDialog.DirectoryOnly)
if Fdialog.exec_():
folderPath = QStringList(Fdialog.selectedFiles())
self.ui.dirEdit.setText(folderPath.takeFirst())
示例4: get_string_list
def get_string_list(self, column):
"""Returns a column as a QStringList"""
tempList = QStringList()
result = QtSql.QSqlQuery('''SELECT DISTINCT %s FROM presentations''' % column)
while result.next():
tempList.append(result.value(0).toString())
return tempList
示例5: set_root_folder
def set_root_folder(self, root_folder):
self.tree.clear()
self.clear_all_load_animations()
if self.root_folder != None:
del self.root_folder
self.root_folder = root_folder
# Add root
columns = QStringList()
columns.append(root_folder.get_name())
columns.append(root_folder.get_size())
root_item = QTreeWidgetItem(columns)
self.set_icon(root_folder.mime_type, root_item)
self.tree.addTopLevelItem(root_item)
root_item.setExpanded(True)
root_folder.tree_item = root_item
self.generate_children(root_folder)
self.add_loading_widgets(root_folder)
self.tree.setCurrentItem(root_item)
self.start_load_anim(root_folder)
self.tree.header().resizeSections(QHeaderView.ResizeToContents)
示例6: __init__
def __init__(self, parent=None, TreeFileName=DefaultTreeFileName):
QTreeWidget.__init__(self, parent)
self.parent = parent
self.setGeometry(0,0, self.parent.width(), self.parent.height())
self.setColumnCount(2)
self.setColumnWidth(0,270)
#self.header().setStretchLastSection(False)
#self.resizeColumnToContents(1)
headerTitles = QStringList()
headerTitles.append(QString("Parameter"))
headerTitles.append(QString("Value"))
self.setHeaderLabels(headerTitles)
self.setEditTriggers(QTreeWidget.DoubleClicked|QTreeWidget.EditKeyPressed)
self.rootItems = []
self.currentItemChanged.connect(self.visit)
self.itemDoubleClicked.connect(self.edit_)
self.editing = None
self.expandAll()
self.ScenarioName = ''
self.NodeDescriptions = dict() # textual parameter descriptions
self.ParamScenario = dict() # name of corresponding scenario for parameters
self.changed = False
self.ApplicationPath = ''
self.TreeFileName = TreeFileName
self.RunCfgFileName = DefaultCfgFileName
self.load()
self.parent.setWindowTitle(self.NodeValue('Title').replace('_',' ') + ' ' + DefaultTtitle)
示例7: _nameList
def _nameList(self, filt = None, without = None, upto = None):
# need to search all tables for a string list of object names
# filt is a ModuleBase subclass to filter by
# without is a row number to exclude from the current table
# upto means only look at objects up to "upto" row in the current table
if (filt, without, upto) in self._cachedNameList:
timestamp, sl = self._cachedNameList[(filt, without, upto)]
if self._parent.lastModified() < timestamp:
return sl
sl = QStringList()
for name in self._parent.getTableNames():
table = self._parent._tables[name]
# if we have a filter, then make sure this table is a subclass of it
if filt is not None and not issubclass(table.ob, filt):
# if we are only going up to a certain table and this is it
if table == self and upto is not None:
return sl
continue
for i,trow in enumerate(table.rows):
if table == self:
# if the current table is self, make sure we are excluding
# the without row
if without is not None and without == i:
continue
# make sure we only go up to upto
if upto is not None and upto == i:
return sl
# add a non-null name, which is not commented out to the list
if not trow[2].isNull() and not \
(not trow[0].isNull() and trow[0].toBool() == True):
sl.append(trow[2].toString())
# store the cached value
self._cachedNameList[(filt, without, upto)] = (time.time(), sl)
return sl
示例8: getThemeList
def getThemeList(self):
dir = QDir("/usr/share/enlightenment/data/themes")
dir.setFilter( QDir.NoSymLinks | QDir.Files )
a = QStringList()
a.append("*.edj")
dir.setNameFilters(a)
return dir.entryList()
示例9: save
def save(self):
"""
Public slot to save the Icons configuration.
"""
dirList = QStringList()
for i in range(self.iconDirectoryList.count()):
dirList.append(self.iconDirectoryList.item(i).text())
Preferences.setIcons("Path", dirList)
示例10: list
def list(self):
q = QSqlQueryModel()
q.setQuery("SELECT name FROM platform")
strlist = QStringList()
strlist.append(u"全部")
for i in range(q.rowCount()):
strlist.append(q.record(i).value(0).toString())
return strlist
示例11: set_devlist
def set_devlist(self, devlist, isWIN32):
qslist = QStringList()
if isWIN32:
for dev in devlist:
qslist.append(QString(dev.description))
else:
for dev in self.capturer.devlist:
qslist.append(QString(dev.name))
self.devComboBox.addItems(qslist)
示例12: buildQStringList
def buildQStringList(items):
"""
@rtype: QStringList
"""
returnData = QStringList()
for item in items:
returnData.append(item)
return returnData
示例13: fieldNames
def fieldNames(layer):
fields = layer.dataProvider().fields()
if QGis.QGIS_VERSION_INT < 10900:
from PyQt4.QtCore import QStringList
fieldNames = QStringList()
for field in fields.values():
fieldNames.append(field.name())
else:
return map(lambda field: field.name(), fields)
示例14: __extractFileFilters
def __extractFileFilters(self):
"""
Private method to extract the file filters.
"""
filters = QStringList()
for row in range(self.fileFiltersList.count()):
filters.append(self.fileFiltersList.item(row).text())
if self.__showsOpenFilters:
self.openFileFilters = filters
else:
self.saveFileFilters = filters
示例15: mimeTypes
def mimeTypes(self):
"""
Reimplements the :meth:`QAbstractItemModel.mimeTypes` method.
:return: Mime types.
:rtype: QStringList
"""
types = QStringList()
types.append("application/x-umbragraphmodeldatalist")
return types