title: Qt: Weird Behaviour when removing outline from QTableView
body: <p>I'm trying to remove the dotted outline, when an item in a QTableView is focused. I found in other answers, that <code>outline: 0</code> will remove it, but i for me, that is only working in weird cases:</p>
  
  <p>With this Stylesheet, the outline is removed and the background is yellow: </p>
  
  <pre class="lang-cpp prettyprint-override"><code>tableView-&gt;setStyleSheet("QTableView::item::focus { outline: 0; background-color: yellow; } QTableView { outline: 0; }");
  </code></pre>
  
  <p>With this Stylesheet the outline is still shown:  </p>
  
  <pre class="lang-cpp prettyprint-override"><code>tableView-&gt;setStyleSheet("QTableView::item::focus { outline: 0; } QTableView { outline: 0; }");  
  tableView-&gt;setStyleSheet("QTableView { outline: 0; }");
  tableView-&gt;setStyleSheet("QTableView::item::focus { outline: 0; }");
  tableView-&gt;setStyleSheet("QTableView::item::focus { outline: 0; background-color: yellow; }");
  </code></pre>
  
  <p>I want to have the outline removed and the background in its default color. But it seems, it's not having the option to. The outline command only works in specific cases, which feel very random to me.</p>
  
  <p>Is this an error from me, in misunderstanding Qt or Stylesheets. Or is this a known bug, or a new bug?</p>
  
  <p>Edit (images for understanding what i mean):</p>
  
  <ol>
  <li><p>This is the default behaviour. See the outline around the element 1-2!<br>
  <a href="https://i.stack.imgur.com/SUO4V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SUO4V.png" alt="Default Behaviour"></a></p></li>
  <li><p>This is with the style <code>QTableView::item::focus { outline: 0; background-color: yellow; } QTableView { outline: 0; }</code> added. Now the ouline is not shown, but the background of the focused object is yellow:<br>
  <a href="https://i.stack.imgur.com/A6awU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A6awU.png" alt="Working example"></a></p></li>
  <li><p>This is with the 4 variants, that should work, but the outline is still shown (outline is around the object in position 1-2):<br>
  <a href="https://i.stack.imgur.com/YSMFt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YSMFt.png" alt="Failing example 1"></a><br>
  <a href="https://i.stack.imgur.com/DW37E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DW37E.png" alt="Failing example 2"></a>
  <a href="https://i.stack.imgur.com/rgfmN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rgfmN.png" alt="Failing example 3"></a>
  <a href="https://i.stack.imgur.com/JRIZi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JRIZi.png" alt="Failing example 4"></a></p></li>
  </ol>
  
  <p>The thing is, i don't understand, why it works in exacly one specific way and not in the other ones?
  And what do i have to do, to remove the outline without changing the background?</p>