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


Python QTabManager.text方法代码示例

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


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

示例1: qtitem

# 需要导入模块: from QProgEdit import QTabManager [as 别名]
# 或者: from QProgEdit.QTabManager import text [as 别名]

#.........这里部分代码省略.........
		self.splitter.setSizes([0, self.splitter.width()])
		self.button_view.set_view_icon(u'script')

	def set_view_split(self):

		"""
		desc:
			Puts the splitter in split view.
		"""

		self.splitter.setSizes([self.splitter.width()/2,
			self.splitter.width()/2])
		self.button_view.set_view_icon(u'split')

	def update(self):

		"""
		desc:
			Updates both the script and the controls.
		"""

		self.update_script()
		self.edit_widget()

	def update_script(self):

		"""
		desc:
			Regenerates the script and updates the script widget.
		"""

		# Normally, the script starts with a 'define' line and is indented by
		# a tab. We want to undo this, and present only unindented content.
		import textwrap
		script = self.to_string()
		script = script[script.find(u'\t'):]
		script = textwrap.dedent(script)
		self._script_widget.setText(script)

	def edit_widget(self, *deprecated, **_deprecated):

		"""
		desc:
			This function updates the controls based on the item state.
		"""

		debug.msg()
		self.auto_edit_widget()
		self.header.refresh()

	def apply_edit_changes(self, *deprecated, **_deprecated):

		"""
		desc:
			Applies changes to the graphical controls.
		"""

		debug.msg()
		self.auto_apply_edit_changes()
		self.update_script()
		self.main_window.set_unsaved(True)
		return True

	def apply_script_changes(self, *deprecated, **_deprecated):

		"""
开发者ID:bwarna,项目名称:OpenSesame,代码行数:70,代码来源:qtitem.py

示例2: qtitem

# 需要导入模块: from QProgEdit import QTabManager [as 别名]
# 或者: from QProgEdit.QTabManager import text [as 别名]

#.........这里部分代码省略.........

        self.splitter.setSizes([0, self.splitter.width()])
        self.button_view.set_view_icon(u"script")

    def set_view_split(self):

        """
		desc:
			Puts the splitter in split view.
		"""

        self.splitter.setSizes([self.splitter.width() / 2, self.splitter.width() / 2])
        self.button_view.set_view_icon(u"split")

    def update(self):

        """
		desc:
			Updates both the script and the controls.
		"""

        self.update_script()
        self.edit_widget()

    def update_script(self):

        """
		desc:
			Regenerates the script and updates the script widget.
		"""

        # Normally, the script starts with a 'define' line and is indented by
        # a tab. We want to undo this, and present only unindented content.
        import textwrap

        script = self.to_string()
        script = script[script.find(u"\t") :]
        script = textwrap.dedent(script)
        if self._script_widget.text() != script:
            self.main_window.set_unsaved()
            self._script_widget.setText(script)
            self.extension_manager.fire(u"change_item", name=self.name)

    def edit_widget(self, *deprecated, **_deprecated):

        """
		desc:
			This function updates the controls based on the item state.
		"""

        self.auto_edit_widget()
        self.header.refresh()

    def apply_edit_changes(self, *deprecated, **_deprecated):

        """
		desc:
			Applies changes to the graphical controls.
		"""

        self.auto_apply_edit_changes()
        self.update_script()
        return True

    def apply_script_changes(self, *deprecated, **_deprecated):
开发者ID:JdenHartog,项目名称:OpenSesame,代码行数:69,代码来源:qtitem.py

示例3: qtitem

# 需要导入模块: from QProgEdit import QTabManager [as 别名]
# 或者: from QProgEdit.QTabManager import text [as 别名]

#.........这里部分代码省略.........
		"""
		desc:
			Puts the splitter in split view.
		"""

		self.splitter.setSizes([self.splitter.width()/2,
			self.splitter.width()/2])
		self.button_view.set_view_icon(u'split')

	def update(self):

		"""
		desc:
			Updates both the script and the controls.
		"""

		# Items are updated when their tab is shown, so we don't need to update
		# them if they aren't shown.
		if self.tabwidget.current_item() != self.name:
			return False
		self.update_script()
		self.edit_widget()
		return True

	def update_script(self):

		"""
		desc:
			Regenerates the script and updates the script widget.
		"""

		# Normally, the script starts with a 'define' line and is indented by
		# a tab. We want to undo this, and present only unindented content.
		import textwrap
		script = self.to_string()
		script = script[script.find(u'\t'):]
		script = textwrap.dedent(script)
		if self._script_widget.text() != script:
			self.main_window.set_unsaved()
			self._script_widget.setText(script)
			self.extension_manager.fire(u'change_item', name=self.name)

	def edit_widget(self, *deprecated, **_deprecated):

		"""
		desc:
			This function updates the controls based on the item state.
		"""

		self.auto_edit_widget()
		self.header.refresh()

	def apply_edit_changes(self, *deprecated, **_deprecated):

		"""
		desc:
			Applies changes to the graphical controls.
		"""

		self.auto_apply_edit_changes()
		self.update_script()
		return True

	def apply_script_changes(self, *deprecated, **_deprecated):

		"""
开发者ID:dev-jam,项目名称:OpenSesame,代码行数:70,代码来源:qtitem.py


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