Frame stylesheet

Find and share HowTos to various installations / configurations!
Search

Post Reply
8 posts • Page 1 of 1
marcvelarodino
Posts: 16
Joined: Wed Nov 09, 2011 4:36 pm

Frame stylesheet

Post by marcvelarodino »

Is there a way to customize the border style of a Frame object with the stylesheet.css?

I have tried setting the border, border-style and color properties of the QFrame widget, without success.

Thanks!

User avatar
mkoller
Posts: 741
Joined: Fri Sep 17, 2010 9:03 am

Re: Frame stylesheet

Post by mkoller »

No, you can't. In the stylesheet.css you can only configure widgets, but our frame shape is no widget - it's just drawn directly onto the panel, much like a rectangle

User avatar
joost.lijster@siemens.com
Posts: 19
Joined: Wed Sep 21, 2016 1:51 pm

Re: Frame stylesheet

Post by joost.lijster@siemens.com »

Hi Marc,

As far as I know:

No.


I've come pretty far as it comes to styling QT widgets using the stylesheet, and it turns out to be that a lot of things are possible, with only a few exceptions. One of them that fails are rows in a table, for example (which is a pity).

The thing with trying to style a frame through QSS/CSS is, that apparently it is not a QT widget: it is not listed in the available classes in the WinCC OA helpfile (3.14). The only QFrame there, is a base frame for the clock, which responds quite nicely to CSS.

A bit of experimenting tells that "primitive" items, such as primitive_text, rectangles, circles, lines, etc. unfortunately do not respond to a stylesheet. QT widgets do. See attached image (all items with an orange border react to the stylesheet).

The border style is (up to a certain point) customizable through the GEDI though, as long as the border style is not 3d. An example of a red border is also included in the image.

If there is anything I am overlooking at this point, I would be eager to know as well ;)

Kind regards,

Joost Image
Attachments
FrameStyling.png

marcvelarodino
Posts: 16
Joined: Wed Nov 09, 2011 4:36 pm

Re: Frame stylesheet

Post by marcvelarodino »

Thank you all!

We have customized buttons, panels, labels, textboxes and menus, and now wanted to customize the frames too. The reason is we have a lot of frames and wanted to avoid customizing the borders through the GEDI.

But if we can't, we can't.

Nevertheless, we have seen a weird effect when referencing symbols with frames inside. Although we customize the border style of the symbol, when it is used in a panel, the frame is shown with 3D style.

Is there a way to avoid this behaviour?

Thanks!

marcvelarodino
Posts: 16
Joined: Wed Nov 09, 2011 4:36 pm

Re: Frame stylesheet

Post by marcvelarodino »

The easiest workaround we have found is to customize the frame properties in their Initialize script.

User avatar
mkoller
Posts: 741
Joined: Fri Sep 17, 2010 9:03 am

Re: Frame stylesheet

Post by mkoller »

I don't understand the problem. Can you provide a testpanel, please ?

marcvelarodino
Posts: 16
Joined: Wed Nov 09, 2011 4:36 pm

Re: Frame stylesheet

Post by marcvelarodino »

Of course!
I'm trying to attach a zip file with two panels. One, named Symbol.pnl, with a red flat frame customized through GEDI, and another one, named Panel.pnl, with a reference of Symbol.

You will see that while the frame in Symbol is red and flat, the one in the reference has a 3D border.


https://www.winccoa.com/fileadmin/image ... panels.zip
Attachments
panels-20170308.zip
(771 Bytes) Downloaded 224 times
panels.zip
(771 Bytes) Downloaded 236 times

User avatar
mkoller
Posts: 741
Joined: Fri Sep 17, 2010 9:03 am

Re: Frame stylesheet

Post by mkoller »

Thanks for the example. I found the problem. The Frame shape forgot to copy the frame style.
You can see the same problem by simply copying the Frame in Gedi.
Funny that this was not discovered before ... that code part is already very old ...

Fixed that now for the next 3.15 patch

Post Reply
8 posts • Page 1 of 1