Greetings, I've been attempting to develop a Plasma applet using Python. I'm having an issue, however, with the height of the Plasma::TreeView being artificially constrained if I embed it in a Plasma::TabBar. If I put the TreeView directly onto the plasma applet without the TabBar, the height of the TreeView expands to take up all available space in the window. If, instead, I place the TreeView in a TabBar, the height of the TreeView will not expand past a certain point (the width does not seem similarly constrained). I've tried setting the maximum height on both TabBar and the inner TreeView element (using setMaximumHeight) to no avail.
I may be missing something obvious, as I'm still very new on Plasma development (and Python as well), but scoured the Internet and could not find a solution to the problem. If this is the wrong venue to ask this question, please let me know where else to go, otherwise, can anyone let me know what I'm missing please? I've attached sample code in Python which demonstrates the issue (it currently calls init_tabs, which creates the TreeView inside a TabBar. If I switch it to calling init_tree, it does not put the TreeView inside the TabBar, and the TreeView expands without limit as the window is expanded vertically). System: Debian Squeeze with Python 2.6.5+ KDE Development Platform 4.4.4 Qt: 4.6.3 Thanks, Glenn.
# -*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * from PyKDE4.plasma import Plasma from PyKDE4 import plasmascript class Cutlery(plasmascript.Applet): def __init__(self, parent, args=None): plasmascript.Applet.__init__(self, parent) def init(self): self.init_tabs() def init_tabs(self): self.layout = QGraphicsLinearLayout(Qt.Vertical, self.applet) self.tabs = Plasma.TabBar(self.applet) self.tab = [ Plasma.TreeView(self.tabs), Plasma.TreeView(self.tabs) ] self.tabs.addTab( "Knife", self.tab[0] ) self.tabs.addTab( "Fork", self.tab[1] ) self.layout.addItem(self.tabs) self.setAspectRatioMode(Plasma.IgnoreAspectRatio) self.setHasConfigurationInterface(False) def init_tree(self): self.layout = QGraphicsLinearLayout(Qt.Vertical, self.applet) self.tree = Plasma.TreeView(self.applet) self.layout.addItem(self.tree) self.setAspectRatioMode(Plasma.IgnoreAspectRatio) self.setHasConfigurationInterface(False) def CreateApplet(parent): return Cutlery(parent)
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel