Skip to content
Snippets Groups Projects
Commit d468a0c8 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Merge branch 'corr' into 'develop'

clang-format

See merge request !368
parents 372c3aea 88819f1f
No related branches found
No related tags found
1 merge request!368clang-format
Pipeline #45861 canceled
...@@ -22,27 +22,27 @@ ...@@ -22,27 +22,27 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// Get the default name for an instrument (i.e. the name a newly created instrument should get) /// Get the default name for an instrument (i.e. the name a newly created instrument should get)
template<typename T> const QString defaultInstrumentName() template <typename T> const QString defaultInstrumentName()
{ {
return "Untitled"; return "Untitled";
} }
template<> const QString defaultInstrumentName<SpecularInstrumentItem>() template <> const QString defaultInstrumentName<SpecularInstrumentItem>()
{ {
return "Specular"; return "Specular";
} }
template<> const QString defaultInstrumentName<DepthProbeInstrumentItem>() template <> const QString defaultInstrumentName<DepthProbeInstrumentItem>()
{ {
return "DepthProbe"; return "DepthProbe";
} }
template<> const QString defaultInstrumentName<GISASInstrumentItem>() template <> const QString defaultInstrumentName<GISASInstrumentItem>()
{ {
return "GISAS"; return "GISAS";
} }
template<> const QString defaultInstrumentName<OffSpecularInstrumentItem>() template <> const QString defaultInstrumentName<OffSpecularInstrumentItem>()
{ {
return "OffSpecular"; return "OffSpecular";
} }
......
...@@ -48,8 +48,7 @@ public: ...@@ -48,8 +48,7 @@ public:
QModelIndex copyInstrument(const InstrumentItem* source); QModelIndex copyInstrument(const InstrumentItem* source);
private: private:
template <class Instrument> QModelIndex addNewInstrument();
template<class Instrument> QModelIndex addNewInstrument();
private: private:
InstrumentModel* m_instruments; InstrumentModel* m_instruments;
......
...@@ -71,15 +71,13 @@ InstrumentListView::InstrumentListView(ProjectDocument* document, QWidget* paren ...@@ -71,15 +71,13 @@ InstrumentListView::InstrumentListView(ProjectDocument* document, QWidget* paren
m_newSpecularAction = new QAction("New specular", this); m_newSpecularAction = new QAction("New specular", this);
m_newSpecularAction->setIcon(QIcon(":/images/shape-square-plus.svg")); m_newSpecularAction->setIcon(QIcon(":/images/shape-square-plus.svg"));
m_newSpecularAction->setToolTip("Add new specular instrument with default settings"); m_newSpecularAction->setToolTip("Add new specular instrument with default settings");
connect(m_newSpecularAction, &QAction::triggered, this, connect(m_newSpecularAction, &QAction::triggered, this, &InstrumentListView::onNewSpecular);
&InstrumentListView::onNewSpecular);
addAction(m_newSpecularAction); addAction(m_newSpecularAction);
m_newDepthProbeAction = new QAction("New depth probe", this); m_newDepthProbeAction = new QAction("New depth probe", this);
m_newDepthProbeAction->setIcon(QIcon(":/images/shape-square-plus.svg")); m_newDepthProbeAction->setIcon(QIcon(":/images/shape-square-plus.svg"));
m_newDepthProbeAction->setToolTip("Add new depth probe instrument with default settings"); m_newDepthProbeAction->setToolTip("Add new depth probe instrument with default settings");
connect(m_newDepthProbeAction, &QAction::triggered, this, connect(m_newDepthProbeAction, &QAction::triggered, this, &InstrumentListView::onNewDepthProbe);
&InstrumentListView::onNewDepthProbe);
addAction(m_newDepthProbeAction); addAction(m_newDepthProbeAction);
m_separatorAction1 = new QAction(this); m_separatorAction1 = new QAction(this);
...@@ -141,11 +139,10 @@ QSize InstrumentListView::minimumSizeHint() const ...@@ -141,11 +139,10 @@ QSize InstrumentListView::minimumSizeHint() const
QList<QAction*> InstrumentListView::toolbarActions() const QList<QAction*> InstrumentListView::toolbarActions() const
{ {
return {m_newGisasAction, m_newOffSpecularAction, return {m_newGisasAction, m_newOffSpecularAction, m_newSpecularAction,
m_newSpecularAction, m_newDepthProbeAction, m_newDepthProbeAction, m_separatorAction1, m_removeAction,
m_separatorAction1, m_removeAction, m_copyAction, m_separatorAction2, m_storeInLibraryAction,
m_copyAction, m_separatorAction2, m_loadFromLibraryAction};
m_storeInLibraryAction, m_loadFromLibraryAction};
} }
void InstrumentListView::updateSelectedInstrument() void InstrumentListView::updateSelectedInstrument()
......
...@@ -44,8 +44,8 @@ InstrumentView::InstrumentView(QWidget* parent, ProjectDocument* document) ...@@ -44,8 +44,8 @@ InstrumentView::InstrumentView(QWidget* parent, ProjectDocument* document)
connect(m_instrumentListView, &InstrumentListView::instrumentSelected, this, connect(m_instrumentListView, &InstrumentListView::instrumentSelected, this,
&InstrumentView::onInstrumentSelected); &InstrumentView::onInstrumentSelected);
connect(m_instrumentEditor, &InstrumentEditor::instrumentNameChanged, connect(m_instrumentEditor, &InstrumentEditor::instrumentNameChanged, m_instrumentListView,
m_instrumentListView, &InstrumentListView::updateSelectedInstrument); &InstrumentListView::updateSelectedInstrument);
onInstrumentSelected(nullptr); onInstrumentSelected(nullptr);
} }
......
...@@ -172,12 +172,12 @@ void ResolutionFunctionEditor::onResolutionFunctionSelected(int index) ...@@ -172,12 +172,12 @@ void ResolutionFunctionEditor::onResolutionFunctionSelected(int index)
{ {
if (m_item && index != -1) { if (m_item && index != -1) {
const QString res_type = m_combo->currentData().toString(); const QString res_type = m_combo->currentData().toString();
if (res_type == ResolutionFunctionNoneItem::M_TYPE) { if (res_type == ResolutionFunctionNoneItem::M_TYPE) {
m_item->setResolutionFunctionType<ResolutionFunctionNoneItem>(); m_item->setResolutionFunctionType<ResolutionFunctionNoneItem>();
m_stack->setCurrentWidget(m_blankForm); m_stack->setCurrentWidget(m_blankForm);
} else { } else {
m_gaussForm->setItem m_gaussForm->setItem(
(m_item->setResolutionFunctionType<ResolutionFunction2DGaussianItem>()); m_item->setResolutionFunctionType<ResolutionFunction2DGaussianItem>());
m_stack->setCurrentWidget(m_gaussForm); m_stack->setCurrentWidget(m_gaussForm);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment