<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    On 2019-10-24 08:13, Giuseppe D'Angelo via Development wrote:
    <br>
    <blockquote type="cite" style="color: #000000;">Il 23/10/19 16:28,
      Henry Skoglund ha scritto:
      <br>
      <blockquote type="cite" style="color: #000000;">Question: is this
        hit or miss font propagation on Windows and Mac a bug or a
        feature? If it's a feature, could it be documented?
        <br>
      </blockquote>
      <br>
      Please do some extra investigation: who's setting those fonts?
      <br>
      <br>
      * Is it the style, e.g. in QStyle::polish(QWidget*)?
      <br>
      * Is it coming from QApplication::font? Or maybe
      QStyle::polish(QApp*)?
      <br>
      * Do the widgets have WA_SetFont enabled?
      <br>
      etc.
      <br>
      <br>
      It certainly sounds surprising at first that some widgets don't
      inherit the font, but there could be a good explanation. Lacking
      such explanation, then we're talking about a quite serious bug.
      <br>
    </blockquote>
    First the easy questions:
    <br>
    <br>
    * Do the widgets have WA_SETFont enabled? No, none of the kids, just
    the parent (because I called setFont() on it).
    <br>
    (The WA_SetFont() flag is pretty easy to understand (even for me :-)
    i.e. widgets with that flag=true says: leave me alone, don't do the
    font propagation on me, got my own font setting figured out.)
    <br>
    <br>
    * Is it coming from QApplication::font()? No, because I do that
    setFont("Courier") on my top window. But if I comment that line out,
    my top widget would get that application default font instead (on my
    Windows PC it's "MS Shell Dlg 2", 8.25 point size).
    <br>
    <br>
    Off topic: those 8.25 point sizes as default was an excellent choice
    20 years ago when the common display size was 1024x768 or so.
    Nowadays the display sizes are bigger, why not change those prewired
    QApplication::font point sizes to say 12 or even 14?
    <br>
    <br>
    <br>
    This is a pretty complicated subject, for example, for a
    QTableWidget, the font propagation works for the vertical and
    horizontal header rows, but not for the text inside the cells. And
    it's platform dependent, i.e. on Linux everything just *works*.<b
      class="moz-txt-star"><span class="moz-txt-tag"></span><span
        class="moz-txt-tag"></span></b><br>
    <br>
    Anyway, the reason I started this thread was that I couldn't
    understand how the font propagation really worked. I would be
    perfectly happy with the current state of affairs, if it could be
    documented somehow. Right now QWidget's font documentation says that
    the font propagation should occur, except when the QWidget's
    isWindow() is true, but all of the widgets in my example: isWindow()
    == false.
    <br>
    <br>
    I'll look into the QStyle stuff, and I'm pretty sure as you say,
    that the behavior I'm observing is a result of many years hard work
    with the QWidgets.
    <br>
    <br>
    Rgrds Henry
    <br>
    <br>
  </body>
</html>