From f49d27216e6ed855fef440d2e8b15c556af6dc37 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Sun, 9 Mar 2014 20:30:13 -0700 Subject: [PATCH] Print loading as text over opengl window --- src/canvas.cpp | 1 + src/window.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/canvas.cpp b/src/canvas.cpp index 98c0a29..91db4d7 100644 --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -62,6 +62,7 @@ void Canvas::paintEvent(QPaintEvent *event) if (mesh) draw_mesh(); QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); if (!status.isNull()) painter.drawText(10, height() - 10, status); } diff --git a/src/window.cpp b/src/window.cpp index 338ddd0..ebb4b70 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -70,16 +70,24 @@ void Window::on_about() void Window::load_stl(const QString &filename) { + canvas->set_status("Loading " + filename); + Loader* loader = new Loader(this, filename); connect(loader, &Loader::started, [=](){ open_action->setEnabled(false); }); + connect(loader, &Loader::got_mesh, canvas, &Canvas::load_mesh); + connect(loader, &Loader::finished, loader, &Loader::deleteLater); connect(loader, &Loader::finished, [=](){ open_action->setEnabled(true); }); + connect(loader, &Loader::finished, + [=](){ canvas->set_status(""); }); + connect(loader, &Loader::loaded_file, this, &Window::setWindowTitle); + loader->start(); } -- 2.39.5