How to control the colors for everything contained in Plotmanager?

16 views
Skip to first unread message

russ

unread,
Aug 29, 2014, 2:01:03 PM8/29/14
to guidata...@googlegroups.com
I am building an application which uses Qt stylesheets to control the look of all the widgets and I need to 
be able to do the same thing with the ImageWidget and CurveWidget's. I tried modifying some of the settings in 
guiqwt/config.py but it doesnt look like things like the background color for plots is available. 

I am likely looking in the wrong place, has someone already done this?
any help appreciated, thanks
-Russ

Uwe Rathmann

unread,
Sep 3, 2014, 3:59:13 AM9/3/14
to guidata...@googlegroups.com
On Fri, 29 Aug 2014 11:01:03 -0700, russ wrote:

> I am building an application which uses Qt stylesheets to control the
> look of all the widgets and I need to be able to do the same thing with
> the ImageWidget and CurveWidget's. I tried modifying some of the
> settings in guiqwt/config.py but it doesnt look like things like the
> background color for plots is available.

guiqwt uses a very outdated version of Qwt ( via pyqwt ), that was
implemented long before stylesheets have been introduced in Qt.

Uwe

Eric McDonald

unread,
Sep 5, 2014, 10:19:21 AM9/5/14
to guidata...@googlegroups.com

I was able to use stylesheets to change the plot area background. Look at the way you can specify which Qt widgets a stylesheet applies to which can allow you to apply it only to the canvas area.

--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqw...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Russ Berg

unread,
Sep 5, 2014, 12:29:25 PM9/5/14
to guidata...@googlegroups.com

Thanks for the info, I have a plot in a DockWidget and I had somehow missed how to assign a style to child widgets. So what seems to work is if I have a sub-class of CurveDialog called CurveViewWidget I can assign a style in the sheet like this:

 

/* for the area around the plot */

QDockWidget  .CurveViewerWidget{

   background-color: rgb(90,90,90);

}

 

I also noticed that if I had as the “centralwidget” for my MainWidnow a TabWidget with 2 pages each with an ImageDialog and a CurveViewWidget respectively, the stylesheet would not be applied unless I explicitly called:

 

self.centralwidget.setStyleSheet(ssheet)

 

Thanks

-Russ

Reply all
Reply to author
Forward
0 new messages