On 09/08/2017 21:49, Black Michael via wsjt-devel wrote:
I tried using bringing in a simple stylesheet via the command line switch -style but I get no effect on the main window or any of the widgets.


So either I have the wrong syntax or something just plain isn't working.
I expect to be able to name the widget and set the stylesheet like this from what I've read.

MainWindow {
 font: bold 10pt "Arial";
 color : white;
 background-color : grey;
}

I can't find any examples of using the command line switches like this.

de Mike W9MDB

Hi Mike,

IIRC the -style option selects from predefined styles although I can't find the docs on that right now.

Also see here: http://doc.qt.io/qt-5/qapplication.html#styleSheet-prop

and here: http://doc.qt.io/qt-5/style-reference.html (lots of reading here)

Examples in the Qt sources, here: http://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/widgets/stylesheet

and here: http://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/widgets/styles

WSJT-X uses both widget and application stylesheets in a rather ad hoc fashion and is not a very stylesheet friendly application but that can be sorted out with some changes. I suspect that some widgets will always be styled only by the application but making it more friendly to different application stylesheets and even user stylesheets is a reasonable project, not trivial though. What is needed is the metadata to make good stylesheets possible to write, for example grouping widgets of similar type and usage by property values.

Your style sheet look wrong to me, shouldn't the type selector be QMainWindow rather than MainWindow.

The way WSJT-X controls fonts will not be compatible with trying to set fonts via a stylesheet, this is due to a limitation in the way Qt widgets use fonts and stylesheets.

73
Bill
G4WJS.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to