本文整理汇总了Python中qt.QGridLayout类的典型用法代码示例。如果您正苦于以下问题:Python QGridLayout类的具体用法?Python QGridLayout怎么用?Python QGridLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QGridLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GusHardwareOptions
class GusHardwareOptions(QWidget):
def __init__(self, parent, name="GusHardwareOptions"):
QWidget.__init__(self, parent, name)
numrows = 2
numcols = 3
margin = 0
space = 1
self.grid = QGridLayout(self, numrows, numcols, margin, space, "GusHardwareOptionsLayout")
self.base_box = ConfigSpinWidget(self, "I/O address", max=1000)
self.grid.addWidget(self.base_box, 0, 0)
self.irq1_box = ConfigSpinWidget(self, "IRQ 1", min=3, max=15)
self.grid.addWidget(self.irq1_box, 0, 1)
self.irq2_box = ConfigSpinWidget(self, "IRQ 2", min=3, max=15)
self.grid.addWidget(self.irq2_box, 1, 1)
self.dma1_box = ConfigSpinWidget(self, "DMA 1")
self.grid.addWidget(self.dma1_box, 0, 2)
self.dma2_box = ConfigSpinWidget(self, "DMA 2")
self.grid.addWidget(self.dma2_box, 1, 2)
def get_config_options(self):
opts = {}
opts["gusbase"] = self.base_box.get_config_option()
opts["irq1"] = self.irq1_box.get_config_option()
opts["irq2"] = self.irq2_box.get_config_option()
opts["dma1"] = self.dma1_box.get_config_option()
opts["dma2"] = self.dma2_box.get_config_option()
return opts
def set_config_options(self, opts):
self.base_box.set_config_option(opts["gusbase"])
self.irq1_box.set_config_option(opts["irq1"])
self.irq2_box.set_config_option(opts["irq2"])
self.dma1_box.set_config_option(opts["dma1"])
self.dma2_box.set_config_option(opts["dma2"])
示例2: BaseWorksEntryFrame
class BaseWorksEntryFrame(QFrame):
def __init__(self, parent, name='BaseWorksEntryFrame'):
QFrame.__init__(self, parent, name)
margin = 0
space = 1
self.grid = QGridLayout(self, 6, 1, margin, space)
self.worktype_lbl = QLabel('Work Type', self)
self.worktype_entry = KLineEdit('website', self)
self.title_lbl = QLabel('Title', self)
self.title_entry = KLineEdit('', self)
self.url_lbl = QLabel('Url', self)
self.url_entry = KLineEdit('', self)
row = 0
for widget in [self.worktype_lbl, self.worktype_entry,
self.title_lbl, self.title_entry,
self.url_lbl, self.url_entry]:
self.grid.addWidget(widget, row, 0)
row += 1
def get_data(self):
wtype = str(self.worktype_entry.text())
title = str(self.title_entry.text())
url = str(self.url_entry.text())
return dict(title=title, url=url, type=wtype)
def set_data(self, data):
self.title_entry.setText(data['title'])
self.url_entry.setText(data['url'])
wtype = data['type']
if wtype is None:
wtype = 'website'
self.worktype_entry.setText(wtype)
示例3: __init__
def __init__(self, parent, fields, text=None, name='EditableRecord'):
QGridLayout.__init__(self, parent, len(fields) + 2, 2, 1, -1, name)
self.fields = fields
self.entries = {}
self._setupfields(parent)
self.setSpacing(7)
self.setMargin(10)
self.addMultiCellWidget(QLabel(text, parent), 0, 0, 0, 1)
示例4: __init__
def __init__(self, parent, fields, text=None, name='SimpleRecord'):
if text is None:
text = '<b>insert a simple record</b>'
QGridLayout.__init__(self, parent, len(fields) + 1, 2, 1, -1, name)
self.fields = fields
self.entries = {}
self._setupfields(parent)
self.setSpacing(7)
self.setMargin(10)
self.addMultiCellWidget(QLabel(text, parent), 0, 0, 0, 1)
示例5: IntroPage
class IntroPage(BaseConfigWidget):
def __init__(self, parent, name='IntroPage'):
BaseConfigWidget.__init__(self, parent, name=name)
numrows = 2
numcols = 1
margin = 5
space = 7
self.grid = QGridLayout(self, numrows, numcols,
margin, space, 'IntroPageLayout')
lbl = QLabel(intro, self)
self.grid.addWidget(lbl, 0, 0)
示例6: __init__
def __init__(self, parent, cfg, group, keys):
cfg.setGroup(group)
QGridLayout.__init__(self, parent, len(keys), 2)
self.entries = {}.fromkeys(keys)
row = 0
for k in keys:
self.addWidget(QLabel(k, parent), row, 0)
entry = KLineEdit(parent)
self.addWidget(entry, row, 1)
self.entries[k] = entry
entry.setText(cfg.readEntry(k))
row += 1
示例7: SoundBlasterHardwareOptions
class SoundBlasterHardwareOptions(QWidget):
def __init__(self, parent, name="SoundBlasterHardwareOptions"):
QWidget.__init__(self, parent, name)
numrows = 2
numcols = 3
margin = 0
space = 1
self.grid = QGridLayout(self, numrows, numcols, margin, space, "SoundBlasterHardwareOptionsLayout")
self.base_box = ConfigSpinWidget(self, "I/O address", max=1000)
self.grid.addWidget(self.base_box, 0, 0)
self.irq_box = ConfigSpinWidget(self, "IRQ", min=3, max=15)
self.grid.addWidget(self.irq_box, 1, 0)
self.dma_box = ConfigSpinWidget(self, "DMA")
self.grid.addWidget(self.dma_box, 0, 2)
self.hdma_box = ConfigSpinWidget(self, "High DMA")
self.grid.addWidget(self.hdma_box, 1, 2)
def get_config_options(self):
opts = {}
opts["sbbase"] = self.base_box.get_config_option()
opts["irq"] = self.irq_box.get_config_option()
opts["dma"] = self.dma_box.get_config_option()
opts["hdma"] = self.hdma_box.get_config_option()
return opts
def set_config_options(self, opts):
self.base_box.set_config_option(opts["sbbase"])
self.irq_box.set_config_option(opts["irq"])
self.dma_box.set_config_option(opts["dma"])
self.hdma_box.set_config_option(opts["hdma"])
示例8: TestConfigTab
class TestConfigTab(QWidget):
def __init__(self, parent, name='TestConfigTab'):
QWidget.__init__(self, parent, name)
self.grid = QGridLayout(self, 2, 1, 0, 1, 'TestConfigTabLayout')
self.textbrowser = KTextBrowser(self)
self.grid.addWidget(self.textbrowser, 0, 0)
self.button = KPushButton(self)
self.button.setText('test get_config')
self.grid.addWidget(self.button, 1, 0)
def set_config(self, cfg):
tfile = StringIO()
cfg.write(tfile)
tfile.seek(0)
text = tfile.read()
self.textbrowser.setText(text)
示例9: DosboxPathPage
class DosboxPathPage(BaseConfigWidget):
def __init__(self, parent, name='DosboxPathPage'):
BaseConfigWidget.__init__(self, parent, name=name)
numrows = 2
numcols = 1
margin = 5
space = 7
self.grid = QGridLayout(self, numrows, numcols,
margin, space, 'DosboxPathPageLayout')
lbl = QLabel(dosbox_path_lbl, self)
lbl.setFrameStyle(lbl.Panel + lbl.Sunken)
#lbl.setFrameStyle(lbl.Raised)
self.grid.addWidget(lbl, 0, 0)
self.dosbox_path_entry = ConfigKURLSelectWidget(self, 'Path to main dosbox area',
filetype='dir')
self.grid.addWidget(self.dosbox_path_entry, 1, 0)
示例10: __init__
def __init__(self, parent, name='BaseGuestDataFrame'):
QFrame.__init__(self, parent, name)
self.guestid = None
numrows = 2
numcols = 2
margin = 0
space = 1
self.grid = QGridLayout(self, numrows, numcols,
margin, space, 'BaseGuestDataLayout')
self.app = get_application_pointer()
self.fname_lbl = QLabel('First Name', self)
self.fname_entry = KLineEdit('', self)
self.grid.addWidget(self.fname_lbl, 0, 0)
self.grid.addWidget(self.fname_entry, 1, 0)
self.lname_lbl = QLabel('Last Name', self)
self.lname_entry = KLineEdit('', self)
self.grid.addWidget(self.lname_lbl, 0, 1)
self.grid.addWidget(self.lname_entry, 1, 1)
self.title_lbl = QLabel('Title', self)
self.title_entry = KLineEdit('', self)
self.grid.addMultiCellWidget(self.title_lbl, 2, 2, 0, 1)
self.grid.addMultiCellWidget(self.title_entry, 3, 3, 0, 1)
self.desc_lbl = QLabel('Description', self)
self.desc_entry = KTextEdit(self, 'description_entry')
self.grid.addMultiCellWidget(self.desc_lbl, 4, 4, 0, 1)
self.grid.addMultiCellWidget(self.desc_entry, 5, 7, 0, 1)
示例11: __init__
def __init__(self, parent, umlmachines, name="InstallerWidget"):
QWidget.__init__(self, parent, name)
self.resize(600, 600)
self.app = get_application_pointer()
self.conn = self.app.conn
self.umlmachines = umlmachines
self.machine = self.umlmachines.current
self.current_machine_process = "start"
self.current_profile = None
self.current_trait = None
self.traitlist = []
self.curenv = CurrentEnvironment(self.conn, self.machine)
self.curenv["current_profile"] = "None"
self.curenv["current_trait"] = "None"
self.curenv["current_machine_process"] = self.current_machine_process
self.timer = QTimer(self)
self.connect(self.timer, SIGNAL("timeout()"), self.update_progress)
self.timer.startTimer(1000)
self.grid = QGridLayout(self, 4, 1, 5, 7)
self.main_label = QLabel(self)
self.main_label.setText(self._msg())
self.grid.addWidget(self.main_label, 0, 0)
self.profile_progress_lbl = QLabel(self)
self.grid.addWidget(self.profile_progress_lbl, 1, 0)
self.profile_progress = KProgress(self)
self.grid.addWidget(self.profile_progress, 2, 0)
self.logview = LogBrowser(self, "/tmp/uml-installer.log")
self.grid.addWidget(self.logview, 3, 0)
# self.console_view = StdOutBrowser(self)
# self.console_view = KTextBrowser(self)
# self.grid.addWidget(self.console_view, 4, 0)
self.console_text = ""
示例12: LabeledProgress
class LabeledProgress(QWidget):
def __init__(self, parent, text='', name='LabeledProgress'):
QWidget.__init__(self, parent, name)
self.grid = QGridLayout(self, 2, 1, 5, 7)
self.label = QLabel(self)
if text:
self.label.setText(text)
self.progressbar = SimpleProgress(self)
self.grid.addWidget(self.label, 0, 0)
self.grid.addWidget(self.progressbar, 1, 0)
def setTotalSteps(self, total):
self.progressbar.setTotalSteps(total)
def step_progress(self, *args):
self.progressbar.step_progress(*args)
示例13: onDockChartViewToggled
def onDockChartViewToggled(self, checked):
if checked:
self.chartPopupWindow = QDialog()
self.chartPopupWindow.setWindowFlags(PythonQt.QtCore.Qt.WindowStaysOnTopHint)
layout = QGridLayout()
self.chartPopupWindow.setLayout(layout)
layout.addWidget(self._multiVolumeIntensityChart.chartView)
layout.addWidget(self.popupChartButton)
self.chartPopupWindow.finished.connect(self.dockChartView)
self.chartPopupWindow.resize(self.chartPopupSize)
self.chartPopupWindow.move(self.chartPopupPosition)
self.chartPopupWindow.show()
self.popupChartButton.setText("Dock chart")
self._multiVolumeIntensityChart.chartView.show()
else:
self.chartPopupWindow.close()
示例14: __init__
def __init__(self, parent, name='TestConfigTab'):
QWidget.__init__(self, parent, name)
self.grid = QGridLayout(self, 2, 1, 0, 1, 'TestConfigTabLayout')
self.textbrowser = KTextBrowser(self)
self.grid.addWidget(self.textbrowser, 0, 0)
self.button = KPushButton(self)
self.button.setText('test get_config')
self.grid.addWidget(self.button, 1, 0)
示例15: __init__
def __init__(self, parent, text='', name='LabeledProgress'):
QWidget.__init__(self, parent, name)
self.grid = QGridLayout(self, 2, 1, 5, 7)
self.label = QLabel(self)
if text:
self.label.setText(text)
self.progressbar = SimpleProgress(self)
self.grid.addWidget(self.label, 0, 0)
self.grid.addWidget(self.progressbar, 1, 0)