From: Matt Keeter Date: Mon, 10 Mar 2014 03:30:13 +0000 (-0700) Subject: Print loading as text over opengl window X-Git-Tag: v0.9.0~25 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f49d27216e6ed855fef440d2e8b15c556af6dc37;p=fstl Print loading as text over opengl window --- 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(); }