Hi,
I am currently creating a Qt Widget for WinCC OA.
I am facing a puzzling issue: different behavior if the widget runs in a QApplication or in WInCCOA.
Here is description of what I try to do and what is my issue.
I am trying to create a custom handle slider:
1) I have a Proxystyle for writting again the subcontrolrect and drawcomplexcontrol for groove and handle (no issues here)
2) I want to pass a new property to my opt, so I also implement a new styleOption derived from QStyleOptionSlider (property is a color)
3) In my paintEvent I write a value to this new option (option.handle_min_color = Qt::yellow;)
4) This option is used by the drawComplexControl
So here comes the problem. If I run my widget in a QApplication, then my handle is yellow, as expected. But if I run it inside WinCC OA, then my handle get the default window color, like the previously set color would be invalid or not transmitted.
I obviously miss something I guess in my EWO project to have same behavior...
Thanks for help
BR
Alex
Different behavior for widget inside WinCC OA and inside Qt application
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Different behavior for widget inside WinCC OA and inside Qt application
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: Different behavior for widget inside WinCC OA and inside Qt application
are you also using a stylesheet in WinCC_OA ?
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: Different behavior for widget inside WinCC OA and inside Qt application
Hi Martin,
I don't use any stylesheet in WinCC OA, neither in Qt.
BR
Alex
I don't use any stylesheet in WinCC OA, neither in Qt.
BR
Alex
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: Different behavior for widget inside WinCC OA and inside Qt application
Hi,
I tried to add more verbosity:
WCCOAui1:WCCOAui (1), 2018.06.27 13:11:18.536, Qt, handle min color value inside paintEvent #ffff00
WCCOAui1:WCCOAui (1), 2018.06.27 13:11:18.536, Qt, handle min color value inside drawcomplexcontrol #000000
For information I have 3 classes here:
- mystyle containing drawcomplexcontrol and myStyleOption (extending sliderOption)
- customslider containing the paintEvent where is the sliderOption init and drawcomplexcontrol called.
- MyWidget which is creating the slider (this is default ewo class)
I tried in a brand new project without anything regarding style and it still doesnt reflect expected behavior.
BR
Alex
I tried to add more verbosity:
WCCOAui1:WCCOAui (1), 2018.06.27 13:11:18.536, Qt, handle min color value inside paintEvent #ffff00
WCCOAui1:WCCOAui (1), 2018.06.27 13:11:18.536, Qt, handle min color value inside drawcomplexcontrol #000000
For information I have 3 classes here:
- mystyle containing drawcomplexcontrol and myStyleOption (extending sliderOption)
- customslider containing the paintEvent where is the sliderOption init and drawcomplexcontrol called.
- MyWidget which is creating the slider (this is default ewo class)
I tried in a brand new project without anything regarding style and it still doesnt reflect expected behavior.
BR
Alex
- adaneau
- Posts:310
- Joined: Tue Feb 21, 2012 9:49 am
Re: Different behavior for widget inside WinCC OA and inside Qt application
Same output inside QTcreator with run test:
handle min color value inside paintEvent #0000ff
handle min color value inside drawcomplexcontrol #0000ff
handle min color value inside paintEvent #0000ff
handle min color value inside drawcomplexcontrol #0000ff