Commit e4bbd82a authored by Jan Möbius's avatar Jan Möbius

Dennis: Don-t-draw-active-examiner-frame-in-single-view-mode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4754 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 76be6405
......@@ -110,9 +110,12 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
// Construct GL context & widget
baseLayout_ = new QtMultiViewLayout;
baseLayout_->setContentsMargins(0,0,0,0);
glWidget_ = new QGLWidget(format);
glView_ = new QtGLGraphicsView(stackedWidget_);
glScene_ = new QtGLGraphicsScene (&examiner_widgets_);
glScene_ = new QtGLGraphicsScene (&examiner_widgets_, baseLayout_);
// is stereo possible ?
if (format.stereo())
......@@ -123,8 +126,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
glView_->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
glView_->setScene(glScene_);
baseLayout_ = new QtMultiViewLayout;
baseLayout_->setContentsMargins(0,0,0,0);
centerWidget_ = new QGraphicsWidget;
glScene_->addItem(centerWidget_);
centerWidget_->setGeometry (glScene_->sceneRect ());
......
......@@ -42,6 +42,7 @@
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include "QtGLGraphicsScene.hh"
#include "QtMultiViewLayout.hh"
#include <OpenFlipper/widgets/glWidget/QtBaseViewer.hh>
#include <QApplication>
#include <QPainter>
......@@ -53,9 +54,11 @@
//== IMPLEMENTATION ===========================================================
QtGLGraphicsScene::QtGLGraphicsScene(std::vector< glViewer *> *_views) :
QtGLGraphicsScene::QtGLGraphicsScene(std::vector< glViewer *> *_views,
QtMultiViewLayout *_layout) :
QGraphicsScene (),
views_(_views)
views_(_views),
layout_(_layout)
{
}
......@@ -84,28 +87,28 @@ void QtGLGraphicsScene::drawBackground(QPainter *_painter, const QRectF &_rect)
views_->at(i)->paintGL();
}
int i = PluginFunctions::activeExaminer();
QPen pen(Qt::red);
pen.setWidth (2);
_painter->setPen(pen);
_painter->drawLine(views_->at(i)->scenePos().x(),
views_->at(i)->scenePos().y(),
views_->at(i)->scenePos().x(),
views_->at(i)->scenePos().y() + views_->at(i)->size().height() - 1);
_painter->drawLine(views_->at(i)->scenePos().x() + views_->at(i)->size().width(),
views_->at(i)->scenePos().y(),
views_->at(i)->scenePos().x() + views_->at(i)->size().width(),
views_->at(i)->scenePos().y() + views_->at(i)->size().height() - 1);
_painter->drawLine(views_->at(i)->scenePos().x(),
views_->at(i)->scenePos().y() - 1,
views_->at(i)->scenePos().x() + views_->at(i)->size().width(),
views_->at(i)->scenePos().y() - 1);
_painter->drawLine(views_->at(i)->scenePos().x(),
views_->at(i)->scenePos().y() + views_->at(i)->size().height() - 1,
views_->at(i)->scenePos().x() + views_->at(i)->size().width(),
views_->at(i)->scenePos().y() + views_->at(i)->size().height() - 1);
if (layout_->mode() != QtMultiViewLayout::SingleView)
{
glViewer *v = views_->at(PluginFunctions::activeExaminer());
QPen pen(Qt::red);
pen.setWidth (2);
_painter->setPen(pen);
_painter->drawLine(v->scenePos().x(), v->scenePos().y(),
v->scenePos().x(),
v->scenePos().y() + v->size().height() - 1);
_painter->drawLine(v->scenePos().x() + v->size().width(), v->scenePos().y(),
v->scenePos().x() + v->size().width(),
v->scenePos().y() + v->size().height() - 1);
_painter->drawLine(v->scenePos().x(), v->scenePos().y() - 1,
v->scenePos().x() + v->size().width(),
v->scenePos().y() - 1);
_painter->drawLine(v->scenePos().x(),
v->scenePos().y() + v->size().height() - 1,
v->scenePos().x() + v->size().width(),
v->scenePos().y() + v->size().height() - 1);
}
}
glViewer* QtGLGraphicsScene::findView (const QPointF &_p, bool _setActive)
......
......@@ -49,6 +49,7 @@
//== FORWARDDECLARATIONS ======================================================
class glViewer;
class QtMultiViewLayout;
//== NAMESPACES ===============================================================
......@@ -68,7 +69,7 @@ class DLLEXPORT QtGLGraphicsScene : public QGraphicsScene
Q_OBJECT
public:
QtGLGraphicsScene(std::vector< glViewer *> *_views);
QtGLGraphicsScene(std::vector< glViewer *> *_views, QtMultiViewLayout *_layout);
protected:
......@@ -85,6 +86,7 @@ private:
glViewer* findView (const QPointF &_p, bool _setActive = false);
std::vector< glViewer *> *views_;
QtMultiViewLayout *layout_;
};
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment