#include "changelog.h" #include "ui_changelog.h" #include "modules/stylesheets.h" #include "modules/exceptions.h" Changelog::Changelog( const QFont& font, const QFont& tb_font, QWidget *parent ) : QWidget{ parent } , ui{ new Ui::Changelog } { this->ui->setupUi(this); this->setFont( font ); this->ui->tree_Versions->setFont( font ); this->ui->text_Logs->setFont( tb_font ); this->setStyleSheet( StyleSec::Changelog::getStyleSheet() ); } void Changelog::setTextFont( const QFont& font ) noexcept { this->ui->text_Logs->setFont( font ); } void Changelog::on_tree_Versions_itemClicked(QTreeWidgetItem* item, int index) { Q_UNUSED(index) static const QRegularExpression regex{ R"(^v[0-9]{1}\.[0-9]{2,2}$)" }; const QString version{ item->text(0) }; if ( ! regex.match( version ).hasMatch() ) { return; } QString content{ QStringLiteral(R"(

%1

") ); this->ui->text_Logs->setText( content ); }