update
This commit is contained in:
+11
-5
@@ -1,16 +1,22 @@
|
||||
#include "main_window/MainWindow.h"
|
||||
#include "app/AppStyle.h"
|
||||
|
||||
#include "core/image/ImageDecodeConfig.h"
|
||||
#include "core/large_image/VipsBackend.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QImageReader>
|
||||
#include <QStyleFactory>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName(QStringLiteral("landscape tool"));
|
||||
app.setStyle(QStyleFactory::create(QStringLiteral("Fusion")));
|
||||
app.setStyleSheet(gui::appStyleSheet());
|
||||
|
||||
// 全局放宽 Qt 图片分配限制(默认常见为 256MB),否则超大分辨率背景/深度可能在任意加载路径被拒绝。
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QImageReader::setAllocationLimit(1024); // MB
|
||||
#endif
|
||||
core::image_decode::prepareLargeImageReader();
|
||||
const char* av0 = (argc > 0 && argv[0]) ? argv[0] : "landscape_tool";
|
||||
core::VipsBackend::init(av0);
|
||||
qAddPostRoutine([]() { core::VipsBackend::shutdown(); });
|
||||
|
||||
MainWindow window;
|
||||
window.show();
|
||||
|
||||
Reference in New Issue
Block a user