Mantid
Loading...
Searching...
No Matches
ImageInfoWidgetMini.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2022 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7
10
11#include <QAbstractScrollArea>
12#include <QHeaderView>
13
15
21 : QLabel(parent), m_presenter(std::make_unique<ImageInfoPresenter>(this)) {}
22
29void ImageInfoWidgetMini::cursorAt(const double x, const double y, const double signal,
30 const QMap<QString, QString> &extraValues) {
31 m_presenter->cursorAt(x, y, signal, extraValues);
32}
33
39 if (info.empty())
40 return;
41 auto text = QString{};
42
43 if (!info.value(0).isEmpty() && info.value(0) != "-") {
44 text += info.name(0) + "=" + info.value(0) + ", "; // TOF
45 text += info.name(1) + "=" + info.value(1) + ", "; // Spectrum
46 text += info.name(2) + "=" + info.value(2); // Signal
47 }
48
49 setText(text);
50}
51
57
58void ImageInfoWidgetMini::setRowCount(const int /*count*/) {}
59void ImageInfoWidgetMini::setColumnCount(const int /*count*/) {}
60void ImageInfoWidgetMini::setItem(const int /*rowIndex*/, const int /*columnIndex*/, QTableWidgetItem * /*item*/) {}
61void ImageInfoWidgetMini::hideColumn(const int /*index*/) {}
62void ImageInfoWidgetMini::showColumn(const int /*index*/) {}
63
64} // namespace MantidQt::MantidWidgets
const QString & value(int index) const noexcept
const QString & name(int index) const noexcept
A table widget containing information about the pixel the mouse is over in an image.
std::unique_ptr< ImageInfoPresenter > m_presenter
void cursorAt(const double x, const double y, const double signal, const QMap< QString, QString > &extraValues) override
ImageInfoWidgetMini(QWidget *parent=nullptr)
Constructor.
void setWorkspace(const Mantid::API::Workspace_sptr &ws) override
Set the workspace to probe for information.
void setItem(const int rowIndex, const int columnIndex, QTableWidgetItem *item) override
void showInfo(const ImageInfoModel::ImageInfo &info) override
Display the information provided within the table cells.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
STL namespace.