title: QLabel margin and style sheet padding in labels in Qt
body: <p>I have a label, and I set both padding in the style sheet and a margin using <code>setMargin()</code>.</p>
  
  <pre><code>ui-&gt;label-&gt;setPixmap(redRectWithGreenBorder(80, 40));
  ui-&gt;label-&gt;setStyleSheet("QLabel {border: 1px solid gray;border-radius: 2px;background-color: white;padding: 0px 5px 10px 15px;}");
  ui-&gt;label-&gt;setMargin(5);
  </code></pre>
  
  <p>But this is how it looks in reality:</p>
  
  <p><img src="https://i.stack.imgur.com/ORQQl.png" alt="enter image description here"></p>
  
  <p>The visible margins are 5, 10, 15 and 20 (I checked with an image editor). That is, they are equal to the value of the style sheet for this side plus the value of <code>margin()</code>, i.e. 0+5, 5+5, 10+5, 20+5.</p>
  
  <p>However, the documentation says this about <code>setMargin()</code>:</p>
  
  <blockquote>
    <p>margin : int This property holds the width of the margin.</p>
    
    <p>The margin is the distance between the innermost pixel of the frame
    and the outermost pixel of contents.</p>
    
    <p>The default margin is 0.</p>
  </blockquote>
  
  <p>If I were taking the documentation at face value, I would have expected the margin to be the real distance between the content and the border. But it is not. Instead, <strong>the sum of the margin and the style sheet padding</strong> is the real margin.</p>
  
  <p>My question is, where in the documentation is this behavior described? Is there some other place in the documentation where this behavior is specified that I have missed?</p>