除了win7的问题外全修复了

master
Mike Solar 2023-08-18 20:51:05 +08:00
parent b728e697fb
commit 5ec58b3bfb
6 changed files with 56 additions and 26 deletions

View File

@ -5,9 +5,9 @@
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<QtLastBackgroundBuild>2023-08-17T22:00:04.0470850Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-08-18T11:11:43.0072355Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<QtLastBackgroundBuild>2023-08-17T22:00:04.1224923Z</QtLastBackgroundBuild>
<QtLastBackgroundBuild>2023-08-18T11:11:44.6602281Z</QtLastBackgroundBuild>
</PropertyGroup>
</Project>

View File

@ -149,6 +149,11 @@ void AddApp::broswer_exe(){
}
void AddApp::submit() {
if(sort->text().toInt()<10||sort->text().toInt()>100)
{
QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("排序必须在10-100之间"));
return;
}
if (isEdit)
{
QString name_str_old = name_str;

View File

@ -172,12 +172,13 @@ void ApplicationManager::onclick1(QString op, QString func, QString path, QStrin
if(software_ok&&app_ok)
{
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("更新成功"));
emit refresh();
emit refresh_tab();
}
else
{
QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("更新部分或全部失败,全名是否重名?"));
}
}else if(func=="app_category")
{
AddCategory add_category;

View File

@ -1,4 +1,4 @@
//
//
// Created by HW on 2023/07/27.
//
@ -34,7 +34,7 @@ MainScreen::MainScreen(QWidget *parent) :
button->setStyleSheet("border-style:none;padding:10px;border-radius:5px;background-color:#09bb07;color:white;font-family:SimHei");
//Plus Math icon by Icons8
QString dir = QApplication::applicationDirPath();
button->setText(QString::fromLocal8Bit("打开微信"));
button->setText(QString::fromLocal8Bit("打开微信"));
//button->setStyleSheet("text-color:white");
layout = new QHBoxLayout;
miniblink = new QMiniBlink(this);
@ -80,31 +80,43 @@ MainScreen::~MainScreen() {
void MainScreen::firstUrl(QString url)
{
QString url_full;
if (url.contains("http"))
if (url.isEmpty())
{
url_full = url;
url_full = "";
}
else if (url.contains("?"))
{
url_full = BASE_URL + url + url_param;
emit changeUrl(url_full);
}
else
{
url_full = BASE_URL + url + url_param;
}
url_full = BASE_URL + url + "?" + url_param;
emit changeUrl(url_full);
}
}
void MainScreen::clickButton1(QString op,QString url) {
QString url_full;
if(url.contains("http"))
if (url.isEmpty())
{
url_full = url;
}else
url_full = "";
}
else if (url.contains("?"))
{
url_full = BASE_URL + url + url_param;
emit changeUrl(url_full);
}
else
{
url_full = BASE_URL + url + "?" + url_param;
emit changeUrl(url_full);
}
if (op == "openwechat") {
OpenWeChatRequest open_wechat_request;
QString msg = open_wechat_request.sendRequest();
if(msg!="ok")
{
QMessageBox::information(this, QString::fromLocal8Bit("提示"), msg);
QMessageBox::information(this, QString::fromLocal8Bit("提示"), msg);
return;
}
widget->setHidden(false);

View File

@ -162,8 +162,7 @@ RequestBodyBase::RequestBodyBase(){
obj_root.insert(QString::fromLocal8Bit("os_version"), os_version_json);
obj_root.insert(QString::fromLocal8Bit("sign"), sign_json);
qJsonDocument.setObject(obj_root);
url_param = "?";
url_param += "product=";
url_param = "&product=";
url_param += product;
url_param += "&partner_id=";
url_param += parter_id;

View File

@ -932,7 +932,14 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs, ConfigRespo
}
while (query.next())
{
QString icon = QApplication::applicationDirPath() + DEFAULT_SVG_PATH + query.value("orig_name").toString() + ".svg";
QString icon;
if(query.value("logo").toString().contains(":"))
{
icon = query.value("logo").toString();
}else
{
icon = QApplication::applicationDirPath() +query.value("logo").toString();
}
ButtonStruct button_struct;
button_struct.path = query.value("path").toString();
button_struct.text = query.value("name").toString();
@ -948,14 +955,16 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs, ConfigRespo
{
QByteArray svg_buffer = file.readAll();
file.close();
QSvgRenderer* render_image = new QSvgRenderer(svg_buffer);
QDomDocument doc;
doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_color);
QSvgRenderer* render_image = new QSvgRenderer(doc.toByteArray());
QPainter painter_image(image);
painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布
painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色
painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值
render_image->render(&painter_image);
//修改颜色
QDomDocument doc;
doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color);
QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray());
@ -976,14 +985,16 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs, ConfigRespo
{
QByteArray svg_buffer = file.readAll();
file.close();
QSvgRenderer* render_image = new QSvgRenderer(svg_buffer);
QDomDocument doc;
doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_color);
QSvgRenderer* render_image = new QSvgRenderer(doc.toByteArray());
QPainter painter_image(image);
painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布
painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色
painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值
render_image->render(&painter_image);
//修改颜色
QDomDocument doc;
doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color);
QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray());
@ -1038,14 +1049,16 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs,QString back
{
QByteArray svg_buffer = file.readAll();
file.close();
QSvgRenderer* render_image = new QSvgRenderer(svg_buffer);
QDomDocument doc;
doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_color);
QSvgRenderer* render_image = new QSvgRenderer(doc.toByteArray());
QPainter painter_image(image);
painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布
painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色
painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值
render_image->render(&painter_image);
//修改颜色
QDomDocument doc;
doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color);
QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray());
@ -1066,14 +1079,16 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs,QString back
{
QByteArray svg_buffer = file.readAll();
file.close();
QSvgRenderer* render_image = new QSvgRenderer(svg_buffer);
QDomDocument doc;
doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_color);
QSvgRenderer* render_image = new QSvgRenderer(doc.toByteArray());
QPainter painter_image(image);
painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布
painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色
painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值
render_image->render(&painter_image);
//修改颜色
QDomDocument doc;
doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color);
QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray());
@ -1174,8 +1189,6 @@ bool SQLiteHelper::update_app()
categories[INNER - 1] = true;
update_total();
}
}
}
work.exec("commit;");