How can I fill entire \"Push button\" with Graphic File(PNG Format).

Discussion about recent product features & solutions!
5 posts • Page 1 of 1
yjsid939
Posts:13
Joined: Mon Dec 23, 2013 3:44 am

How can I fill entire \"Push button\" with Graphic File(PNG Format).

Post by yjsid939 »

With WinCCOA 3.12 I could fill entire surface of Push Button with some image but after upgrade to WinCCOA 3.14 I can not fill it.

I can solve if I replaced push button with rectangle but there are too many push buttons in my project.

And I need some properties of push button.

please refer this picture.
Image


And after upgrade I have this error
=======================================================================================
WCCOAui (2), 2016.11.08 18:20:19.188, SYS, WARNING, 54, Unexpected state, Qt, libpng warning: iCCP: known incorrect sRGB profile
WCCOAui (2), 2016.11.08 18:20:19.208, CTRL, WARNING, 5/ctrl, Location of the following log entry:
=======================================================================================
All object which filled with pictures have same error.

Please let me know how can I remove this problems.

Thank you

fmulder
Posts:330
Joined: Wed Feb 03, 2010 9:46 am

Re: How can I fill entire \"Push button\" with Graphic File(PNG Format).

Post by fmulder »

WinCC Oa uses Qt as its graphical framework. You can use CSS stylesheets ( see http://doc.qt.io/qt-4.8/stylesheet-examples.html ) to style any item in your application.
You should be able to style the border of your buttons.

You'll find many examples on the internet when you look for Qt and style sheets

You can style specific button by specifying the name of your button in the style sheet. A second (and better) option is to use the field 'Typename' of your button.

* store the text define below in a file config\\stylesheet.css (you'll have to play with it. This is just an example)
* Modify your button. Change the field "Typename' to become "MYBITMAPBUTTON"

Code: Select all

QPushButton[type = "MYBITMAPBUTTON"]
{
  border: 1px solid rgb(0,0,0);
  border-radius: 0px;
}
Good luck and share the fun
Frenk Mulder

yjsid939
Posts:13
Joined: Mon Dec 23, 2013 3:44 am

Re: How can I fill entire \"Push button\" with Graphic File(PNG Format).

Post by yjsid939 »

Thank you Frenk.

Now, I can fill MyButtons !

Have a nice day~~

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: How can I fill entire \"Push button\" with Graphic File(PNG Format).

Post by Gertjan van Schijndel »

Without using a stylesheet you could set the 'Border Style' to 'None' and the background color to transparent.

yjsid939
Posts:13
Joined: Mon Dec 23, 2013 3:44 am

Re: How can I fill entire \"Push button\" with Graphic File(PNG Format).

Post by yjsid939 »

Thank you .

But if use Border Style and transparent color , Button border still exist with transparent color.

So I think I need border radius 0 px.

5 posts • Page 1 of 1