Hi!
I'm developing a software that uses QwtPlot to display a bar graph. This software configures most of its visual configuration by a global .css stylesheet file loaded at startup. Part of the instructions at the .css file includes setting that a given font, namely Bitstream Vera Sans, needs to be used as default font across the system with the exception of some places where the Mono version of this font needs to be used instead.
sb.png
At first the code at the .css file included the lines:
{
font-family: "Bitstream Vera Sans";
background: rgb(40, 40, 40);
color: rgb(255, 255, 255);
border-color: rgb(255, 255, 255);
}
QMainWindow
{
font-family: "Bitstream Vera Sans";
background: rgb(40, 40, 40);
color: rgb(255, 255, 255);
border-color: rgb(255, 255, 255);
}
To copy to clipboard, switch view to plain text mode
at the top, with the "font-family line" being repeated for all other widgets mentioned in the .css file. To better organize it (and it wasn't actually covering all widgets), I decided to change the above code to
*
{
font-family: "Bitstream Vera Sans";
}
{
background: rgb(40, 40, 40);
color: rgb(255, 255, 255);
border-color: rgb(255, 255, 255);
}
*
{
font-family: "Bitstream Vera Sans";
}
QMainWindow
{
background: rgb(40, 40, 40);
color: rgb(255, 255, 255);
border-color: rgb(255, 255, 255);
}
To copy to clipboard, switch view to plain text mode
while also removing all other calls to the "font-family line".
After doing that, I discovered that the bar graph mentioned above became buggy: it is simply not drawn appropriately any more, but instead only shows the yLeft axis for a second and then even it becomes hidden showing a vertical, empty line instead:
b.png
I discovered that only by changing the above code to the old one (without returning the "font-family line" to the other widgets) I was able to make the bar graph appear correctly. I even created a recursive function that would return me all widgets significant to the plotting of the bar graph (its parents and parents of parents etc.) and forced them to have the exact same font configuration they possess when the first code is in the .css (that is I made all relevant QWidget based classes behave as if the new code wasn't there), but even this way the bug wouldn't go away.
Any hint on what could possibly be making this QwtPlot go buggy?
EDIT
I just tested another code:
*
{
font-family: "DejaVu Sans";
}
{
font-family: "Bitstream Vera Sans";
background: rgb(40, 40, 40);
color: rgb(255, 255, 255);
border-color: rgb(255, 255, 255);
}
*
{
font-family: "DejaVu Sans";
}
QMainWindow
{
font-family: "Bitstream Vera Sans";
background: rgb(40, 40, 40);
color: rgb(255, 255, 255);
border-color: rgb(255, 255, 255);
}
To copy to clipboard, switch view to plain text mode
, so using the "global" system but forcing the default font into it instead of the one I want to use, and the bug didn't appear. The same if I take out the font-family line inside QMainWindow. This serves as an extra evidence that somehow the problem lies in the font being used despite the previously mentioned tests. It would seem that my recursive function isn't actually catching all widgets, with at least one still being missed and also being the responsible for the bug.
Bookmarks