From c10365df2e6d61ae268b8fbfc1cba05c5e157241 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 14 Sep 2010 13:43:25 +0200 Subject: [PATCH] use gridlayout for configuration --- sface/screens/configscreen.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sface/screens/configscreen.py b/sface/screens/configscreen.py index bed2ce7..dbe3909 100644 --- a/sface/screens/configscreen.py +++ b/sface/screens/configscreen.py @@ -9,10 +9,9 @@ class ConfigWidget(QWidget): def __init__(self, parent): QWidget.__init__(self, parent) - layout = QVBoxLayout() + glayout = QGridLayout() + row = 0 for (field,msg) in config.field_labels(): - # label - layout.addWidget(QLabel(msg,self)) # edit : text or checkbox default=config.field_default(field) if isinstance(default,bool): @@ -23,7 +22,11 @@ class ConfigWidget(QWidget): edit=QLineEdit(config.get(field), self) edit.setAttribute(Qt.WA_MacShowFocusRect, 0) setattr(self,field,edit) - layout.addWidget (edit) + + glayout.addWidget(QLabel(msg+":",self), row, 0) + glayout.addWidget(edit, row, 1) + + row += 1 hlayout = QHBoxLayout() hlayout.addStretch() @@ -34,7 +37,11 @@ class ConfigWidget(QWidget): hlayout.addWidget(button, 0, Qt.AlignRight) hlayout.addSpacing(10) self.connect(button, SIGNAL('clicked()'), getattr(self,action)) + + layout = QVBoxLayout() + layout.addLayout(glayout) layout.addLayout(hlayout) + layout.addStretch() self.setLayout(layout) -- 2.43.0