qvolray

changeset 14:88312413467c

adding a sidewidget
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 10 Apr 2012 06:35:34 +0300
parents 17d9dc2edc91
children a2080cc27ebc
files src/ui.cc src/ui.h
diffstat 2 files changed, 23 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/src/ui.cc	Tue Apr 10 06:11:16 2012 +0300
     1.2 +++ b/src/ui.cc	Tue Apr 10 06:35:34 2012 +0300
     1.3 @@ -14,6 +14,12 @@
     1.4  	glview = new GLView;
     1.5  	setCentralWidget(glview);
     1.6  
     1.7 +	// side-window
     1.8 +	sidewin = new SideWindow;
     1.9 +	sidewin->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    1.10 +	sidewin->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
    1.11 +	addDockWidget(Qt::LeftDockWidgetArea, sidewin);
    1.12 +
    1.13  	// actions
    1.14  	QAction *act_open = new QAction(qApp->style()->standardIcon(QStyle::SP_DialogOpenButton), "&Open...", this);
    1.15  	act_open->setStatusTip("Open a volume dataset");
    1.16 @@ -53,6 +59,12 @@
    1.17  	}
    1.18  }
    1.19  
    1.20 +
    1.21 +SideWindow::SideWindow()
    1.22 +{
    1.23 +}
    1.24 +
    1.25 +
    1.26  void post_redisplay()
    1.27  {
    1.28  	glview->updateGL();
    1.29 @@ -79,7 +91,6 @@
    1.30  	if(!volray_init()) {
    1.31  		exit(0);
    1.32  	}
    1.33 -	glClearColor(1, 0, 0, 1);
    1.34  }
    1.35  
    1.36  void GLView::resizeGL(int xsz, int ysz)
     2.1 --- a/src/ui.h	Tue Apr 10 06:11:16 2012 +0300
     2.2 +++ b/src/ui.h	Tue Apr 10 06:35:34 2012 +0300
     2.3 @@ -2,13 +2,18 @@
     2.4  #define UI_H_
     2.5  
     2.6  #include <QMainWindow>
     2.7 +#include <QDockWidget>
     2.8  #include <QGLWidget>
     2.9  #include "volray.h"
    2.10  
    2.11  class GLView;
    2.12 +class SideWindow;
    2.13  
    2.14  class MainWindow : public QMainWindow {
    2.15  	Q_OBJECT
    2.16 +private:
    2.17 +	SideWindow *sidewin;
    2.18 +
    2.19  private slots:
    2.20  	void open_volume();
    2.21  
    2.22 @@ -16,6 +21,12 @@
    2.23  	MainWindow();
    2.24  };
    2.25  
    2.26 +class SideWindow : public QDockWidget {
    2.27 +	Q_OBJECT
    2.28 +public:
    2.29 +	SideWindow();
    2.30 +};
    2.31 +
    2.32  class GLView : public QGLWidget {
    2.33  	Q_OBJECT
    2.34