title: Change height and icon position of QToolBox tabs, using proxys
body: <p>Ok, so I want to customize the height and the position of icons of the tabs from a QToolBox widget. I am not able to do it using stylesheet (I tried different options, but none worked, see question: <a href="https://stackoverflow.com/questions/48503645/customizing-qtoolbox-tab-height">Customizing QToolBox: tab height</a>), so I decided to give it a try to using a proxy. I know there are the controlElements: </p>
  
  <pre><code>    CE_ToolBar
      CE_ToolBoxTabShape
      CE_ToolBoxTabLabel
  </code></pre>
  
  <p>And so I can use them on the drawControl function to get what I want.</p>
  
  <pre><code>void drawControl(ControlElement oCtrElement,
              const QStyleOption *poStyleOptionption,
              QPainter *poPainter,
              const QWidget *poWidget) const
  </code></pre>
  
  <p>But I am not sure how to implement it... Any help or example?
  Thanks,</p>
  
  <hr>
  
  <p><strong>UPDATE:</strong>
  I have created the proxy, assigned it to the qtoolbox and added conditions to see if I could do something: </p>
  
  <pre><code>    ...
      ToolBoxProxy* tabStyle = new ToolBoxProxy();
      ui-&gt;toolBox-&gt;setStyle(tabStyle);
      ...
  </code></pre>
  
  <p>toolboxproxy.h</p>
  
  <pre><code>#include &lt;QProxyStyle&gt;
  #include &lt;QPainter&gt;
  
  class ToolBoxProxy : public QProxyStyle
  {
  public:
  
      explicit ToolBoxProxy();
      void drawControl(ControlElement oCtrElement, const QStyleOption *             poStylrOptionption, QPainter * poPainter, const QWidget * poWidget = 0) const;
  
  };
  </code></pre>
  
  <p>toolboxproxy.cpp</p>
  
  <pre><code>#include "toolboxproxy.h"
  #include &lt;QDebug&gt;
  
  ToolBoxProxy::ToolBoxProxy(){
  
  }
  
  void ToolBoxProxy::drawControl(ControlElement oCtrElement, const QStyleOption *poStyleOptionption, QPainter *poPainter, const QWidget *poWidget) const
  {
      if (oCtrElement == CE_ToolBar) {
          qDebug() &lt;&lt; "CE_ToolBar";
  
      } else if (oCtrElement == CE_ToolBoxTabShape) {
          qDebug() &lt;&lt; "CE_TOOLBOXTABSHAPE";
  
      } else if (oCtrElement == CE_ToolBoxTabLabel) {
          qDebug() &lt;&lt; "CE_ToolBoxTabLabel";
  
      }
      QProxyStyle::drawControl(oCtrElement, poStyleOptionption, poPainter, poWidget);
  }
  </code></pre>
  
  <p>I don't know why, but the software never prints out any of the 3 qDebug()... but if I set a breakpoint, it only reaches the function when the control element is any of those: </p>
  
  <pre><code>CE_ItemViewItem
  CE_ShapedFrame
  CE_ToolButtonLabel
  </code></pre>