Skip to content
Snippets Groups Projects
Commit 05e020f7 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Standard code beautification in ProjectionsEditor.

parent 7ad98e22
No related branches found
No related tags found
No related merge requests found
......@@ -23,12 +23,8 @@
#include "minisplitter.h"
#include "SessionModel.h"
#include "IntensityDataItem.h"
#include "MaskEditorFlags.h"
#include "MaskGraphicsScene.h"
#include <QItemSelectionModel>
#include <QSplitter>
#include <QVBoxLayout>
#include <QHBoxLayout>
ProjectionsEditor::ProjectionsEditor(QWidget* parent)
: QMainWindow(parent)
......@@ -90,32 +86,32 @@ QList<QAction*> ProjectionsEditor::topToolBarActions()
void ProjectionsEditor::setup_connections()
{
// tool panel request is propagated from editorActions to this MaskEditor
connect(m_editorActions, SIGNAL(resetViewRequest()),
m_projectionsCanvas, SLOT(onResetViewRequest()));
connect(m_editorActions, &ProjectionsEditorActions::resetViewRequest,
m_projectionsCanvas, &ProjectionsEditorCanvas::onResetViewRequest);
// tool panel request is propagated from editorActions to this MaskEditor
connect(m_editorActions, &ProjectionsEditorActions::propertyPanelRequest,
[=](){m_propertyPanel->setHidden(!m_propertyPanel->isHidden());});
// selection/drawing activity is propagated from ToolBar to graphics scene
connect(m_toolBar, SIGNAL(activityModeChanged(MaskEditorFlags::Activity)),
m_projectionsCanvas, SLOT(onActivityModeChanged(MaskEditorFlags::Activity)));
connect(m_toolBar, &ProjectionsToolBar::activityModeChanged,
m_projectionsCanvas, &ProjectionsEditorCanvas::onActivityModeChanged);
// selection/drawing activity is propagated from ToolBar to Projections Widget
connect(m_toolBar, SIGNAL(activityModeChanged(MaskEditorFlags::Activity)),
m_projectionsWidget, SLOT(onActivityModeChanged(MaskEditorFlags::Activity)));
connect(m_toolBar, &ProjectionsToolBar::activityModeChanged,
m_projectionsWidget, &ProjectionsWidget::onActivityModeChanged);
// Delete request is propagated from canvas to actions
connect(m_projectionsCanvas, SIGNAL(deleteSelectedRequest()),
m_editorActions, SLOT(onDeleteAction()));
connect(m_projectionsCanvas, &ProjectionsEditorCanvas::deleteSelectedRequest,
m_editorActions, &ProjectionsEditorActions::onDeleteAction);
// space bar push (request for zoom mode) is propagated from graphics view to ToolBar
connect(m_projectionsCanvas, SIGNAL(changeActivityRequest(MaskEditorFlags::Activity)),
m_toolBar, SLOT(onChangeActivityRequest(MaskEditorFlags::Activity)));
connect(m_projectionsCanvas, &ProjectionsEditorCanvas::changeActivityRequest,
m_toolBar, &ProjectionsToolBar::onChangeActivityRequest);
// ColorMap margins changed, canvas -> projection widget
connect(m_projectionsCanvas, SIGNAL(marginsChanged(double,double)),
m_projectionsWidget, SLOT(onMarginsChanged(double,double)));
connect(m_projectionsCanvas, &ProjectionsEditorCanvas::marginsChanged,
m_projectionsWidget, &ProjectionsWidget::onMarginsChanged);
m_toolBar->onChangeActivityRequest(MaskEditorFlags::HORIZONTAL_LINE_MODE);
}
......@@ -40,23 +40,23 @@ class BA_CORE_API_ ProjectionsEditor : public QMainWindow
Q_OBJECT
public:
ProjectionsEditor(QWidget* parent = 0);
ProjectionsEditor(QWidget* parent = nullptr);
void setContext(SessionModel* model, const QModelIndex& shapeContainerIndex,
IntensityDataItem* intensityItem);
void resetContext();
QList<QAction *> topToolBarActions();
QList<QAction*> topToolBarActions();
private:
void setup_connections();
ProjectionsEditorActions* m_editorActions;
ProjectionsToolBar* m_toolBar; //! main tool bar with bottoms at the right
ProjectionsToolBar* m_toolBar; //! main tool bar with bottoms at the right
ProjectionsEditorCanvas* m_projectionsCanvas; //! canvas with color map at the top
ProjectionsWidget* m_projectionsWidget; //! bottom widget to draw projections plot
ProjectionsPropertyPanel* m_propertyPanel; //! pannel at the right with properties
ProjectionsWidget* m_projectionsWidget; //! bottom widget to draw projections plot
ProjectionsPropertyPanel* m_propertyPanel; //! pannel at the right with properties
QItemSelectionModel* m_selectionModel;
Manhattan::MiniSplitter* m_rightSplitter;
QSplitter* m_bottomSplitter;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment