summaryrefslogtreecommitdiff
path: root/kberylsettings/widget.py
diff options
context:
space:
mode:
authornatural <natural>2006-12-23 13:15:14 +0000
committernatural <natural>2006-12-23 13:15:14 +0000
commit218899acc534b1d8d8896ecf5cbbda8c676732be (patch)
tree54fb6d8cf11ed7374f3e535d27e1cc4a9d70bfa5 /kberylsettings/widget.py
parenta4fcfeb8b855e88d8e662c562dfbd6c9370793a1 (diff)
downloadkberylsettings-218899acc534b1d8d8896ecf5cbbda8c676732be.tar.gz
kberylsettings-218899acc534b1d8d8896ecf5cbbda8c676732be.tar.bz2
Updated setting widget construction and splitter handling.
Diffstat (limited to 'kberylsettings/widget.py')
-rw-r--r--kberylsettings/widget.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/kberylsettings/widget.py b/kberylsettings/widget.py
index 246c29d..f86a73a 100644
--- a/kberylsettings/widget.py
+++ b/kberylsettings/widget.py
@@ -12,11 +12,11 @@ class Frame(QFrame):
""" Frame -> QFrame with QVBoxLayout
"""
- def __init__(self, parent, margin=0, spacing=-1):
+ def __init__(self, parent, margin=0, spacing=-1, autoAdd=True):
QFrame.__init__(self, parent)
layout = QVBoxLayout(self, margin, spacing)
layout.setAlignment(Qt.AlignTop | Qt.AlignLeft)
- layout.setAutoAdd(True)
+ layout.setAutoAdd(autoAdd)
class Popup(KPopupMenu):
@@ -35,6 +35,7 @@ class Splitter(QSplitter):
def __init__(self, parent, style):
QSplitter.__init__(self, style, parent)
self.setOpaqueResize(True)
+ self.setChildrenCollapsible(False)
class SmallPushButton(KPushButton):
@@ -61,6 +62,7 @@ class ListView(KListView):
"""
def __init__(self, parent):
KListView.__init__(self, parent)
+ self.setSorting(-1)
def __iter__(self):
""" iterate over QListView items
@@ -74,6 +76,19 @@ class ListView(KListView):
item = it.current()
+class ShortListView(ListView):
+ def __init__(self, parent, text, lines):
+ ListView.__init__(self, parent)
+ self.addColumn(text)
+ self.setResizeMode(self.LastColumn)
+ self.setHeightLines(lines)
+
+ def setHeightLines(self, num):
+ height = self.fontMetrics().lineSpacing() * num
+ height += self.header().height()
+ self.setMaximumHeight(height)
+
+
class WidgetStack(QWidgetStack):
""" WidgetStack -> QWidgetStack with QVBoxLayout