Mantid
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::FitScriptGeneratorDataTable Class Reference

This class represents the table widget which holds domain data for the FitScriptGenerator interface. More...

#include <FitScriptGeneratorDataTable.h>

Inheritance diagram for MantidQt::MantidWidgets::FitScriptGeneratorDataTable:

Public Types

enum  ColumnIndex { WorkspaceName = 0 , WorkspaceIndex = 1 , StartX = 2 , EndX = 3 }
 

Signals

void itemExited (int newRowIndex)
 

Public Member Functions

void addDomain (QString const &workspaceName, MantidWidgets::WorkspaceIndex workspaceIndex, double startX, double endX)
 
std::vector< FitDomainIndexallRows () const
 
FitDomainIndex currentRow () const
 
double endX (FitDomainIndex row) const
 
 FitScriptGeneratorDataTable (QWidget *parent=nullptr)
 FitScriptGeneratorDataTable class methods. More...
 
void formatSelection ()
 
bool hasLoadedData () const
 
void removeDomain (MantidWidgets::FitDomainIndex domainIndex)
 
void renameWorkspace (QString const &workspaceName, QString const &newName)
 
void resetSelection ()
 
QString selectedDomainFunctionPrefix () const
 
std::vector< FitDomainIndexselectedRows () const
 
void setFunctionPrefixVisible (bool visible)
 
double startX (FitDomainIndex row) const
 
MantidWidgets::WorkspaceIndex workspaceIndex (FitDomainIndex row) const
 
std::string workspaceName (FitDomainIndex row) const
 
 ~FitScriptGeneratorDataTable ()=default
 

Private Slots

void handleItemClicked (QTableWidgetItem *item)
 
void handleItemSelectionChanged ()
 

Private Member Functions

bool eventFilter (QObject *widget, QEvent *event) override
 
QString getText (FitDomainIndex row, int column) const
 
QPersistentModelIndex hoveredRowIndex (QEvent *event)
 
void setSelectedXValue (double xValue)
 
void updateVerticalHeaders ()
 

Private Attributes

QPersistentModelIndex m_lastHoveredIndex
 
int m_selectedColumn
 
std::vector< FitDomainIndexm_selectedRows
 
double m_selectedValue
 

Detailed Description

This class represents the table widget which holds domain data for the FitScriptGenerator interface.

This table has four columns: Workspace Name, Workspace Index, Start X, End X.

This table has been manually created and derived from QTableWidget to allow the table rows to be highlighted when a hover event occurs.

Definition at line 37 of file FitScriptGeneratorDataTable.h.

Member Enumeration Documentation

◆ ColumnIndex

Enumerator
WorkspaceName 
WorkspaceIndex 
StartX 
EndX 

Definition at line 41 of file FitScriptGeneratorDataTable.h.

Constructor & Destructor Documentation

◆ FitScriptGeneratorDataTable()

MantidQt::MantidWidgets::FitScriptGeneratorDataTable::FitScriptGeneratorDataTable ( QWidget *  parent = nullptr)

◆ ~FitScriptGeneratorDataTable()

MantidQt::MantidWidgets::FitScriptGeneratorDataTable::~FitScriptGeneratorDataTable ( )
default

Member Function Documentation

◆ addDomain()

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::addDomain ( QString const &  workspaceName,
MantidWidgets::WorkspaceIndex  workspaceIndex,
double  startX,
double  endX 
)

◆ allRows()

std::vector< FitDomainIndex > MantidQt::MantidWidgets::FitScriptGeneratorDataTable::allRows ( ) const

Definition at line 185 of file FitScriptGeneratorDataTable.cpp.

References index.

◆ currentRow()

FitDomainIndex MantidQt::MantidWidgets::FitScriptGeneratorDataTable::currentRow ( ) const

Definition at line 209 of file FitScriptGeneratorDataTable.cpp.

References hasLoadedData(), and selectedRows().

◆ endX()

double MantidQt::MantidWidgets::FitScriptGeneratorDataTable::endX ( FitDomainIndex  row) const

Definition at line 181 of file FitScriptGeneratorDataTable.cpp.

References getText().

Referenced by addDomain().

◆ eventFilter()

bool MantidQt::MantidWidgets::FitScriptGeneratorDataTable::eventFilter ( QObject *  widget,
QEvent *  event 
)
overrideprivate

◆ formatSelection()

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::formatSelection ( )

◆ getText()

QString MantidQt::MantidWidgets::FitScriptGeneratorDataTable::getText ( FitDomainIndex  row,
int  column 
) const
private

◆ handleItemClicked

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::handleItemClicked ( QTableWidgetItem *  item)
privateslot

◆ handleItemSelectionChanged

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::handleItemSelectionChanged ( )
privateslot

Definition at line 135 of file FitScriptGeneratorDataTable.cpp.

References m_selectedRows, and selectedRows().

Referenced by FitScriptGeneratorDataTable().

◆ hasLoadedData()

bool MantidQt::MantidWidgets::FitScriptGeneratorDataTable::hasLoadedData ( ) const

Definition at line 218 of file FitScriptGeneratorDataTable.cpp.

Referenced by currentRow().

◆ hoveredRowIndex()

QPersistentModelIndex MantidQt::MantidWidgets::FitScriptGeneratorDataTable::hoveredRowIndex ( QEvent *  event)
private

Definition at line 158 of file FitScriptGeneratorDataTable.cpp.

References index, and m_lastHoveredIndex.

Referenced by eventFilter().

◆ itemExited

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::itemExited ( int  newRowIndex)
signal

Referenced by eventFilter().

◆ removeDomain()

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::removeDomain ( MantidWidgets::FitDomainIndex  domainIndex)

◆ renameWorkspace()

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::renameWorkspace ( QString const &  workspaceName,
QString const &  newName 
)

Definition at line 227 of file FitScriptGeneratorDataTable.cpp.

References workspaceName().

◆ resetSelection()

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::resetSelection ( )

Definition at line 285 of file FitScriptGeneratorDataTable.cpp.

References m_selectedValue, and setSelectedXValue().

◆ selectedDomainFunctionPrefix()

QString MantidQt::MantidWidgets::FitScriptGeneratorDataTable::selectedDomainFunctionPrefix ( ) const

Definition at line 220 of file FitScriptGeneratorDataTable.cpp.

References selectedRows(), and value.

◆ selectedRows()

std::vector< FitDomainIndex > MantidQt::MantidWidgets::FitScriptGeneratorDataTable::selectedRows ( ) const

◆ setFunctionPrefixVisible()

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::setFunctionPrefixVisible ( bool  visible)

Definition at line 287 of file FitScriptGeneratorDataTable.cpp.

◆ setSelectedXValue()

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::setSelectedXValue ( double  xValue)
private

Definition at line 291 of file FitScriptGeneratorDataTable.cpp.

References m_selectedColumn, m_selectedRows, and value.

Referenced by formatSelection(), and resetSelection().

◆ startX()

double MantidQt::MantidWidgets::FitScriptGeneratorDataTable::startX ( FitDomainIndex  row) const

Definition at line 177 of file FitScriptGeneratorDataTable.cpp.

References getText().

Referenced by addDomain().

◆ updateVerticalHeaders()

void MantidQt::MantidWidgets::FitScriptGeneratorDataTable::updateVerticalHeaders ( )
private

Definition at line 270 of file FitScriptGeneratorDataTable.cpp.

Referenced by removeDomain().

◆ workspaceIndex()

MantidWidgets::WorkspaceIndex MantidQt::MantidWidgets::FitScriptGeneratorDataTable::workspaceIndex ( FitDomainIndex  row) const

Definition at line 173 of file FitScriptGeneratorDataTable.cpp.

References getText().

Referenced by addDomain().

◆ workspaceName()

std::string MantidQt::MantidWidgets::FitScriptGeneratorDataTable::workspaceName ( FitDomainIndex  row) const

Definition at line 169 of file FitScriptGeneratorDataTable.cpp.

References getText().

Referenced by addDomain(), and renameWorkspace().

Member Data Documentation

◆ m_lastHoveredIndex

QPersistentModelIndex MantidQt::MantidWidgets::FitScriptGeneratorDataTable::m_lastHoveredIndex
private

Definition at line 90 of file FitScriptGeneratorDataTable.h.

Referenced by eventFilter(), and hoveredRowIndex().

◆ m_selectedColumn

int MantidQt::MantidWidgets::FitScriptGeneratorDataTable::m_selectedColumn
private

◆ m_selectedRows

std::vector<FitDomainIndex> MantidQt::MantidWidgets::FitScriptGeneratorDataTable::m_selectedRows
private

◆ m_selectedValue

double MantidQt::MantidWidgets::FitScriptGeneratorDataTable::m_selectedValue
private

Definition at line 89 of file FitScriptGeneratorDataTable.h.

Referenced by handleItemClicked(), and resetSelection().


The documentation for this class was generated from the following files: