Skip to content

Commit

Permalink
Merge pull request #94 from aglowacki/master
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
aglowacki authored Nov 12, 2024
2 parents 490e620 + 80fc624 commit 96934a1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ IF (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:$ORIGIN")
ENDIF()

IF (AVX2)
Expand Down
2 changes: 1 addition & 1 deletion src/mvc/MapsWorkspaceFilesWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void MapsWorkspaceFilesWidget::createLayout()

QLayout* vlayout = new QVBoxLayout();

_tab_widget->insertTab(0, _h5_tab_widget, "Analyized Data");
_tab_widget->insertTab(0, _h5_tab_widget, "Analyzed Data");
_tab_widget->insertTab(1, _mda_tab_widget, "Raw Data");
_tab_widget->insertTab(2, _vlm_tab_widget, "Light Microscope");

Expand Down
18 changes: 18 additions & 0 deletions src/mvc/SpectraWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <QIntValidator>
#include "preferences/Preferences.h"
#include <math.h>
#include <QToolTip>


//---------------------------------------------------------------------------
Expand Down Expand Up @@ -297,6 +298,8 @@ void SpectraWidget::append_spectra(QString name, const data_struct::ArrayTr<doub
{
_int_spec_max_x = energy->maxCoeff();
_int_spec_max_y = spectra->maxCoeff();
disconnect(series, &QLineSeries::hovered, this, &SpectraWidget::showIntSpecTooltip);
connect(series, &QLineSeries::hovered, this, &SpectraWidget::showIntSpecTooltip);
}

if(series == nullptr)
Expand Down Expand Up @@ -740,4 +743,19 @@ void SpectraWidget::set_top_axis(std::map < float, std::string> elements)
}
}

//---------------------------------------------------------------------------

void SpectraWidget::showIntSpecTooltip(const QPointF &point, bool state)
{
if (state)
{
const QRect r = {};
QToolTip::showText(QCursor::pos(), QString::number(point.x(), 'f', 2), nullptr, r, 100000);
}
else
{
QToolTip::hideText();
}
}

//---------------------------------------------------------------------------
1 change: 1 addition & 0 deletions src/mvc/SpectraWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public slots:

void set_log10(bool val);

void showIntSpecTooltip(const QPointF &point, bool state);
protected:

/**
Expand Down

0 comments on commit 96934a1

Please sign in to comment.