PDA

View Full Version : Rendering issues with QGraphicsProxyWidget



abrou
27th September 2012, 00:07
Hello,

I have created subclass of a QGroupBox that contains several widgets, such as two QSliders, QLabels, QLineEdits and a single QGraphicsView (which only draws 3 QGraphicsLineItems). The form was created using Qt Designer.

When the value of the QSlider changes, the QGraphcsView updates, and the LineEdits change to reflect the value of the slider. The class is added to a QGraphicsProxyWidget, shown in another QGraphicsView. Up until now, this has worked well.

Today, I wanted to change the colour of the groove in the QSliders. I want a gradient that changes based on the values of the other slider. I implemented this using a stylesheet (although if you have an alternative, I would LOVE to hear it!), which means updating the stylesheet everytime the value is changed. It works great when I add the gradient to one QSlider, but as soon as I apply it to the second QSlider, the various text in the QGroupBox renders incorrectly. I will attach an example of this problem. The example was taken at one time, the top text renders correctly, but the bottom appears as squares. At first, I thought it might be a layout problem, but changing the layout doesn't fix it (although different texts do not render). The gradient of one QSlider is calculated on the value of the other QSlider.

I should note that one QLineEdit, one QLabel and the text for a QCheckBox do not render correctly, everything else does.

I am using Windows 7, Qt Creator 2.5.2 and Qt 4.8.2.

Thank you very much,

AB8258

abrou
27th September 2012, 17:46
I haven't come up with a proper solution for this, but for now I have taken the QGraphicsProxyWidget out of the QGraphicsScene and just made it a frameless widget on top. This seems like a poor solution, but it solves the text redering problems as well as another rendering problem I didn't mention involving a border-image style sheet and a qpushbutton