App crash using :setStyleSheet() on a UI dialog

406 views
Skip to first unread message

Zoran Sibinovic

unread,
May 31, 2014, 1:22:02 PM5/31/14
to qtcon...@googlegroups.com
Hi Pritpal,

can you check if  :setStyleSheet() defined in a UI dialog crashes some your app also?

I tried  2 things:

1. Call an already made UI with oDlg := hbqtui_..., then some of  oDlg:dialog:setStyleSheet(...), oDlg:setStyleSheet(...), etc., with various background parameters from image to gradients or colors.

2. define directly in the UI the background color of the dialog and exclude :setStyleSheet(...) in the app.

in both ways, after the dialog shows, the background is colored but, after some seconds, got the windows error close dialog, 
The crash can shows faster if I try some action on the dialog.

Any clue?

Thanks
Zoran   

Pritpal Bedi

unread,
May 31, 2014, 1:36:41 PM5/31/14
to qtcon...@googlegroups.com
Hi

Any clue?


No clue.
Post here a self contained sample, formatted per Harbour standards.


Pritpal Bedi 

Zoran Sibinovic

unread,
May 31, 2014, 2:56:16 PM5/31/14
to qtcon...@googlegroups.com
Hi Pritpal,

I narrowed the crash actions to 2 cases.

in composite.prg after
   oDlg := hbqtui_composite()

add this line
   oDlg:dialog:setStyleSheet( " background-color: rgb(0, 170, 255); " )
or this
   oDlg:dialog:setStyleSheet( " background-color: rgb(0, 170, 255); " )

in bot cases the background is colored, but if you press ESC od click on the X button to close the dialog the app crashes
Taking other actions in the dialog don't make problems for now.

I tried also to put an image as background in the main window and in the dialog with :setStyleSheet( "background-image: url( "+path+"some.jpg )" )
but no image shows. I missed something ?

Thanks
Zoran

Zoran Sibinovic

unread,
May 31, 2014, 3:07:03 PM5/31/14
to qtcon...@googlegroups.com
... another thing I forgot.

In an another try, without adding code lines to composite.prg, using Qt Creator I set in composite.ui the StyleSheet backgroung color of the dialog to background-color: rgb(0, 170, 255);.
The background become colored and then save it.

Recompiled the app and start.
The composite dialog shows without the background color and pressing ESC od click on the X button to close the dialog causes, again the app crash.

Zoran

Reply all
Reply to author
Forward
0 new messages