本文整理汇总了Python中PyQt4.QtGui.QDoubleSpinBox.setGeometry方法的典型用法代码示例。如果您正苦于以下问题:Python QDoubleSpinBox.setGeometry方法的具体用法?Python QDoubleSpinBox.setGeometry怎么用?Python QDoubleSpinBox.setGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QDoubleSpinBox
的用法示例。
在下文中一共展示了QDoubleSpinBox.setGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BaseSectionWidget
# 需要导入模块: from PyQt4.QtGui import QDoubleSpinBox [as 别名]
# 或者: from PyQt4.QtGui.QDoubleSpinBox import setGeometry [as 别名]
class BaseSectionWidget(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.resize(400,80)
self.sectionNameEdit = QLineEdit(self)
self.sectionNameEdit.setGeometry(QRect(0,5,110,30))
self.sectionNameEdit.setPlaceholderText("Section name")
self.sectionNameEdit.setToolTip("Name of new section")
self.sizeEdit = QDoubleSpinBox(self)
self.sizeEdit.setGeometry(QRect(115,5,65,30))
self.sizeEdit.setMaximum(100.0)
self.sizeEdit.setToolTip("Size of section in percent")
self.colorLabel = ColorChooser(self)
self.colorLabel.setGeometry(QRect(185,8,25,25))
self.displayedNameCheckBox = QCheckBox(self)
self.displayedNameCheckBox.setGeometry(215, 5, 185, 30)
self.displayedNameCheckBox.setText("Change displayed name")
self.displayedNameCheckBox.setStyleSheet("font-size:11px;")
self.displayedNameEdit = QLineEdit(self)
self.displayedNameEdit.setGeometry(QRect(235,5,120,30))
self.displayedNameEdit.setPlaceholderText("Displayed name")
self.displayedNameEdit.setToolTip("Displayed name of new section")
self.displayedNameEdit.setVisible(False)
self.removeButton = QPushButton(self)
self.removeButton.setGeometry(QRect(385,5,35,30))
self.removeButton.setToolTip("Remove section")
pixmap = QPixmap("./removeIcon.png")
buttonIcon = QIcon(pixmap)
self.removeButton.setIcon(buttonIcon)
self.removeButton.setIconSize(QSize(25,25))
self.connect(self.displayedNameCheckBox, QtCore.SIGNAL("clicked()"), self.changeDisplayedName)
self.connect(self.removeButton, QtCore.SIGNAL("clicked()"), QtCore.SIGNAL("remove()"))
self.connect(self.sizeEdit, QtCore.SIGNAL("valueChanged(double)"), self.changeSizeValue)
def changeSizeValue(self):
self.emit(QtCore.SIGNAL("sizeValueChanged(QWidget*)"), self)
def changeDisplayedName(self):
if self.displayedNameCheckBox.isChecked():
self.displayedNameEdit.setVisible(True)
self.displayedNameCheckBox.setText("")
else:
self.displayedNameEdit.setVisible((False))
self.displayedNameCheckBox.setText("Change displayed name")
def getName(self):
return self.sectionNameEdit.text()
def setSize(self, size):
self.sizeEdit.setValue(size)
def getSize(self):
return self.sizeEdit.value()
def getSectionData(self):
name = self.sectionNameEdit.text()
size = self.sizeEdit.text()
color = self.colorLabel.getSelectedColor()
displayedNameFlag = self.displayedNameCheckBox.isChecked()
displayedName = self.displayedNameEdit.text()
return [name, size, color, displayedNameFlag, displayedName]