Commit 895e1508 authored by Jan Möbius's avatar Jan Möbius

Dennis: Send-signal-instead-of-setting-active-Examiner-directly

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6655 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4408c273
......@@ -226,7 +226,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
glViewer* examinerWidget = new glViewer(glScene_,
glWidget_,
PluginFunctions::viewerProperties(0),
0,
centerWidget_,
"Examiner Widget",
statusBar_);
......@@ -245,7 +244,6 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
glViewer* newWidget = new glViewer(glScene_,
glWidget_,
PluginFunctions::viewerProperties(i),
i,
centerWidget_,
"Examiner Widget",
statusBar_);
......@@ -291,6 +289,8 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
this, SLOT(dragEnterEvent(QDragEnterEvent* )));
connect( examiner_widgets_[i], SIGNAL(dropEvent( QDropEvent*)),
this, SLOT(dropEvent(QDropEvent* )));
connect (examiner_widgets_[i], SIGNAL(signalMakeActive ()),
this, SLOT(slotActivateExaminer()));
}
......@@ -884,6 +884,25 @@ CoreWidget::startVideoCaptureDialog(){
dialog->show();
}
//-----------------------------------------------------------------------------
void CoreWidget::slotActivateExaminer()
{
glViewer* examiner = dynamic_cast<glViewer*>(QObject::sender());
if (!examiner)
return;
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
if (examiner == examiner_widgets_[i])
{
PluginFunctions::setActiveExaminer (i);
break;
}
}
}
//=============================================================================
......@@ -467,6 +467,11 @@ public:
void slotShowSceneGraphDialog();
/** Makes the sender examiner active
*/
void slotActivateExaminer ();
/** Display a log message in the Mainwidget
* @param _type Type of Message (OUT,WARN,ERR)
* @param _message The message to be displayed
......
......@@ -122,7 +122,6 @@ static const char VIEW_MAGIC[] =
glViewer::glViewer( QtGLGraphicsScene* _scene,
QGLWidget* _glWidget,
Viewer::ViewerProperties& _properties,
unsigned int _id,
QGraphicsWidget* _parent,
const char* /* _name */ ,
QStatusBar *_statusBar) :
......@@ -133,7 +132,6 @@ glViewer::glViewer( QtGLGraphicsScene* _scene,
blending_(true),
glScene_(_scene),
glWidget_(_glWidget),
id_(_id),
properties_(_properties),
glstate_(0)
{
......@@ -1444,7 +1442,7 @@ void glViewer::mousePressEvent(QGraphicsSceneMouseEvent* _e)
_e->buttons(), _e->modifiers());
_e->accept ();
PluginFunctions::setActiveExaminer (id_);
emit signalMakeActive();
glScene_->update ();
// right button pressed => popup menu (ignore here)
......@@ -1486,7 +1484,7 @@ void glViewer::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* _e)
_e->buttons(), _e->modifiers());
_e->accept ();
PluginFunctions::setActiveExaminer (id_);
emit signalMakeActive();
glScene_->update ();
switch (properties_.actionMode())
......
......@@ -122,7 +122,6 @@ public:
\param _parent parent widget
\param _name name (qt internal, qt debugging)
\param _properties viewerOptions controlled by PluginFunctions
\param _id examiner id
\param _statusBar pointer to an existing status bar for this widget,
if \c statusBar==0 then a \a private status bar will be created
\param _format OpenGL context settings, will be passed to glarea()
......@@ -130,7 +129,6 @@ public:
glViewer( QtGLGraphicsScene* _scene,
QGLWidget* _glWidget,
Viewer::ViewerProperties& _properties,
unsigned int _id,
QGraphicsWidget* _parent=0,
const char* _name=0,
QStatusBar *_statusBar=0);
......@@ -539,11 +537,6 @@ private:
// Base graphics widget layout
QtGLViewerLayout* glBaseLayout_;
// examiner id
unsigned int id_;
// vector of current draw mode actions
std::vector< QAction * > drawMenuActions_;
......@@ -580,6 +573,9 @@ private:
signals:
void viewUpdated();
/// make this widget active
void signalMakeActive ();
/** @} */
//===========================================================================
......
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