1 Star 0 Fork 13

Vic_Is_Genius/qte_2019_ncov

forked from whik/qte_2019_ncov 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
about.cpp 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
whik 提交于 2020-03-22 08:39 . 1.添加疫情最新动态显示
#include "about.h"
#include "ui_about.h"
//#include "windows.h"
#include <QDesktopServices>
#include <QDesktopWidget>
#include <QDebug>
about::about(QWidget *parent) :
QDialog(parent),
ui(new Ui::about)
{
ui->setupUi(this);
this->setWindowTitle("about");
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
// setLocation();
ui->tb_about->setOpenLinks(false);
connect(ui->tb_about, SIGNAL(anchorClicked(const QUrl&)), this, SLOT(anchorClickedSlot(const QUrl&)));
}
about::~about()
{
delete ui;
}
void about::anchorClickedSlot(const QUrl& url)
{
QDesktopServices::openUrl(url);
// ShellExecuteA(NULL, "open", url.toString().toStdString().c_str(), "", "", SW_SHOW);
}
void about::setLocation()
{
const QRect availableSize = QApplication::desktop()->availableGeometry(this);
qint32 DESKTOP_QT4 = 264199;
qint32 DESKTOP_QT5 = 329728;
qint32 ARM_IMX287 = 263939;
qint32 ARM_YA157C = 264199;
//output current qt version id
qDebug() << QT_VERSION;
//output current screen resolution ratio
qint16 width = availableSize.width();
qint16 height = availableSize.height();
qDebug() << "width: " << width << "height:" << height;
// if(QT_VERSION == ARM_IMX287)
// this->resize(width-5, height-15);
// else
if(QT_VERSION == ARM_IMX287)
this->resize(width/2, height);
qint16 loc_width = this->width();
qint16 loc_height = this->height();
qint16 loc_x = (width - loc_width) / 2;
qint16 loc_y = (height - loc_height) / 2;
qDebug() << "locx:" << loc_x << "locy" << loc_y;
// if(QT_VERSION == ARM_IMX287)
// this->move(0, 0);
// else
if(QT_VERSION == ARM_IMX287)
this->move(loc_x, loc_y);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/vic_is_genius/qte_2019_ncov.git
git@gitee.com:vic_is_genius/qte_2019_ncov.git
vic_is_genius
qte_2019_ncov
qte_2019_ncov
master

搜索帮助