Mantid
Loading...
Searching...
No Matches
ImageInfoWidget.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 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#include <QTableWidget>
14
16
22 : QTableWidget(0, 0, parent), m_presenter(std::make_unique<ImageInfoPresenter>(this)) {
23 setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
24 setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
25 horizontalHeader()->hide();
26 verticalHeader()->hide();
27}
28
35void ImageInfoWidget::cursorAt(const double x, const double y, const double signal,
36 const QMap<QString, QString> &extraValues) {
37 m_presenter->cursorAt(x, y, signal, extraValues);
38}
39
45 m_presenter->fillTableCells(info);
46 horizontalHeader()->setMinimumSectionSize(50);
47 resizeColumnsToContents();
48}
49
55
56void ImageInfoWidget::setRowCount(const int count) { QTableWidget::setRowCount(count); }
57
58void ImageInfoWidget::setColumnCount(const int count) { QTableWidget::setColumnCount(count); }
59
60void ImageInfoWidget::setItem(const int rowIndex, const int columnIndex, QTableWidgetItem *item) {
61 QTableWidget::setItem(rowIndex, columnIndex, item);
62}
63
64void ImageInfoWidget::hideColumn(const int index) { QTableWidget::hideColumn(index); }
65
66void ImageInfoWidget::showColumn(const int index) { QTableWidget::showColumn(index); }
67
68// Set presenter flag for wether to show or hide the signal column
69void ImageInfoWidget::setShowSignal(const bool showSignal) { m_presenter->setShowSignal(showSignal); }
70
71} // namespace MantidQt::MantidWidgets
std::map< DeltaEMode::Type, std::string > index
int count
counter
Definition Matrix.cpp:37
A table widget containing information about the pixel the mouse is over in an image.
void cursorAt(const double x, const double y, const double signal, const QMap< QString, QString > &extraValues) override
void showColumn(const int index) override
void setRowCount(const int count) override
ImageInfoWidget(QWidget *parent=nullptr)
Constructor.
void setColumnCount(const int count) override
void setItem(const int rowIndex, const int columnIndex, QTableWidgetItem *item) override
void setWorkspace(const Mantid::API::Workspace_sptr &ws) override
Set the workspace to probe for information.
void showInfo(const ImageInfoModel::ImageInfo &info) override
Display the information provided within the table cells.
void setShowSignal(const bool showSignal)
std::unique_ptr< ImageInfoPresenter > m_presenter
void hideColumn(const int index) override
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
STL namespace.