除了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> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <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>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <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> </PropertyGroup>
</Project> </Project>

View File

@ -149,6 +149,11 @@ void AddApp::broswer_exe(){
} }
void AddApp::submit() { void AddApp::submit() {
if(sort->text().toInt()<10||sort->text().toInt()>100)
{
QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("排序必须在10-100之间"));
return;
}
if (isEdit) if (isEdit)
{ {
QString name_str_old = name_str; 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) if(software_ok&&app_ok)
{ {
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("更新成功")); QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("更新成功"));
emit refresh(); emit refresh_tab();
} }
else else
{ {
QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("更新部分或全部失败,全名是否重名?")); QMessageBox::critical(this, QString::fromLocal8Bit("错误"), QString::fromLocal8Bit("更新部分或全部失败,全名是否重名?"));
} }
}else if(func=="app_category") }else if(func=="app_category")
{ {
AddCategory add_category; AddCategory add_category;

View File

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

View File

@ -932,7 +932,14 @@ bool SQLiteHelper::get_software(QList<ButtonStruct>* button_structs, ConfigRespo
} }
while (query.next()) 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; ButtonStruct button_struct;
button_struct.path = query.value("path").toString(); button_struct.path = query.value("path").toString();
button_struct.text = query.value("name").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(); QByteArray svg_buffer = file.readAll();
file.close(); 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); QPainter painter_image(image);
painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布 painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布
painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色 painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色
painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值 painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值
render_image->render(&painter_image); render_image->render(&painter_image);
//修改颜色 //修改颜色
QDomDocument doc;
doc.setContent(svg_buffer); doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color); SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color);
QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray()); 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(); QByteArray svg_buffer = file.readAll();
file.close(); 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); QPainter painter_image(image);
painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布 painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布
painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色 painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色
painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值 painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值
render_image->render(&painter_image); render_image->render(&painter_image);
//修改颜色 //修改颜色
QDomDocument doc;
doc.setContent(svg_buffer); doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color); SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color);
QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray()); 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(); QByteArray svg_buffer = file.readAll();
file.close(); 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); QPainter painter_image(image);
painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布 painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布
painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色 painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色
painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值 painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值
render_image->render(&painter_image); render_image->render(&painter_image);
//修改颜色 //修改颜色
QDomDocument doc;
doc.setContent(svg_buffer); doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color); SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color);
QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray()); 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(); QByteArray svg_buffer = file.readAll();
file.close(); 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); QPainter painter_image(image);
painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布 painter_image.setCompositionMode(QPainter::CompositionMode_Clear); // 清除画布
painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色 painter_image.fillRect(image->rect(), Qt::transparent); // 填充透明色
painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值 painter_image.setCompositionMode(QPainter::CompositionMode_SourceOver); // 恢复默认值
render_image->render(&painter_image); render_image->render(&painter_image);
//修改颜色 //修改颜色
QDomDocument doc;
doc.setContent(svg_buffer); doc.setContent(svg_buffer);
SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color); SetSVGBackColor(doc.documentElement(), "path", "fill", title_cover_color);
QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray()); QSvgRenderer* render_image_cover = new QSvgRenderer(doc.toByteArray());
@ -1174,8 +1189,6 @@ bool SQLiteHelper::update_app()
categories[INNER - 1] = true; categories[INNER - 1] = true;
update_total(); update_total();
} }
} }
} }
work.exec("commit;"); work.exec("commit;");