diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-10-14 09:44:41 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-10-14 09:44:41 (GMT) |
commit | 114618fc6b05d3deba5cd5f84a5959cc33529eed (patch) | |
tree | 50686415121905e03ea67845e1b3a9129b12db4e | |
parent | 16fadaacd61b9a509a4c2157746331ceab206de8 (diff) |
Clifford Wolf:
Improved status bar handling
git-svn-id: http://svn.clifford.at/openscad/trunk@101 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r-- | glview.cc | 7 | ||||
-rw-r--r-- | mainwin.cc | 5 | ||||
-rw-r--r-- | openscad.h | 3 |
3 files changed, 9 insertions, 6 deletions
@@ -23,7 +23,6 @@ #include <QApplication> #include <QWheelEvent> #include <QMouseEvent> -#include <QStatusBar> #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); } } @@ -33,6 +33,7 @@ #include <QVBoxLayout> #include <QLabel> #include <QFileInfo> +#include <QStatusBar> //for chdir #include <unistd.h> @@ -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); @@ -35,6 +35,7 @@ #include <QLineEdit> #include <QGLWidget> #include <QPointer> +#include <QLabel> #include <QTimer> #include <stdio.h> @@ -659,7 +660,7 @@ public: double w_h_ratio; GLint shaderinfo[11]; - QStatusBar *statusBar; + QLabel *statusLabel; GLView(QWidget *parent = NULL); |