Revert "Merge branch 'Thunder' of gitee.com:spark-store-project/spark-store into dev"

This reverts commit 5b018a4696.
This commit is contained in:
2024-10-07 15:17:47 +00:00
committed by Gitee
parent adbb2f2b11
commit 267eae076e
27 changed files with 120 additions and 223 deletions

View File

@@ -1,39 +0,0 @@
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Concurrent Network Svg WebEngineWidgets)
find_package(Dtk6 REQUIRED COMPONENTS Core Gui Widget)
include(src.cmake)
add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES} ${QRC_FILE})
target_include_directories(${PROJECT_NAME} PUBLIC
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Concurrent
Qt6::Network
Qt6::Svg
Qt6::WebEngineWidgets
Dtk6::Core
Dtk6::Gui
Dtk6::Widget
)
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Concurrent
Qt6::Network
Qt6::Svg
Qt6::WebEngineWidgets
Dtk6::Core
Dtk6::Gui
Dtk6::Widget
)
install(TARGETS ${PROJECT_NAME} DESTINATION /opt/durapps/${PROJECT_NAME}/bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/tool/ DESTINATION /opt/durapps/${PROJECT_NAME}/bin USE_SOURCE_PERMISSIONS)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pkg/lib/ DESTINATION /lib USE_SOURCE_PERMISSIONS)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pkg/tmp/ DESTINATION /tmp USE_SOURCE_PERMISSIONS)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pkg/usr/ DESTINATION ${CMAKE_INSTALL_PREFIX} USE_SOURCE_PERMISSIONS)

View File

@@ -25,6 +25,7 @@ Application::Application(int &argc, char **argv)
if (!DPlatformWindowHandle::pluginVersion().isEmpty()) {
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true);
}
setAttribute(Qt::AA_UseHighDpiPixmaps);
setQuitOnLastWindowClosed(false); // 启用托盘图标时,关闭窗口程序仍然运行

View File

@@ -12,6 +12,7 @@
#include <execinfo.h>
#include <DSysInfo>
#include <DApplicationSettings>
#include <QDate>
#include <QProcessEnvironment>
@@ -146,10 +147,13 @@ int main(int argc, char *argv[])
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security");
// 全平台软件渲染Webkit
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-gpu");
#if defined (__sw_64__) || defined (__loongarch__)
#ifdef __sw_64__
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
#endif
#ifdef __loongarch__
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
#endif
/**
* NOTE: https://zhuanlan.zhihu.com/p/550285855
* 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁
@@ -159,6 +163,15 @@ int main(int argc, char *argv[])
DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
}
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
// 开启 Hidpi 支持
qDebug() << "Enable HiDPI Support.";
DApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
DApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
// 强制使用 DTK 平台插件
QVector<char *> fakeArgs(argc + 2);
fakeArgs[0] = argv[0];
@@ -180,6 +193,8 @@ int main(int argc, char *argv[])
return -1;
}
DApplicationSettings settings; // 定义 DApplicationSettings自动保存主题设置
MainWindow w;
a.setMainWindow(&w); // 设置应用程序主窗口,用于初始化关于对话框

View File

@@ -134,7 +134,7 @@ void SettingsPage::on_pushButton_updateServer_clicked()
ui->comboBox_server->setCurrentIndex(0); });
}
void SettingsPage::on_comboBox_server_currentTextChanged(const QString &arg1)
void SettingsPage::on_comboBox_server_currentIndexChanged(const QString &arg1)
{
SparkAPI::setServerUrl(arg1); // 服务器信息更新
qDebug() << arg1;

View File

@@ -22,7 +22,7 @@ public:
private slots:
void on_pushButton_updateServer_clicked();
void on_comboBox_server_currentTextChanged(const QString &arg1);
void on_comboBox_server_currentIndexChanged(const QString &arg1);
void on_pushButton_updateApt_clicked();

View File

@@ -1,18 +0,0 @@
include_directories(backend)
include_directories(dbus)
include_directories(pages)
include_directories(utils)
include_directories(widgets)
# https://cmake.org/cmake/help/v3.12/command/file.html#glob-recurse
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
)
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/*.ui"
)
qt6_add_resources(QRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/assets/assets.qrc)

View File

@@ -41,7 +41,8 @@ QString HttpRequest::postRequest(QString url, QString jsondata)
QEventLoop eventLoop;
connect(naManager, SIGNAL(finished(QNetworkReply *)), &eventLoop, SLOT(quit()));
eventLoop.exec();
QString strReply(reply->readAll());
QTextCodec *codec = QTextCodec::codecForName("utf8");
QString strReply = codec->toUnicode(reply->readAll());
reply->deleteLater();
return strReply;
}

View File

@@ -6,6 +6,7 @@
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QEventLoop>
#include <QTextCodec>
class HttpRequest : public QObject
{
Q_OBJECT

View File

@@ -17,7 +17,7 @@ big_image::big_image(DBlurEffectWidget *parent) : DBlurEffectWidget(parent),
QHBoxLayout *layout = new QHBoxLayout;
setLayout(layout);
layout->addWidget(m_image);
layout->setContentsMargins(0, 0, 0, 0);
layout->setMargin(0);
// Make sure the image has a parent so that it will be freed.
m_image->setParent(this);

View File

@@ -158,7 +158,7 @@ void DownloadItem::on_pushButton_3_clicked()
output_w->setMinimumHeight(600);
output_w->setAttribute(Qt::WA_TranslucentBackground);
output_w->setTitle(ui->label->text());
output_w->layout()->setContentsMargins(20, 20, 20, 20);
output_w->layout()->setMargin(20);
output_w->layout()->addWidget(textbrowser);
output_w->show();
}