mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 12:22:05 +08:00
Merge branch 'Thunder' of gitee.com:spark-store-project/spark-store into dev
Signed-off-by: shenmo <jifengshenmo@outlook.com>
This commit is contained in:
39
src/CMakeLists.txt
Normal file
39
src/CMakeLists.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
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)
|
||||
@@ -25,7 +25,6 @@ Application::Application(int &argc, char **argv)
|
||||
if (!DPlatformWindowHandle::pluginVersion().isEmpty()) {
|
||||
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true);
|
||||
}
|
||||
setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
setQuitOnLastWindowClosed(false); // 启用托盘图标时,关闭窗口程序仍然运行
|
||||
|
||||
|
||||
17
src/main.cpp
17
src/main.cpp
@@ -12,7 +12,6 @@
|
||||
#include <execinfo.h>
|
||||
|
||||
#include <DSysInfo>
|
||||
#include <DApplicationSettings>
|
||||
|
||||
#include <QDate>
|
||||
#include <QProcessEnvironment>
|
||||
@@ -147,13 +146,10 @@ int main(int argc, char *argv[])
|
||||
// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security");
|
||||
// 全平台软件渲染Webkit
|
||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-gpu");
|
||||
#ifdef __sw_64__
|
||||
#if defined (__sw_64__) || defined (__loongarch__)
|
||||
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 时黑屏闪烁
|
||||
@@ -163,15 +159,6 @@ 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];
|
||||
@@ -193,8 +180,6 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
DApplicationSettings settings; // 定义 DApplicationSettings,自动保存主题设置
|
||||
|
||||
MainWindow w;
|
||||
a.setMainWindow(&w); // 设置应用程序主窗口,用于初始化关于对话框
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ void SettingsPage::on_pushButton_updateServer_clicked()
|
||||
ui->comboBox_server->setCurrentIndex(0); });
|
||||
}
|
||||
|
||||
void SettingsPage::on_comboBox_server_currentIndexChanged(const QString &arg1)
|
||||
void SettingsPage::on_comboBox_server_currentTextChanged(const QString &arg1)
|
||||
{
|
||||
SparkAPI::setServerUrl(arg1); // 服务器信息更新
|
||||
qDebug() << arg1;
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
private slots:
|
||||
void on_pushButton_updateServer_clicked();
|
||||
|
||||
void on_comboBox_server_currentIndexChanged(const QString &arg1);
|
||||
void on_comboBox_server_currentTextChanged(const QString &arg1);
|
||||
|
||||
void on_pushButton_updateApt_clicked();
|
||||
|
||||
|
||||
18
src/src.cmake
Normal file
18
src/src.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
@@ -41,8 +41,7 @@ QString HttpRequest::postRequest(QString url, QString jsondata)
|
||||
QEventLoop eventLoop;
|
||||
connect(naManager, SIGNAL(finished(QNetworkReply *)), &eventLoop, SLOT(quit()));
|
||||
eventLoop.exec();
|
||||
QTextCodec *codec = QTextCodec::codecForName("utf8");
|
||||
QString strReply = codec->toUnicode(reply->readAll());
|
||||
QString strReply(reply->readAll());
|
||||
reply->deleteLater();
|
||||
return strReply;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QEventLoop>
|
||||
#include <QTextCodec>
|
||||
class HttpRequest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -17,7 +17,7 @@ big_image::big_image(DBlurEffectWidget *parent) : DBlurEffectWidget(parent),
|
||||
QHBoxLayout *layout = new QHBoxLayout;
|
||||
setLayout(layout);
|
||||
layout->addWidget(m_image);
|
||||
layout->setMargin(0);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
// Make sure the image has a parent so that it will be freed.
|
||||
m_image->setParent(this);
|
||||
|
||||
@@ -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()->setMargin(20);
|
||||
output_w->layout()->setContentsMargins(20, 20, 20, 20);
|
||||
output_w->layout()->addWidget(textbrowser);
|
||||
output_w->show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user