title: Qt: change font weight
body: <p>I would like to have my text in <code>QLabel</code> somewhere between bold and normal style and I believe that setting font-weight should be the answer to my problem.</p>
  <p><strong>In Qt documentation, I have found out that there are two options how to change font-weight:</strong></p>
  <ol>
  <li><p>From cpp side via: <code>QFont::setWeight()</code> method which accepts numbers 0-99</p>
  <p><a href="http://doc.qt.io/qt-4.8/qfont.html#Weight-enum" rel="nofollow noreferrer">http://doc.qt.io/qt-4.8/qfont.html#Weight-enum</a></p>
  </li>
  <li><p>From Qss style via: <code>font-weight</code> attribute, which accepts numbers 100,200,...,900</p>
  <p><a href="http://doc.qt.io/qt-4.8/stylesheet-reference.html#font-weight" rel="nofollow noreferrer">http://doc.qt.io/qt-4.8/stylesheet-reference.html#font-weight</a></p>
  </li>
  </ol>
  <p>I have tried both methods and nothing seems to work. I always get only normal or the ordinary bold style and nothing in between.</p>
  <p><strong>Example:</strong></p>
  <pre><code>QLabel* test1 = new QLabel(&quot;Font-weight testing&quot;);
  test1-&gt;show();
  
  QLabel* test2 = new QLabel(&quot;Font-weight testing&quot;);
  QFont font = test2-&gt;font();
  font.setWeight(40);
  test2-&gt;setFont(font);
  test2-&gt;show();
  
  QLabel* test3 = new QLabel(&quot;Font-weight testing&quot;);
  test3-&gt;setStyleSheet(&quot;font-weight: 400&quot;);
  test3-&gt;show();
  </code></pre>
  <p>In the example above, I have created 3 labels. One without any additional setting, one where I have changed font weight via <code>setWeight</code> method, and one where the font-weight should be changed via Qss style. But all three will end up being exactly the same.</p>
  <p>I have even tried to make font bigger, enable antialiasing, or use different font but nothing helped.</p>