![]() KDE Developer ![]()
|
Hi,
I've been trying to write a plasmoid using the Simplified Javascript API. Most things work fine, but I couldn't get out how to 1. set an fixed size for an element (I want a tabbar to have an fixed height) 2. position objects undepend from the horizontal/vertical layout (Probably with the GridLayout but I couldn't get out how to use it) Thanks for the help in advance |
![]() KDE Developer ![]()
|
I believe every element has a QRectF property called "geometry", you can set it to any QRect you like.
See http://techbase.kde.org/Development/Tut ... nt_Gallery "Common Properties" |
![]() KDE Developer ![]()
|
I tried that but it has no effect...
|
![]() KDE Developer ![]()
|
Might not change the size (check out size policy stuff), but it should reposition. Make sure the stuff isn't in a layout when using this.
Post a snippit of your code. |
![]() KDE Developer ![]()
|
Of course it has to be in a layout, when its not its just absolute.
The question is which layout (linear/grid/anchor) to use that it has relative and flexible positions, but I also can set fixed sizes and (most important) can have elements horizontal and vertical positioned (like a table). (I want to have a button left, a button right, a text-area between and a tabbar under this three) I thought grid layout seems it offered this features, but I can't get out how to use it |
![]() KDE Developer ![]()
|
I think the layout you can do as follows:
VerticalLayout Horizontal Layout button text button tabbar i.e put the buttons and text box in a horizontal layout put the horizontal layout in the vertical layout, and then put the tab bar in the vertical layout too. Qt's grid layout certainly allows an item to span multiple items, but this isn't using Qt's normal layout classes. (they're special ones for graphicsview) |
![]() KDE Developer ![]()
|
Thanks this works...
but what should I use as containment for the horizontal-layout? An empty Label can do but I think it's not best... and with element.maximumSize = new QSizeF(width,heigth); I could resize it correctly Thanks again for the help Edit: Plasmate, Plasmoidviewer and Plasma-Desktop crashed when trying to remove the plasmoid, the crash might be a bug (I've already sent a bug report), but it seems that this was not the preferred way... |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]