本文整理汇总了Python中qt.QGridLayout类的典型用法代码示例。如果您正苦于以下问题:Python QGridLayout类的具体用法?Python QGridLayout怎么用?Python QGridLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QGridLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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"])
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:35,代码来源:sndcfg.py
示例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)
开发者ID:BackupTheBerlios,项目名称:useless-svn,代码行数:34,代码来源:utdialogs.py
示例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)
开发者ID:BackupTheBerlios,项目名称:konsultant-svn,代码行数:8,代码来源:gui.py
示例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)
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:10,代码来源:__init__.py
示例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)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:11,代码来源:wizard.py
示例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
开发者ID:BackupTheBerlios,项目名称:useless-svn,代码行数:12,代码来源:gui.py
示例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"])
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:30,代码来源:sndcfg.py
示例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)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:16,代码来源:cfgmain.py
示例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)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:16,代码来源:wizard.py
示例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)
开发者ID:BackupTheBerlios,项目名称:useless-svn,代码行数:35,代码来源:utdialogs.py
示例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 = ""
开发者ID:joelsefus,项目名称:paella,代码行数:32,代码来源:installer.py
示例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)
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:16,代码来源:progress.py
示例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()
开发者ID:naucoin,项目名称:MultiVolumeExplorer,代码行数:16,代码来源:qSlicerMultiVolumeExplorerModuleWidget.py
示例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)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:8,代码来源:cfgmain.py
示例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)
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:9,代码来源:progress.py
示例16: ImportGameDialog
class ImportGameDialog(BaseDialogWindow):
def __init__(self, parent, name='ImportGameDialog'):
BaseDialogWindow.__init__(self, parent, name=name)
self.frame = QFrame(self)
margin = 5
space = 7
self.grid = QGridLayout(self.frame, 2, 1, margin, space)
self.url_lbl = QLabel('URL', self.frame)
self.url_entry = KLineEdit('', self.frame)
self.grid.addWidget(self.url_lbl, 0, 0)
self.grid.addWidget(self.url_entry, 1, 0)
self.setMainWidget(self.frame)
self.connect(self, SIGNAL('okClicked()'), self.import_game)
def import_game(self):
url = str(self.url_entry.text())
print url
KMessageBox.information(self, "import_game is still not implemented")
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:19,代码来源:gamedata_widgets.py
示例17: BaseGuestAppearanceFrame
class BaseGuestAppearanceFrame(QFrame):
def __init__(self, parent, name='BaseGuestAppearanceFrame'):
QFrame.__init__(self, parent, name)
margin = 0
space = 1
self.grid = QGridLayout(self, 4, 1, margin, space)
self.appearance_lbl = QLabel('Appearance', self)
self.appearance_url = KLineEdit('', self)
row = 0
for widget in [self.appearance_lbl, self.appearance_url]:
self.grid.addWidget(widget, row, 0)
row += 1
def get_data(self):
url = str(self.appearance_url.text())
return dict(url=url)
def set_data(self, data):
self.appearance_url.setText(data['url'])
开发者ID:BackupTheBerlios,项目名称:useless-svn,代码行数:19,代码来源:utdialogs.py
示例18: BaseTagDialogFrame
class BaseTagDialogFrame(QFrame):
def __init__(self, parent, name='BaseEntityDataFrame'):
QFrame.__init__(self, parent, name)
self.entityid = None
numrows = 5
numcols = 1
margin = 0
space = 1
self.grid = QGridLayout(self, numrows, numcols,
margin, space, 'BaseEntityDataLayout')
self.app = get_application_pointer()
self.lbl = QLabel('Select the tags', self)
self.grid.addWidget(self.lbl, 0, 0)
self.listView = KListView(self)
self.listView.addColumn('tagname', -1)
self.listView.clear()
self.grid.addMultiCellWidget(self.listView, 1, 4, 0, 0)
开发者ID:BackupTheBerlios,项目名称:useless-svn,代码行数:19,代码来源:dialogs.py
示例19: ImportGameUrlDialog
class ImportGameUrlDialog(BaseDialogWindow):
def __init__(self, parent, name='ImportGameUrlDialog'):
BaseDialogWindow.__init__(self, parent, name=name)
self.frame = QFrame(self)
margin = 5
space = 7
self.grid = QGridLayout(self.frame, 2, 1, margin, space)
self.url_lbl = QLabel('URL', self.frame)
self.url_entry = KLineEdit('', self.frame)
self.grid.addWidget(self.url_lbl, 0, 0)
self.grid.addWidget(self.url_entry, 1, 0)
self.setMainWidget(self.frame)
self.connect(self, SIGNAL('okClicked()'), self.import_game)
self.handler = AbandonGamesHandler(self.app)
def _makeinfo(self, base, parser):
text = 'Title: %s\n' % parser.title
if parser.smallinfo:
text += 'Small Information'
for k,v in parser.smallinfo.items():
text += '%s: %s\n' % ( k.capitalize(), v)
#text += str(parser.smallinfo) + '\n'
dlurl = base + parser.download_link
text += 'download page: %s\n' % dlurl
text += 'direct link: %s\n' % parser.real_download_link
if parser.files:
text += 'Files:\n'
text += '======\n'
for f in parser.files:
text += '%s%s\n' % (base, f)
return text
def import_game(self):
url = str(self.url_entry.text())
print url
#KMessageBox.information(self, "import_game is still not implemented")
#self.handler.get_game_data(url)
self.handler.handle_url(url)
#self.handler.parser.feed(file('dunetest.html').read())
win = AbandoniaInfoWindow(self)
win.show()
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:42,代码来源:importgame.py
示例20: SelectRuleset
class SelectRuleset(QDialog):
"""a dialog for selecting a ruleset"""
def __init__(self, server=None):
QDialog.__init__(self, None)
decorateWindow(self, m18n('Select a ruleset'))
self.buttonBox = KDialogButtonBox(self)
self.buttonBox.setStandardButtons(
QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.reject)
self.cbRuleset = ListComboBox(Ruleset.selectableRulesets(server))
self.grid = QGridLayout() # our child SelectPlayers needs this
self.grid.setColumnStretch(0, 1)
self.grid.setColumnStretch(1, 6)
vbox = QVBoxLayout(self)
vbox.addLayout(self.grid)
vbox.addWidget(self.cbRuleset)
vbox.addWidget(self.buttonBox)
开发者ID:KDE,项目名称:kajongg,代码行数:20,代码来源:tables.py
注:本文中的qt.QGridLayout类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论