From 114618fc6b05d3deba5cd5f84a5959cc33529eed Mon Sep 17 00:00:00 2001 From: clifford Date: Wed, 14 Oct 2009 09:44:41 +0000 Subject: Clifford Wolf: Improved status bar handling git-svn-id: http://svn.clifford.at/openscad/trunk@101 b57f626f-c46c-0410-a088-ec61d464b74c diff --git a/glview.cc b/glview.cc index 79a4246..338b839 100644 --- a/glview.cc +++ b/glview.cc @@ -23,7 +23,6 @@ #include #include #include -#include #define FAR_FAR_AWAY 100000.0 @@ -51,7 +50,7 @@ GLView::GLView(QWidget *parent) : QGLWidget(parent) for (int i = 0; i < 10; i++) shaderinfo[i] = 0; - statusBar = NULL; + statusLabel = NULL; setMouseTracking(true); } @@ -321,12 +320,12 @@ void GLView::paintGL() glEnd(); } - if (statusBar) { + if (statusLabel) { QString msg; msg.sprintf("Viewport: translate = [ %.2f %.2f %.2f ], rotate = [ %.2f %.2f %.2f ], distance = %.2f", -object_trans_x, -object_trans_y, -object_trans_z, fmodf(360 - object_rot_x + 90, 360), fmodf(360 - object_rot_y, 360), fmodf(360 - object_rot_z, 360), viewer_distance); - statusBar->showMessage(msg, 0); + statusLabel->setText(msg); } } diff --git a/mainwin.cc b/mainwin.cc index f62fa07..98e82f7 100644 --- a/mainwin.cc +++ b/mainwin.cc @@ -33,6 +33,7 @@ #include #include #include +#include //for chdir #include @@ -77,9 +78,11 @@ MainWindow::MainWindow(const char *filename) s2 = new QSplitter(Qt::Vertical, w1); l1->addWidget(s2); screen = new GLView(s2); - screen->statusBar = statusBar(); console = new QTextEdit(s2); + screen->statusLabel = new QLabel(this); + statusBar()->addWidget(screen->statusLabel); + QWidget *w2 = new QWidget(w1); QHBoxLayout *l2 = new QHBoxLayout(w2); l1->addWidget(w2); diff --git a/openscad.h b/openscad.h index 3c215a0..9539e04 100644 --- a/openscad.h +++ b/openscad.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -659,7 +660,7 @@ public: double w_h_ratio; GLint shaderinfo[11]; - QStatusBar *statusBar; + QLabel *statusLabel; GLView(QWidget *parent = NULL); -- cgit v0.10.1