本文整理汇总了Python中PyQt4.QtGui.QGridLayout方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QGridLayout方法的具体用法?Python QtGui.QGridLayout怎么用?Python QtGui.QGridLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui
的用法示例。
在下文中一共展示了QtGui.QGridLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initUI
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def initUI(self):
self.box = QtGui.QComboBox(self)
for i in self.formats:
self.box.addItem(strftime(i))
insert = QtGui.QPushButton("Insert",self)
insert.clicked.connect(self.insert)
cancel = QtGui.QPushButton("Cancel",self)
cancel.clicked.connect(self.close)
layout = QtGui.QGridLayout()
layout.addWidget(self.box,0,0,1,2)
layout.addWidget(insert,1,0)
layout.addWidget(cancel,1,1)
self.setGeometry(300,300,400,80)
self.setWindowTitle("Date and Time")
self.setLayout(layout)
示例2: initUI
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def initUI(self):
grid = QtGui.QGridLayout()
grid.addWidget(QtGui.QLabel(u'过滤规则:', parent=self), 0, 0, 1, 1)
self.filter = QtGui.QLineEdit(parent=self)
grid.addWidget(self.filter, 0, 1, 1, 1)
# 创建ButtonBox,用户确定和取消
buttonBox = QtGui.QDialogButtonBox(parent=self)
buttonBox.setOrientation(QtCore.Qt.Horizontal) # 设置为水平方向
buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) # 确定和取消两个按钮
# 连接信号和槽
buttonBox.accepted.connect(self.accept) # 确定
buttonBox.rejected.connect(self.reject) # 取消
# 垂直布局,布局表格及按钮
layout = QtGui.QVBoxLayout()
# 加入前面创建的表格布局
layout.addLayout(grid)
# 放一个间隔对象美化布局
spacerItem = QtGui.QSpacerItem(20, 48, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
layout.addItem(spacerItem)
# ButtonBox
layout.addWidget(buttonBox)
self.setLayout(layout)
示例3: get_code
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def get_code(url, size=(640, 480), title="Google authentication"):
"""Open a QT webkit window and return the access code."""
app = QtGui.QApplication([])
dialog = QtGui.QDialog()
dialog.setWindowTitle(title)
dialog.resize(*size)
webview = QtWebKit.QWebView()
webpage = QtWebKit.QWebPage()
webview.setPage(webpage)
webpage.loadFinished.connect(lambda: _on_qt_page_load_finished(dialog, webview))
webview.setUrl(QtCore.QUrl.fromEncoded(url))
layout = QtGui.QGridLayout()
layout.addWidget(webview)
dialog.setLayout(layout)
dialog.authorization_code = None
dialog.show()
app.exec_()
return dialog.authorization_code
示例4: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(400, 300)
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.sizeSpin = QtGui.QSpinBox(Form)
self.sizeSpin.setProperty("value", 10)
self.sizeSpin.setObjectName(_fromUtf8("sizeSpin"))
self.gridLayout.addWidget(self.sizeSpin, 1, 1, 1, 1)
self.pixelModeCheck = QtGui.QCheckBox(Form)
self.pixelModeCheck.setObjectName(_fromUtf8("pixelModeCheck"))
self.gridLayout.addWidget(self.pixelModeCheck, 1, 3, 1, 1)
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
self.plot = PlotWidget(Form)
self.plot.setObjectName(_fromUtf8("plot"))
self.gridLayout.addWidget(self.plot, 0, 0, 1, 4)
self.randCheck = QtGui.QCheckBox(Form)
self.randCheck.setObjectName(_fromUtf8("randCheck"))
self.gridLayout.addWidget(self.randCheck, 1, 2, 1, 1)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例5: __init__
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def __init__(self, dataitem, parent=None):
super(otherPanel, self).__init__(parent)
self.setFrameStyle(widgets.QFrame.Sunken)
self.setFrameShape(widgets.QFrame.Box)
self.data = dataitem
layout = widgets.QGridLayout()
labelnob = widgets.QLabel(_("Number of bytes"))
lableunit = widgets.QLabel(_("Unit"))
layout.addWidget(labelnob, 0, 0)
layout.addWidget(lableunit, 1, 0)
layout.setRowStretch(2, 1)
self.inputnob = widgets.QSpinBox()
self.inputnob.setRange(1, 10240)
self.inputtype = widgets.QComboBox()
self.inputtype.addItem("ASCII")
self.inputtype.addItem("BCD/HEX")
layout.addWidget(self.inputnob, 0, 1)
layout.addWidget(self.inputtype, 1, 1)
self.setLayout(layout)
self.init()
示例6: quickLayout
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def quickLayout(self, type, ui_name=""):
the_layout = ''
if type in ("form", "QFormLayout"):
the_layout = QtWidgets.QFormLayout()
the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
elif type in ("grid", "QGridLayout"):
the_layout = QtWidgets.QGridLayout()
elif type in ("hbox", "QHBoxLayout"):
the_layout = QtWidgets.QHBoxLayout()
the_layout.setAlignment(QtCore.Qt.AlignTop)
else:
the_layout = QtWidgets.QVBoxLayout()
the_layout.setAlignment(QtCore.Qt.AlignTop)
if ui_name != "":
self.uiList[ui_name] = the_layout
return the_layout
示例7: quickLayout
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def quickLayout(self, type, ui_name=""):
the_layout = ''
if type in ("form", "QFormLayout"):
the_layout = QtGui.QFormLayout()
the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
the_layout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
elif type in ("grid", "QGridLayout"):
the_layout = QtGui.QGridLayout()
elif type in ("hbox", "QHBoxLayout"):
the_layout = QtGui.QHBoxLayout()
the_layout.setAlignment(QtCore.Qt.AlignTop)
else:
the_layout = QtGui.QVBoxLayout()
the_layout.setAlignment(QtCore.Qt.AlignTop)
if ui_name != "":
self.uiList[ui_name] = the_layout
return the_layout
示例8: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(800, 600)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.gridLayout = QtGui.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.dataList = QtGui.QListWidget(self.centralwidget)
self.dataList.setObjectName(_fromUtf8("dataList"))
self.gridLayout.addWidget(self.dataList, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
示例9: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def setupUi(self, Dialog):
Dialog.setObjectName(_fromUtf8("Dialog"))
Dialog.resize(197, 303)
Dialog.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.gpcrdb_button = QtGui.QPushButton(Dialog)
self.gpcrdb_button.setObjectName(_fromUtf8("gpcrdb_button"))
self.verticalLayout.addWidget(self.gpcrdb_button)
self.bw_button = QtGui.QPushButton(Dialog)
self.bw_button.setObjectName(_fromUtf8("bw_button"))
self.verticalLayout.addWidget(self.bw_button)
self.both_button = QtGui.QPushButton(Dialog)
self.both_button.setObjectName(_fromUtf8("both_button"))
self.verticalLayout.addWidget(self.both_button)
self.clear_label_button = QtGui.QPushButton(Dialog)
self.clear_label_button.setObjectName(_fromUtf8("clear_label_button"))
self.verticalLayout.addWidget(self.clear_label_button)
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
self.retranslateUi(Dialog)
示例10: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def setupUi(self, SpatialUnitTenureDialog):
SpatialUnitTenureDialog.setObjectName(_fromUtf8("SpatialUnitTenureDialog"))
SpatialUnitTenureDialog.resize(318, 252)
self.gridLayout = QtGui.QGridLayout(SpatialUnitTenureDialog)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.buttonBox = QtGui.QDialogButtonBox(SpatialUnitTenureDialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 1)
self.sp_tenure_view = ListPairTableView(SpatialUnitTenureDialog)
self.sp_tenure_view.setObjectName(_fromUtf8("sp_tenure_view"))
self.gridLayout.addWidget(self.sp_tenure_view, 1, 0, 1, 1)
self.label = QtGui.QLabel(SpatialUnitTenureDialog)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.retranslateUi(SpatialUnitTenureDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), SpatialUnitTenureDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), SpatialUnitTenureDialog.reject)
QtCore.QMetaObject.connectSlotsByName(SpatialUnitTenureDialog)
示例11: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def setupUi(self, ImgurClientIdDialog):
ImgurClientIdDialog.setObjectName(_fromUtf8("ImgurClientIdDialog"))
ImgurClientIdDialog.resize(754, 467)
self.gridLayout_2 = QtGui.QGridLayout(ImgurClientIdDialog)
self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
self.enterClientIdBtn = QtGui.QPushButton(ImgurClientIdDialog)
self.enterClientIdBtn.setObjectName(_fromUtf8("enterClientIdBtn"))
self.gridLayout_2.addWidget(self.enterClientIdBtn, 3, 0, 1, 1)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.label_2 = QtGui.QLabel(ImgurClientIdDialog)
self.label_2.setTextFormat(QtCore.Qt.RichText)
self.label_2.setOpenExternalLinks(True)
self.label_2.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse | QtCore.Qt.TextSelectableByMouse)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.horizontalLayout_2.addWidget(self.label_2)
self.gridLayout_2.addLayout(self.horizontalLayout_2, 0, 0, 1, 2)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.label = QtGui.QLabel(ImgurClientIdDialog)
self.label.setObjectName(_fromUtf8("label"))
self.horizontalLayout.addWidget(self.label)
self.clientIdLineEdit = QtGui.QLineEdit(ImgurClientIdDialog)
self.clientIdLineEdit.setObjectName(_fromUtf8("clientIdLineEdit"))
self.horizontalLayout.addWidget(self.clientIdLineEdit)
self.gridLayout_2.addLayout(self.horizontalLayout, 2, 0, 1, 2)
self.enterLaterBtn = QtGui.QPushButton(ImgurClientIdDialog)
self.enterLaterBtn.setObjectName(_fromUtf8("enterLaterBtn"))
self.gridLayout_2.addWidget(self.enterLaterBtn, 3, 1, 1, 1)
self.retranslateUi(ImgurClientIdDialog)
QtCore.QMetaObject.connectSlotsByName(ImgurClientIdDialog)
示例12: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(800, 600)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.gridLayout = QtGui.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.matplotlibwidget = MatplotlibWidget(self.centralwidget)
self.matplotlibwidget.setObjectName(_fromUtf8("matplotlibwidget"))
self.gridLayout.addWidget(self.matplotlibwidget, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
示例13: manual
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def manual(self):
data=QtCore.QFile("ar/help_body.html");
if (data.open(QtCore.QFile.ReadOnly)):
textstream=QtCore.QTextStream(data);
textstream.setCodec("UTF-8");
text=textstream.readAll();
else:
text=u"لا يمكن فتح ملف المساعدة"
Dialog=QtGui.QDialog(self.centralwidget)
Dialog.setObjectName("Dialog")
Dialog.resize(480, 480)
Dialog.setWindowTitle(u'دليل الاستعمال')
gridLayout = QtGui.QGridLayout(Dialog)
gridLayout.setObjectName("gridLayout")
textBrowser = QtGui.QTextBrowser(Dialog)
textBrowser.setObjectName("textBrowser")
gridLayout.addWidget(textBrowser, 0, 0, 1, 1)
buttonBox = QtGui.QDialogButtonBox(Dialog)
buttonBox.setOrientation(QtCore.Qt.Horizontal)
buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
buttonBox.setObjectName("buttonBox")
gridLayout.addWidget(buttonBox, 1, 0, 1, 1)
QtCore.QObject.connect(buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
QtCore.QMetaObject.connectSlotsByName(Dialog)
text2=unicode(text)
textBrowser.setText(text2)
RightToLeft=1;
Dialog.setLayoutDirection(RightToLeft);
Dialog.show();
示例14: progressDialog2
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def progressDialog2(self):
progressDialog=QtGui.QDialog(self.centralwidget)
progressDialog.setObjectName("ProgressDialog")
progressDialog.setWindowTitle(u'يُشَكِّلُ...')
gridLayoutPD = QtGui.QGridLayout(progressDialog)
gridLayoutPD.setObjectName("gridLayout")
gridLayoutPD.addWidget(self.singleProgress, 0, 0, 1, 1)
progressDialog.setLayoutDirection(RightToLeft);
progressDialog.show();
示例15: setupUi
# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QGridLayout [as 别名]
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(241, 367)
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setSpacing(0)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
self.itemTree = QtGui.QTreeWidget(Form)
self.itemTree.setObjectName(_fromUtf8("itemTree"))
self.itemTree.headerItem().setText(0, _fromUtf8("1"))
self.itemTree.header().setVisible(False)
self.gridLayout.addWidget(self.itemTree, 1, 0, 1, 3)
self.label_2 = QtGui.QLabel(Form)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 3)
self.formatList = QtGui.QListWidget(Form)
self.formatList.setObjectName(_fromUtf8("formatList"))
self.gridLayout.addWidget(self.formatList, 3, 0, 1, 3)
self.exportBtn = QtGui.QPushButton(Form)
self.exportBtn.setObjectName(_fromUtf8("exportBtn"))
self.gridLayout.addWidget(self.exportBtn, 6, 1, 1, 1)
self.closeBtn = QtGui.QPushButton(Form)
self.closeBtn.setObjectName(_fromUtf8("closeBtn"))
self.gridLayout.addWidget(self.closeBtn, 6, 2, 1, 1)
self.paramTree = ParameterTree(Form)
self.paramTree.setObjectName(_fromUtf8("paramTree"))
self.paramTree.headerItem().setText(0, _fromUtf8("1"))
self.paramTree.header().setVisible(False)
self.gridLayout.addWidget(self.paramTree, 5, 0, 1, 3)
self.label_3 = QtGui.QLabel(Form)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.gridLayout.addWidget(self.label_3, 4, 0, 1, 3)
self.copyBtn = QtGui.QPushButton(Form)
self.copyBtn.setObjectName(_fromUtf8("copyBtn"))
self.gridLayout.addWidget(self.copyBtn, 6, 0, 1, 1)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)