]> git.sur5r.net Git - fstl/commitdiff
Print loading as text over opengl window
authorMatt Keeter <matt.j.keeter@gmail.com>
Mon, 10 Mar 2014 03:30:13 +0000 (20:30 -0700)
committerMatt Keeter <matt.j.keeter@gmail.com>
Mon, 10 Mar 2014 03:30:13 +0000 (20:30 -0700)
src/canvas.cpp
src/window.cpp

index 98c0a296247617b3ba93a504f527dee2caa96b69..91db4d71ebd33ae83e9dfd6fcf6606408c54627b 100644 (file)
@@ -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);
 }
index 338ddd04d3cd1061116dbbba1ac0ba0f7adf7d7c..ebb4b70020731c0f5efdb6f524ebb21d63861738 100644 (file)
@@ -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();
 }