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


Python QTextEdit.setFrameShape方法代码示例

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


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

示例1: SurfaceLandmarkWidget

# 需要导入模块: from PySide.QtGui import QTextEdit [as 别名]
# 或者: from PySide.QtGui.QTextEdit import setFrameShape [as 别名]
class SurfaceLandmarkWidget(QWidget):
	def __init__(self):
		super(SurfaceLandmarkWidget, self).__init__()
		
		self.textFrame = QTextEdit("<p>Hold your mouse over the volume "
			"to move the locator. To create a landmark, press 'Space'.</p>"
			"<p>When you want to proceed to the following landmark, "
			"click the 'Done' button behind the landmark pair in the "
			"center of the window.</p>")
		self.textFrame.setReadOnly(True)
		self.textFrame.setFrameShape(QFrame.NoFrame)
		self.textFrame.setAutoFillBackground(False)
		self.textFrame.setAttribute(Qt.WA_TranslucentBackground)
		self.textFrame.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
		self.textFrame.setStyleSheet("background: #aaa")

		layout = QGridLayout()
		layout.setAlignment(Qt.AlignTop)
		layout.setSpacing(0)
		layout.setContentsMargins(0, 0, 0, 0)
		layout.addWidget(self.textFrame)
		self.setLayout(layout)
开发者ID:berendkleinhaneveld,项目名称:Registrationshop,代码行数:24,代码来源:LandmarkWidget.py

示例2: TwoStepLandmarkWidget

# 需要导入模块: from PySide.QtGui import QTextEdit [as 别名]
# 或者: from PySide.QtGui.QTextEdit import setFrameShape [as 别名]
class TwoStepLandmarkWidget(QWidget):
	"""
	TwoStepLandmarkWidget
	"""

	pickedPosition = Signal()

	def __init__(self):
		super(TwoStepLandmarkWidget, self).__init__()

		self.textFrame = QTextEdit("<p>Place your mouse over the desired "
			"landmark point. Press 'Space' to shoot a ray through the volume. "
			"Move the volume around and move the mouse to move the locator. "
			"Press 'Space' again to define the final place of the landmark.</p>"
			"<p>You can also use the ray profile to define the landmark's location.</p>")
		self.textFrame.setReadOnly(True)
		self.textFrame.setFrameShape(QFrame.NoFrame)
		self.textFrame.setAutoFillBackground(False)
		self.textFrame.setAttribute(Qt.WA_TranslucentBackground)
		self.textFrame.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
		self.textFrame.setStyleSheet("background: #aaa")

		self.histogramWidget = TrackingHistogramWidget()
		self.histogramWidget.setMinimumHeight(100)
		self.histogramWidget.setVisible(False)

		self.button = QPushButton("Pick current landmark position")
		self.button.clicked.connect(self.applyButtonClicked)
		self.button.setVisible(False)

		layout = QGridLayout()
		layout.setAlignment(Qt.AlignTop)
		layout.setSpacing(0)
		layout.setContentsMargins(0, 0, 0, 0)
		layout.addWidget(self.textFrame)
		layout.addWidget(self.histogramWidget)
		layout.addWidget(self.button)
		self.setLayout(layout)

	def setSamples(self, samples, scope=None):
		self.textFrame.setVisible(False)
		self.histogramWidget.setVisible(True)

		self.histogram = Histogram()
		self.histogram.bins = samples
		
		if scope:
			self.histogram.minY = scope[0]
			self.histogram.maxY = scope[1]
			self.histogram.enabled = True

		self.histogramWidget.setHistogram(self.histogram)
		self.histogramWidget.setAxeMode(left=HistogramWidget.AxeNormal)
		self.histogramWidget.nodeItem.tracking = True
		self.button.setVisible(True)

	@Slot()
	def applyButtonClicked(self):
		self.pickedPosition.emit()

	@Slot()
	def pickedLocation(self, location):
		self.histogramWidget.nodeItem.tracking = False
		self.button.setVisible(False)
开发者ID:berendkleinhaneveld,项目名称:Registrationshop,代码行数:66,代码来源:LandmarkWidget.py


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