45 lines
1.6 KiB
C++
45 lines
1.6 KiB
C++
#include "xsteam_about_ui.h"
|
|
|
|
xsteam_about_ui::xsteam_about_ui()
|
|
{
|
|
m_widget=new QWidget();
|
|
m_Layout = new QVBoxLayout();
|
|
f_Layout =new QHBoxLayout();
|
|
copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved."));
|
|
info = new QTextEdit();
|
|
info->setReadOnly(true);
|
|
m_Layout->addWidget(info);
|
|
f_Layout->addItem(sparcer_item);
|
|
f_Layout->addWidget(copyright_tips_txt);
|
|
f_Layout->addItem(sparcer_item);
|
|
m_Layout->addLayout(f_Layout);
|
|
load_about();
|
|
setWindowTitle(tr("About XSteam"));
|
|
m_Layout->setContentsMargins(0, 0, 0, 0);
|
|
m_widget->setLayout(m_Layout);
|
|
layout()->addWidget(m_widget);
|
|
}
|
|
xsteam_about_ui::~xsteam_about_ui()
|
|
{
|
|
delete this;
|
|
}
|
|
void xsteam_about_ui::load_about()
|
|
{
|
|
QFile file(tr(":/res/txt/about.txt"));
|
|
if(file.open(QIODevice::ReadOnly | QIODevice::Text))
|
|
{
|
|
QString strs;
|
|
while(!file.atEnd())
|
|
{
|
|
QByteArray line = file.readLine();
|
|
strs.append(QString::fromStdString(line.data()));
|
|
}
|
|
strs.append(QString::fromStdString("编译环境")+"\n");
|
|
strs.append("qt_version:"+QString::fromStdString(QT_VERSION_STR)+"\n");
|
|
strs.append("gcc_version:"+QString::fromStdString(GCC_GXX_VERSION_STR)+"\n");
|
|
strs.append("g++_version:"+QString::fromStdString(GCC_GXX_VERSION_STR)+"\n");
|
|
strs.append("libcurl_version:"+QString::fromStdString(LIBCURL_VERSION_STR)+"\n");
|
|
strs.append("libgit2_version:"+QString::fromStdString(LIBGIT2_VERSION_STR)+"\n");
|
|
info->setPlainText(strs);
|
|
}
|
|
} |