<commit_before>#include <QTabBar>

class QtNativeTabBar : public QTabBar
{
public:
    explicit QtNativeTabBar(QWidget* parent=0) : QTabBar(parent)
    {
        setIconSize(QSize(80, 80));
        setExpanding(true);
    }
protected:
    QSize tabSizeHint(int) const
    {
        return QSize(80, 80);
    }
};<commit_msg>RhoSimulator: fixed TabBar icon/text layout (icon above / text below)<commit_after>#include <QTabBar>
#include <QStylePainter>
#include <QStyleOptionTabV3>
#include "QtMainWindow.h"

class QtNativeTabBar : public QTabBar
{
public:
    explicit QtNativeTabBar(QWidget* parent=0) : QTabBar(parent)
    {
        setIconSize(QSize(58, 58));
        setExpanding(true);
    }
    //virtual ~QtNativeTabBar () {}
protected:
    QSize tabSizeHint(int) const
    {
        return QSize(80, 80);
    }

    void paintEvent(QPaintEvent *)
    {
        QStylePainter painter(this);
        for (int i = 0; i < this->count(); ++i) {
            //QtMainWindow::QTabBarRuntimeParams tbrp = this->tabData(i).toHash();
            QStyleOptionTabV3 tab;
            initStyleOption(&tab, i);
            // drawing tab background
            painter.drawControl(QStyle::CE_TabBarTabShape, tab);
            QSize iSize = this->iconSize();
            // icon is aligned to top
            QRect iconRect = QRect(tab.rect);
            iconRect.setHeight(iSize.height());
            // text occupies all the rest
            QRect labelRect = QRect(tab.rect);
            labelRect.setTop(labelRect.top()+iSize.height());
            // drawing
            painter.drawItemPixmap(iconRect, Qt::AlignCenter, tab.icon.pixmap(iSize));
            painter.drawItemText(labelRect, Qt::AlignHCenter, palette(), 1, tab.text);
        }
    }
};
{'fraction_non_alphanumeric': 0.12185354691075514, 'fraction_numerical': 0.012585812356979404, 'mean_word_length': 2.533333333333333, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4431187', 'n_tokens_mistral': 571, 'n_tokens_neox': 552, 'n_words': 111}