<commit_before>#include "itemdetailswidget.hpp"
#include "ui_itemdetailswidget.h"

#include <QHBoxLayout>
#include <QHeaderView>
#include <QLabel>
#include <QMapIterator>
#include <QSqlQuery>
#include <QTableWidget>
#include <QTabWidget>
#include <QTextEdit>
#include <QVBoxLayout>

#include "attribute_set.hpp"
#include "global.hpp"
#include "attributetree.h"
#include "skillrequirementtree.hpp"
#include "variationtree.h"

ItemDetailsWidget::ItemDetailsWidget(int typeId, QWidget* parent)
  : QWidget(parent) {
  this->typeId = typeId;
  as = AttributeSet::fromPrototype(typeId);
  init();
}

ItemDetailsWidget::ItemDetailsWidget(const AttributeSet& as, QWidget* parent)
  : QWidget(parent) {
  this->as = as;
  this->typeId = as.prototypeId;
  init();
}

ItemDetailsWidget::~ItemDetailsWidget() {
  delete ui;
}

void ItemDetailsWidget::init() {
  ui = new Ui::ItemDetailsWidget;
  ui->setupUi(this);
  setWindowFlags(Qt::Dialog);
  setAttribute(Qt::WA_DeleteOnClose);
  setWindowTitle(tr("Item Details - %1").arg(as.name));
  ui->typePixmapLabel->setPixmap(*getTypePixmap64(typeId));
  ui->typeNameLabel->setText(QString("<h2>%1</h2>").arg(as.name));
  ui->horizontalLayout->setAlignment(ui->verticalLayout_2, Qt::AlignTop);
  initDescriptionTab();
  initAttributeTree();
  initSkillRequirementTree();
  initVariationTree();
  fillTabs();
}

void ItemDetailsWidget::initDescriptionTab()
{
  descriptionTab = new QTextEdit();<commit_msg>Change ItemDetailsWidget's window flag from Dialog to Tool to make it always flow on top of the main window.<commit_after>#include "itemdetailswidget.hpp"
#include "ui_itemdetailswidget.h"

#include <QHBoxLayout>
#include <QHeaderView>
#include <QLabel>
#include <QMapIterator>
#include <QSqlQuery>
#include <QTableWidget>
#include <QTabWidget>
#include <QTextEdit>
#include <QVBoxLayout>

#include "attribute_set.hpp"
#include "global.hpp"
#include "attributetree.h"
#include "skillrequirementtree.hpp"
#include "variationtree.h"

ItemDetailsWidget::ItemDetailsWidget(int typeId, QWidget* parent)
  : QWidget(parent) {
  this->typeId = typeId;
  as = AttributeSet::fromPrototype(typeId);
  init();
}

ItemDetailsWidget::ItemDetailsWidget(const AttributeSet& as, QWidget* parent)
  : QWidget(parent) {
  this->as = as;
  this->typeId = as.prototypeId;
  init();
}

ItemDetailsWidget::~ItemDetailsWidget() {
  delete ui;
}

void ItemDetailsWidget::init() {
  ui = new Ui::ItemDetailsWidget;
  ui->setupUi(this);
  setWindowFlags(Qt::Tool);
  setAttribute(Qt::WA_DeleteOnClose);
  setWindowTitle(tr("Item Details - %1").arg(as.name));
  ui->typePixmapLabel->setPixmap(*getTypePixmap64(typeId));
  ui->typeNameLabel->setText(QString("<h2>%1</h2>").arg(as.name));
  ui->horizontalLayout->setAlignment(ui->verticalLayout_2, Qt::AlignTop);
  initDescriptionTab();
  initAttributeTree();
  initSkillRequirementTree();
  initVariationTree();
  fillTabs();
}

void ItemDetailsWidget::initDescriptionTab()
{
  descriptionTab = new QTextEdit();
{'fraction_non_alphanumeric': 0.14799865455768585, 'fraction_numerical': 0.004709048099562731, 'mean_word_length': 6.994623655913978, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 47, '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': '2058817', 'n_tokens_mistral': 1013, 'n_tokens_neox': 1013, 'n_words': 179}