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


Python QtGui.QStringListModel类代码示例

本文整理汇总了Python中PyQt4.QtGui.QStringListModel的典型用法代码示例。如果您正苦于以下问题:Python QStringListModel类的具体用法?Python QStringListModel怎么用?Python QStringListModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: __init__

    def __init__(self, project, parent=None):
        '''
        Setup dialog widgets with the project properties
        '''
        super(PosiviewProperties, self).__init__("PosiViewProperties", parent)
        self.setupUi(self)
        self.groupBox_6.hide()
        self.initOptionsBase(False)
        self.restoreOptionsBaseUi()
        self.comboBoxParser.addItems(PARSERS)
        self.comboBoxProviderType.addItems(DEVICE_TYPES)
        self.project = project
        self.projectProperties = project.properties()
        self.mToolButtonLoad.setDefaultAction(self.actionLoadConfiguration)
        self.mToolButtonSave.setDefaultAction(self.actionSaveConfiguration)

        self.mobileModel = QStringListModel()
        self.mobileListModel = QStringListModel()
        self.mMobileListView.setModel(self.mobileListModel)
        self.mobileProviderModel = QStandardItemModel()
        self.mobileProviderModel.setHorizontalHeaderLabels(('Provider', 'Filter'))
        self.mMobileProviderTableView.setModel(self.mobileProviderModel)

        self.providerListModel = QStringListModel()
        self.mDataProviderListView.setModel(self.providerListModel)
        self.comboBoxProviders.setModel(self.providerListModel)
        self.setupModelData(self.projectProperties)
        self.setupGeneralData(self.projectProperties)
开发者ID:jrenken,项目名称:qgis-PosiView,代码行数:28,代码来源:posiview_properties.py

示例2: AppletNoticeWindow

class AppletNoticeWindow(QWidget):

    def __init__(self, controller):

        QWidget.__init__(self)
        self.__controller = controller

        self.__pkglist = []

        # setup widgets
        self.__vbox_up = QVBoxLayout()
        self.__critical_label = QLabel()
        self.__critical_label.setWordWrap(True)
        self.__list_model = QStringListModel()
        self.__list_view = QListView()
        self.__list_view.setModel(self.__list_model)
        self.__vbox_up.addWidget(self.__critical_label)
        self.__vbox_up.addWidget(self.__list_view)

        # bottom buttons
        self.__vbox = QVBoxLayout()
        self.__vbox.addLayout(self.__vbox_up)

        self.__button_hbox = QHBoxLayout()
        self.__close_button = QPushButton(_("Close"))
        self.__launch_pm_button = QPushButton(_("Launch Application Browser"))
        self.__button_hbox.addWidget(self.__launch_pm_button)
        self.__button_hbox.addWidget(self.__close_button)

        self.__vbox.addLayout(self.__button_hbox)

        self.setLayout(self.__vbox)

        # set window settings
        self.resize(400, 200)
        self.setWindowTitle(_("Application updates"))

        self.connect(self.__close_button, SIGNAL("clicked()"), self.on_close)
        self.connect(self.__launch_pm_button, SIGNAL("clicked()"), self.on_pm)

    def closeEvent(self, event):
        """
        We don't want to kill the window, since the whole app will close
        otherwise.
        """
        event.ignore()
        self.on_close()

    def on_pm(self):
        self.__controller.launch_package_manager()

    def on_close(self):
        self.__controller.trigger_notice_window()

    def populate(self, pkg_data, critical_txt):
        self.__list_model.setStringList(pkg_data)
        self.__critical_label.setText(critical_txt)
        self.__list_view.update()
开发者ID:B-Rich,项目名称:entropy,代码行数:58,代码来源:components.py

示例3: __init__

    def __init__(self,parent=None):
        super(QtGui.QLineEdit, self).__init__(parent)

        model = QStringListModel()
        completer = QCompleter()
        completer.setModel(model)
        model.setStringList(cmd.cmdset)

        self.setCompleter(completer)
开发者ID:yshao,项目名称:weathergit,代码行数:9,代码来源:commandconsolewidget.py

示例4: __init__

	def __init__(self,expdat):
		super(DBAnnotateSave, self).__init__()
		print("DBAnnotateSave")
		uic.loadUi(os.path.join(hs.heatsequerdir,'ui/manualdata.py'), self)
		self.bplus.clicked.connect(self.plus)
		self.bminus.clicked.connect(self.minus)
		self.bontoinput.returnPressed.connect(self.plus)
		self.bstudyinfo.clicked.connect(self.studyinfo)
		self.bisa.toggled.connect(self.radiotoggle)
		self.bdiffpres.toggled.connect(self.radiotoggle)
		self.bisatype.currentIndexChanged.connect(self.isatypechanged)
		self.bhistory.clicked.connect(self.history)
		self.cexp=expdat
		self.lnumbact.setText(str(len(expdat.selectedseqs)))
		completer = QCompleter()
		self.bontoinput.setCompleter(completer)
		scdb=hs.scdb
		self.scdb=scdb
		self.dataid=hs.supercooldb.finddataid(scdb,datamd5=self.cexp.datamd5,mapmd5=self.cexp.mapmd5)

		model = QStringListModel()
		completer.setModel(model)
#		completer.setCompletionMode(QCompleter.InlineCompletion)
		completer.maxVisibleItems=10
		completer.setCaseSensitivity(Qt.CaseInsensitive)

		# make the completer selection also erase the text edit
		completer.activated.connect(self.cleartext,type=Qt.QueuedConnection)

		# in qt5 should work with middle complete as well...
#		completer.setFilterMode(Qt.MatchContains)
		if not hs.scdb.ontologyfromid:
			hs.scdb=hs.supercooldb.loaddbonto(hs.scdb)

		self.ontology=hs.scdb.ontology
		self.ontologyfromid=hs.scdb.ontologyfromid

		nlist=list(self.ontology.keys())
#		nlist=sorted(nlist)
		nlist=sorted(nlist, key=lambda s: s.lower())
		print("sorted ontology")

		model.setStringList(nlist)
		self.setWindowTitle(self.cexp.studyname)
		try:
			tt=hs.lastdatamd5
		except:
			hs.lastdatamd5=''
		if self.cexp.datamd5==hs.lastdatamd5:
			self.fillfromcuration(hs.lastcurations[-1],onlyall=True)

		self.prefillinfo()
		self.bontoinput.setFocus()
开发者ID:mortonjt,项目名称:heatsequer,代码行数:53,代码来源:plotwingui.py

示例5: test_flattened_model

    def test_flattened_model(self):
        model = QStringListModel(["0", "1", "2", "3"])
        flat = FlattenedTreeItemModel()
        flat.setSourceModel(model)

        def get(row):
            return flat.index(row, 0).data()

        self.assertEqual(get(0), "0")
        self.assertEqual(get(1), "1")
        self.assertEqual(get(3), "3")
        self.assertEqual(flat.rowCount(), model.rowCount())
        self.assertEqual(flat.columnCount(), 1)
开发者ID:675801717,项目名称:orange3,代码行数:13,代码来源:test_quickmenu.py

示例6: __init__

 def __init__(self):
     super(Person, self).__init__()
     self._employer = None
     self.id = Person.id_inc
     Person.id_inc += 1
     self._total_expenses = 0.0
     self._net_worth = 0.0
     self._name = ''
     self.experience = {}
     self.shelter = None
     self.level_up_type_model = QStringListModel(self.level_up_types)
     self.exp_type_model = QStringListModel(self.exp_types)
     
     self.ui = Ui_Person()
     self.widget = QWidget()
     self.ui.setupUi(self.widget)
     
     self.ui.upgradeComboBox.setModel(self.level_up_type_model)
     self.ui.upgradePushButton.clicked.connect(self.upgrade)
     self.ui.expComboBox.setModel(self.exp_type_model)
     self.ui.expComboBox.activated[str].connect(self.update_experience_widget)
     self.ui.nameLineEdit.textEdited.connect(self.name_changed)
     self.ui.typeLineEdit.setText(self.TYPE)
     self.ui.levelLineEdit.setText(str(self.level))
     self.ui.employerLineEdit.setText("Unemployed")
     self.ui.netWorthLineEdit.setText(self.display_money(self._net_worth))
     self.ui.salaryLineEdit.setText(self.display_money(self.salary))
     self.ui.totalIncomeLineEdit.setText(self.display_money(self.total_income))
     self.ui.taxesLineEdit.setText(self.display_money(self.income_tax))
     self.ui.netLineEdit.setText(self.display_money(self.net))
开发者ID:happy5214,项目名称:manitae,代码行数:30,代码来源:Person.py

示例7: __init__

    def __init__(self):
        WizardPage.__init__(self)
        self.fetch_config = None
        self.app_model = QStringListModel([a for a in REGISTRY.names()
                                           if not a.startswith('b2g-')])
        self.ui.app_combo.setModel(self.app_model)
        self.bisect_model = QStringListModel()
        self.ui.bisect_combo.setModel(self.bisect_model)
        if mozinfo.bits == 64:
            if mozinfo.os == 'mac':
                self.bits_model = QStringListModel(['64'])
                bits_index = 0
            else:
                self.bits_model = QStringListModel(['32', '64'])
                bits_index = 1
        elif mozinfo.bits == 32:
            self.bits_model = QStringListModel(['32'])
            bits_index = 0
        self.ui.bits_combo.setModel(self.bits_model)
        self.ui.bits_combo.setCurrentIndex(bits_index)

        self.ui.app_combo.currentIndexChanged.connect(self._set_fetch_config)
        self.ui.bits_combo.currentIndexChanged.connect(self._set_fetch_config)
        self.ui.app_combo.setCurrentIndex(
            self.ui.app_combo.findText("firefox"))
开发者ID:xennygrimmato,项目名称:mozregression,代码行数:25,代码来源:wizard.py

示例8: IntroPage

class IntroPage(WizardPage):
    UI_CLASS = Ui_Intro
    TITLE = "Starting a bisection"
    SUBTITLE = "Please choose an application and a type of bisection."
    FIELDS = {'application': 'app_combo', 'bisect_type': 'bisect_combo',
              'find_fix': 'find_fix'}
    ID = 0

    def __init__(self):
        WizardPage.__init__(self)
        self.fetch_config = None
        self.app_model = QStringListModel(REGISTRY.names())
        self.ui.app_combo.setModel(self.app_model)
        self.bisect_model = QStringListModel()
        self.ui.bisect_combo.setModel(self.bisect_model)

        self.ui.app_combo.currentIndexChanged.connect(self._set_fetch_config)
        self._set_fetch_config(0)

    def _set_fetch_config(self, index):
        # limit bisection type given the application
        old_bisect_index = self.ui.bisect_combo.currentIndex()
        self.fetch_config = create_config(
            str(self.ui.app_combo.itemText(index)), mozinfo.os, mozinfo.bits)
        bisect_types = ['nightlies']
        if self.fetch_config.is_inbound():
            bisect_types.append('inbound')
        self.bisect_model.setStringList(bisect_types)
        bisect_index = 0
        if old_bisect_index == 1 and len(bisect_types) == 2:
            bisect_index = 1
        self.ui.bisect_combo.setCurrentIndex(bisect_index)

    def validatePage(self):
        app_name = self.fetch_config.app_name
        launcher_class = LAUNCHER_REGISTRY.get(app_name)
        try:
            launcher_class.check_is_runnable()
            return True
        except LauncherNotRunnable, exc:
            QMessageBox.critical(
                self,
                "%s is not runnable" % app_name,
                str(exc)
            )
            return False
开发者ID:askeing,项目名称:mozregression,代码行数:46,代码来源:wizard.py

示例9: __init__

 def __init__(self, parent=None):
     QLineEdit.__init__(self, parent)
     self.completer = QCompleter()
     self.setCompleter(self.completer)
     self.model = QStringListModel()
     self.completer.setModel(self.model)
     #get_data(model)
     self.completions = None
     self.parent = parent
开发者ID:CINF,项目名称:PyExpLabSys,代码行数:9,代码来源:stepped_program_runner.py

示例10: __init__

 def __init__(self, game, parent=None):
     QListView.__init__(self, parent)
     self.game = None
     self.setWindowTitle(m18n('Explain Scores').replace('&', '') + ' - Kajongg')
     self.setGeometry(0, 0, 300, 400)
     self.model = QStringListModel()
     self.setModel(self.model)
     StateSaver(self)
     self.refresh(game)
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:9,代码来源:scoring.py

示例11: ed_add_element

 def ed_add_element(self):
     ''' Button 33. Add element '''
       
     # Create the dialog and signals
     self.dlg = Add_element()
     utils_giswater.setDialog(self.dlg)
     self.dlg.btn_accept.pressed.connect(self.ed_add_element_accept)
     self.dlg.btn_cancel.pressed.connect(self.close_dialog)
     
     # Manage i18n of the form
     self.controller.translate_form(self.dlg, 'element')            
     
     # Check if we have at least one feature selected
     if not self.ed_check():
         return
         
     # Fill combo boxes
     self.populate_combo("elementcat_id", "cat_element")
     self.populate_combo("state", "value_state")
     self.populate_combo("location_type", "man_type_location")
     self.populate_combo("workcat_id", "cat_work")
     self.populate_combo("buildercat_id", "cat_builder")
     self.populate_combo("elementcat_id", "cat_element")
     self.populate_combo("ownercat_id", "cat_owner")
     self.populate_combo("verified", "value_verified")
     
     # Adding auto-completion to a QLineEdit
     self.edit = self.dlg.findChild(QLineEdit, "element_id")
     self.completer = QCompleter()
     self.edit.setCompleter(self.completer)
     model = QStringListModel()
     sql = "SELECT DISTINCT(element_id) FROM "+self.schema_name+".element "
     row = self.dao.get_rows(sql)
     for i in range(0,len(row)):
         aux = row[i]
         row[i] = str(aux[0])
     model.setStringList(row)
     self.completer.setModel(model)
     
     # Set signal to reach selected value from QCompleter
     self.completer.activated.connect(self.ed_add_el_autocomplete)
     
     # Open the dialog
     self.dlg.exec_()    
开发者ID:Giswater,项目名称:giswater_qgis_plugin,代码行数:44,代码来源:ed.py

示例12: __init__

    def __init__(self):
        WizardPage.__init__(self)
        self.fetch_config = None
        self.app_model = QStringListModel(REGISTRY.names())
        self.ui.app_combo.setModel(self.app_model)
        self.bisect_model = QStringListModel()
        self.ui.bisect_combo.setModel(self.bisect_model)

        self.ui.app_combo.currentIndexChanged.connect(self._set_fetch_config)
        self._set_fetch_config(0)
开发者ID:askeing,项目名称:mozregression,代码行数:10,代码来源:wizard.py

示例13: create_QNewStrategy

 def create_QNewStrategy(self):
     self.__q_new_strategy = QNewStrategy()
     completer = QCompleter()
     if self.get_got_list_instrument_info():
         model = QStringListModel()
         model.setStringList(self.get_list_instrument_id())
         completer.setModel(model)
     else:
         print(">>> CTPManager.create_QNewStrategy() 查询合约信息失败")
     self.__q_new_strategy.lineEdit_a_instrument.setCompleter(completer)
     self.__q_new_strategy.lineEdit_b_instrument.setCompleter(completer)
     self.__q_new_strategy.set_ClientMain(self.__client_main)  # CTPManager设置为新建策略窗口属性
     self.__q_new_strategy.set_CTPManager(self)  # CTPManager设置为新建策略窗口属性
     self.__q_new_strategy.set_SocketManager(self.__socket_manager)  # SocketManager设置为新建策略窗口属性
     self.__q_new_strategy.set_trader_id(self.__trader_id)  # 设置trade_id属性
     self.set_QNewStrategy(self.__q_new_strategy)  # 新建策略窗口设置为CTPManager属性
     self.__client_main.set_QNewStrategy(self.__q_new_strategy)  # 新建策略窗口设置为ClientMain属性
     self.signal_hide_QNewStrategy.connect(self.get_QNewStrategy().hide)  # 绑定信号槽,新创建策略成功后隐藏“新建策略弹窗”
     # 绑定信号槽:新建策略窗新建策略指令 -> SocketManager.slot_send_msg
     self.__q_new_strategy.signal_send_msg.connect(self.__socket_manager.slot_send_msg)
开发者ID:yuwangying,项目名称:PyCTP,代码行数:20,代码来源:CTPManager.py

示例14: __init__

    def __init__(self, items):
        QSpinBox.__init__(self)
        self.setMinimumWidth(75)

        self.__string_converter = str
        self.__items = items

        list = []
        for item in self.__items:
            assert isinstance(item, CTime)
            date = item.date()
            list.append(self.convertToString(date))

        model = QStringListModel()
        model.setStringList(list)

        self.setRange(0, len(items) - 1)
        self.setValue(len(items) - 1)

        line_edit = QLineEdit()
        self.setLineEdit(line_edit)
开发者ID:YingfangZhou,项目名称:ert,代码行数:21,代码来源:list_spin_box.py

示例15: __init__

 def __init__(self):
     QMainWindow.__init__(self)
     self.setupUi(self)
     self.__nodesList = []
     self.__nodesModel = QStringListModel(self)
     self.nodesView.setModel(self.__nodesModel)
     OTPApplication.instance().lastWindowClosed.connect(self._quit)
     BootstrapServer.nodeDown.connect(self._nodeDown)
     BootstrapServer.nodeUp.connect(self._nodeUp)
     BootstrapServer.ready.connect(lambda: self.actionBootstrap.setEnabled(True))
     BootstrapServer.notReady.connect(lambda: self.actionBootstrap.setEnabled(False))
     QTimer.singleShot(0, self._startup)
开发者ID:Pesa,项目名称:forse,代码行数:12,代码来源:ControlPanelWindow.py


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