本文整理汇总了Python中PyQt5.Qt.QFrame.setGeometry方法的典型用法代码示例。如果您正苦于以下问题:Python QFrame.setGeometry方法的具体用法?Python QFrame.setGeometry怎么用?Python QFrame.setGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QFrame
的用法示例。
在下文中一共展示了QFrame.setGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FindAnnotationsDialog
# 需要导入模块: from PyQt5.Qt import QFrame [as 别名]
# 或者: from PyQt5.Qt.QFrame import setGeometry [as 别名]
#.........这里部分代码省略.........
self.scgl.addWidget(self.find_annotations_note_lineEdit, row, 1, 1, 3)
self.reset_note_tb = QToolButton()
self.reset_note_tb.setObjectName('reset_note_tb')
self.reset_note_tb.setToolTip('Clear search criteria')
self.reset_note_tb.setIcon(QIcon(I('trash.png')))
self.reset_note_tb.clicked.connect(self.clear_note_field)
self.scgl.addWidget(self.reset_note_tb, row, 4, 1, 1)
row += 1
# ~~~~~~~~ Create the Date range controls ~~~~~~~~
self.date_range_label = QLabel('Date range')
self.date_range_label.setAlignment(Qt.AlignRight|Qt.AlignVCenter)
self.scgl.addWidget(self.date_range_label, row, 0, 1, 1)
# Date 'From'
self.find_annotations_date_from_dateEdit = MyDateEdit(self, datetime(1970,1,1))
self.find_annotations_date_from_dateEdit.setObjectName('find_annotations_date_from_dateEdit')
#self.find_annotations_date_from_dateEdit.current_val = datetime(1970,1,1)
self.find_annotations_date_from_dateEdit.clear_button.clicked.connect(self.find_annotations_date_from_dateEdit.reset_from_date)
self.scgl.addWidget(self.find_annotations_date_from_dateEdit, row, 1, 1, 1)
self.scgl.addWidget(self.find_annotations_date_from_dateEdit.clear_button, row, 2, 1, 1)
# Date 'To'
self.find_annotations_date_to_dateEdit = MyDateEdit(self, datetime.today())
self.find_annotations_date_to_dateEdit.setObjectName('find_annotations_date_to_dateEdit')
#self.find_annotations_date_to_dateEdit.current_val = datetime.today()
self.find_annotations_date_to_dateEdit.clear_button.clicked.connect(self.find_annotations_date_to_dateEdit.reset_to_date)
self.scgl.addWidget(self.find_annotations_date_to_dateEdit, row, 3, 1, 1)
self.scgl.addWidget(self.find_annotations_date_to_dateEdit.clear_button, row, 4, 1, 1)
row += 1
# ~~~~~~~~ Create a horizontal line ~~~~~~~~
self.hl = QFrame(self)
self.hl.setGeometry(QRect(0, 0, 1, 3))
self.hl.setFrameShape(QFrame.HLine)
self.hl.setFrameShadow(QFrame.Raised)
self.scgl.addWidget(self.hl, row, 0, 1, 5)
row += 1
# ~~~~~~~~ Create the results label field ~~~~~~~~
self.result_label = QLabel('<p style="color:red">scanning…</p>')
self.result_label.setAlignment(Qt.AlignCenter)
self.result_label.setWordWrap(False)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.result_label.sizePolicy().hasHeightForWidth())
self.result_label.setSizePolicy(sizePolicy)
self.result_label.setMinimumSize(QtCore.QSize(250, 0))
self.scgl.addWidget(self.result_label, row, 0, 1, 5)
row += 1
# ~~~~~~~~ Create the ButtonBox ~~~~~~~~
self.dialogButtonBox = QDialogButtonBox(self)
self.dialogButtonBox.setOrientation(Qt.Horizontal)
if False:
self.update_button = QPushButton('Update results')
self.update_button.setDefault(True)
self.update_button.setVisible(False)
self.dialogButtonBox.addButton(self.update_button, QDialogButtonBox.ActionRole)
self.cancel_button = self.dialogButtonBox.addButton(self.dialogButtonBox.Cancel)
self.find_button = self.dialogButtonBox.addButton(self.dialogButtonBox.Ok)
self.find_button.setText('Find Matching Books')