feat/vtk-3d-view #7

Merged
gaozheng merged 301 commits from feat/vtk-3d-view into main 2026-06-27 18:43:52 +08:00
4 changed files with 15 additions and 11 deletions
Showing only changes of commit 5d1cf07882 - Show all commits

View File

@ -69,6 +69,10 @@ QString svgPathFor(Glyph t)
return QStringLiteral(
"<path d='M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3"
"M21 16v3a2 2 0 0 1-2 2h-3M8 21H5a2 2 0 0 1-2-2v-3'/>");
case Glyph::ChevronLeft:
return QStringLiteral("<path d='m15 18-6-6 6-6'/>");
case Glyph::ChevronRight:
return QStringLiteral("<path d='m9 18 6-6-6-6'/>");
case Glyph::Workspace:
return QStringLiteral(
"<rect width='7' height='7' x='3' y='3' rx='1'/>"

View File

@ -27,6 +27,8 @@ enum class Glyph {
Download, // 导出/下载
Collapse, // 折叠(双箭头)
Fullscreen, // 全屏 / 最大化
ChevronLeft, // 折叠抽屉(向左)
ChevronRight, // 展开抽屉(向右)
// 顶部应用栏图标
Workspace, // 工作空间2x2 宫格)
Folder, // 项目(文件夹)

View File

@ -1251,14 +1251,6 @@ public:
int main(int argc, char* argv[])
{
#ifdef Q_OS_WIN
// Qt6 Windows 的 DirectWrite 字体数据库在本机枚举字体回退(fallbacksForFamily →
// populateFamily)时崩溃(0xc0000005见 logs/crash_*.dmp + geopro_*.log 栈):渲染后一次布局
// 重算 QPushButton sizeHint → 对按钮文字整形 → 主字体(YaHei)缺某字形(如三角符 ◀▶)触发回退 →
// DirectWrite 在本机抛 C++ 异常并最终段错误(登录/面板只用中文+拉丁YaHei 都有,故先前不崩)。
// 改用 GDI 字体引擎绕开有问题的 DirectWrite 回退路径(稳定优先,渲染质量略变)。须在 QApplication 前设置。
qputenv("QT_QPA_PLATFORM", "windows:fontengine=gdi");
#endif
// Qt WebEngine地图页签的 QWebEngineView必须在 QApplication 构造前初始化,
// 且需启用跨上下文共享 OpenGLQtWebEngine 与 QVTK 同进程共用 GL context避免黑屏/崩溃)。
// AA_ShareOpenGLContexts 须在 QApplication 之前设置QtWebEngineQuick::initialize() 同样须前置。

View File

@ -2,6 +2,7 @@
#include "panels/columns/Column3DDataset.hpp"
#include "panels/columns/Column2DDataset.hpp"
#include "panels/columns/Column3DAnalysis.hpp"
#include "Glyphs.hpp"
#include "Theme.hpp"
#include <QHBoxLayout>
#include <QPushButton>
@ -24,8 +25,12 @@ ColumnDrawer::ColumnDrawer(QWidget* parent)
tabs->addTab(col2D_, QStringLiteral("二维数据集"));
tabs->addTab(colAnalysis_, QStringLiteral("三维分析"));
// 折叠按钮:固定宽 18px垂直拉伸
toggleBtn_ = new QPushButton(QStringLiteral(""), this);
// 折叠按钮:固定宽 18px垂直拉伸。
// 用 SVG 图标(makeGlyph)而非 ◀/▶ 文字——三角符(U+25C0/25B6)不在 YaHei作按钮文字会触发
// Qt 字体回退,本机 DirectWrite 在回退枚举时崩(0xc0000005)。SVG 图标走 QIcon 不做字体整形,规避之。
toggleBtn_ = new QPushButton(this);
toggleBtn_->setIcon(geopro::app::makeGlyph(Glyph::ChevronLeft,
geopro::app::tokenColor("text/secondary"), 14));
toggleBtn_->setFixedWidth(18);
toggleBtn_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
toggleBtn_->setCursor(Qt::PointingHandCursor);
@ -51,7 +56,8 @@ void ColumnDrawer::toggleCollapsed()
{
collapsed_ = !collapsed_;
body_->setVisible(!collapsed_);
toggleBtn_->setText(collapsed_ ? QStringLiteral("") : QStringLiteral(""));
toggleBtn_->setIcon(geopro::app::makeGlyph(collapsed_ ? Glyph::ChevronRight : Glyph::ChevronLeft,
geopro::app::tokenColor("text/secondary"), 14));
// 折叠后只保留按钮宽度;展开恢复上限
setMaximumWidth(collapsed_ ? 18 : 318);
}