Mantid
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
PeriodicTableWidget Class Reference

PeriodicTableWidget: A Widget representing a colour coded Periodic Table of Elements, with corresponding buttons as the elements. More...

#include <PeriodicTableWidget.h>

Inheritance diagram for PeriodicTableWidget:

Public Member Functions

bool compareButtonNameToStr (QPushButton *buttonToCompare, const QString &stringToCompare)
 
void disableAllElementButtons ()
 Disables All buttons in periodicTableWidget. More...
 
void disableButtons (QVector< QPushButton * > buttons)
 Disables all buttons associated with a group. More...
 
QString elementsSelectedToString (const QVector< QPushButton * > &elementsSelected)
 
void enableButtonByName (const QString &elementStr)
 Enables a button for an element by the element name i.e 'Au' for Gold. More...
 
QString getAllCheckedElementsStr ()
 
QString getValue ()
 
 PeriodicTableWidget (QWidget *parent=nullptr)
 Constructor. More...
 
void showGroupLegend (bool checked)
 Displays or hides the Legend for the colour coding of periodic groups. More...
 
 ~PeriodicTableWidget () override
 Destructor. More...
 

Public Attributes

QVector< QPushButton * > Actinides
 
QVector< QPushButton * > AlkaliMetals
 
QVector< QPushButton * > AlkalineEarthMetals
 
QVector< QVector< QPushButton * > > AllElementButtons
 Vector to hold all group vectors for access to All Buttons at once. More...
 
QVector< QPushButton * > Halogens
 
QVector< QPushButton * > Lanthanides
 
QVector< QPushButton * > Metalloids
 
QVector< QPushButton * > NobleGases
 
QVector< QPushButton * > OtherNonMetals
 Vectors to Hold the QPushButtons of Elements in corresponding Groups. More...
 
QVector< QPushButton * > PostTransitionMetals
 
QVector< QPushButton * > TransitionMetals
 
QVector< QPushButton * > UnknownProperties
 

Private Member Functions

void ColourActinides (const QVector< QPushButton * > &actinides)
 
void ColourAlkaliMetals (const QVector< QPushButton * > &alkaliMetals)
 
void ColourAlkalineEarthMetals (const QVector< QPushButton * > &alkalineEarthMetals)
 
void ColourButton (QPushButton *elementButton, const QString &colour)
 Methods to colour single element button by setting styleSheet. More...
 
void ColourElements ()
 Colour all of the elements by calls to individual group colouring methods. More...
 
void ColourHalogens (const QVector< QPushButton * > &halogens)
 
void ColourLanthanides (const QVector< QPushButton * > &lanthanides)
 
void ColourMetalloids (const QVector< QPushButton * > &metalloids)
 
void ColourNobleGases (const QVector< QPushButton * > &nobleGases)
 
void ColourNonMetals (const QVector< QPushButton * > &nonMetals)
 Methods to colour element buttons by periodic group. More...
 
void ColourPostTransitionMetals (const QVector< QPushButton * > &postTransMetals)
 
void ColourTransitionMetals (const QVector< QPushButton * > &transMetals)
 
void ColourUnknownProperties (const QVector< QPushButton * > &unknownProperties)
 
void populateAllButtonsVector ()
 Method to populate Vector with all Group vectors. More...
 
void populateGroupVectors ()
 Method to populate Group Vectors with element QPushButtons. More...
 

Private Attributes

Ui::PeriodicTable ui
 The Form containing the PeriodicTableWidget. More...
 

Detailed Description

PeriodicTableWidget: A Widget representing a colour coded Periodic Table of Elements, with corresponding buttons as the elements.

Definition at line 19 of file PeriodicTableWidget.h.

Constructor & Destructor Documentation

◆ PeriodicTableWidget()

PeriodicTableWidget::PeriodicTableWidget ( QWidget *  parent = nullptr)

Constructor.

Default constructor.

Parameters
parent:: default parameter

Hide the legend by default

Definition at line 14 of file PeriodicTableWidget.cpp.

References ColourElements(), populateAllButtonsVector(), populateGroupVectors(), and ui.

◆ ~PeriodicTableWidget()

PeriodicTableWidget::~PeriodicTableWidget ( )
inlineoverride

Destructor.

Definition at line 26 of file PeriodicTableWidget.h.

Member Function Documentation

◆ ColourActinides()

void PeriodicTableWidget::ColourActinides ( const QVector< QPushButton * > &  actinides)
private

Definition at line 45 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourAlkaliMetals()

void PeriodicTableWidget::ColourAlkaliMetals ( const QVector< QPushButton * > &  alkaliMetals)
private

Definition at line 52 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourAlkalineEarthMetals()

void PeriodicTableWidget::ColourAlkalineEarthMetals ( const QVector< QPushButton * > &  alkalineEarthMetals)
private

Definition at line 59 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourButton()

void PeriodicTableWidget::ColourButton ( QPushButton *  elementButton,
const QString &  colour 
)
private

◆ ColourElements()

void PeriodicTableWidget::ColourElements ( )
private

◆ ColourHalogens()

void PeriodicTableWidget::ColourHalogens ( const QVector< QPushButton * > &  halogens)
private

Definition at line 66 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourLanthanides()

void PeriodicTableWidget::ColourLanthanides ( const QVector< QPushButton * > &  lanthanides)
private

Definition at line 73 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourMetalloids()

void PeriodicTableWidget::ColourMetalloids ( const QVector< QPushButton * > &  metalloids)
private

Definition at line 80 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourNobleGases()

void PeriodicTableWidget::ColourNobleGases ( const QVector< QPushButton * > &  nobleGases)
private

Definition at line 87 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourNonMetals()

void PeriodicTableWidget::ColourNonMetals ( const QVector< QPushButton * > &  nonMetals)
private

Methods to colour element buttons by periodic group.

Definition at line 94 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourPostTransitionMetals()

void PeriodicTableWidget::ColourPostTransitionMetals ( const QVector< QPushButton * > &  postTransMetals)
private

Definition at line 101 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourTransitionMetals()

void PeriodicTableWidget::ColourTransitionMetals ( const QVector< QPushButton * > &  transMetals)
private

Definition at line 108 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourUnknownProperties()

void PeriodicTableWidget::ColourUnknownProperties ( const QVector< QPushButton * > &  unknownProperties)
private

Definition at line 115 of file PeriodicTableWidget.cpp.

References ColourButton(), and UnknownProperties.

Referenced by ColourElements().

◆ compareButtonNameToStr()

bool PeriodicTableWidget::compareButtonNameToStr ( QPushButton *  buttonToCompare,
const QString &  stringToCompare 
)
Returns
the result of the comparison between a string and the text of a button.

Definition at line 133 of file PeriodicTableWidget.cpp.

Referenced by enableButtonByName().

◆ disableAllElementButtons()

void PeriodicTableWidget::disableAllElementButtons ( )

◆ disableButtons()

void PeriodicTableWidget::disableButtons ( QVector< QPushButton * >  buttons)

Disables all buttons associated with a group.

Definition at line 195 of file PeriodicTableWidget.cpp.

Referenced by disableAllElementButtons().

◆ elementsSelectedToString()

QString PeriodicTableWidget::elementsSelectedToString ( const QVector< QPushButton * > &  elementsSelected)
Returns
Comma-separated string of all the element buttons for one group that are currently checked

Definition at line 156 of file PeriodicTableWidget.cpp.

Referenced by getAllCheckedElementsStr().

◆ enableButtonByName()

void PeriodicTableWidget::enableButtonByName ( const QString &  elementStr)

Enables a button for an element by the element name i.e 'Au' for Gold.

Definition at line 123 of file PeriodicTableWidget.cpp.

References AllElementButtons, and compareButtonNameToStr().

◆ getAllCheckedElementsStr()

QString PeriodicTableWidget::getAllCheckedElementsStr ( )
Returns
Comma-separated string of all element buttons that are checked in the whole PeriodicTableWidget

Definition at line 170 of file PeriodicTableWidget.cpp.

References Actinides, AlkaliMetals, AlkalineEarthMetals, elementsSelectedToString(), Halogens, Lanthanides, Metalloids, NobleGases, OtherNonMetals, PostTransitionMetals, TransitionMetals, and UnknownProperties.

Referenced by getValue().

◆ getValue()

QString PeriodicTableWidget::getValue ( )

Definition at line 193 of file PeriodicTableWidget.cpp.

References getAllCheckedElementsStr().

◆ populateAllButtonsVector()

void PeriodicTableWidget::populateAllButtonsVector ( )
private

◆ populateGroupVectors()

void PeriodicTableWidget::populateGroupVectors ( )
private

Method to populate Group Vectors with element QPushButtons.

Definition at line 201 of file PeriodicTableWidget.cpp.

References Actinides, AlkaliMetals, AlkalineEarthMetals, Halogens, Lanthanides, Metalloids, NobleGases, OtherNonMetals, PostTransitionMetals, TransitionMetals, ui, and UnknownProperties.

Referenced by PeriodicTableWidget().

◆ showGroupLegend()

void PeriodicTableWidget::showGroupLegend ( bool  checked)

Displays or hides the Legend for the colour coding of periodic groups.

Definition at line 24 of file PeriodicTableWidget.cpp.

References ui.

Member Data Documentation

◆ Actinides

QVector<QPushButton *> PeriodicTableWidget::Actinides

◆ AlkaliMetals

QVector<QPushButton *> PeriodicTableWidget::AlkaliMetals

◆ AlkalineEarthMetals

QVector<QPushButton *> PeriodicTableWidget::AlkalineEarthMetals

◆ AllElementButtons

QVector<QVector<QPushButton *> > PeriodicTableWidget::AllElementButtons

Vector to hold all group vectors for access to All Buttons at once.

Definition at line 41 of file PeriodicTableWidget.h.

Referenced by enableButtonByName(), and populateAllButtonsVector().

◆ Halogens

QVector<QPushButton *> PeriodicTableWidget::Halogens

◆ Lanthanides

QVector<QPushButton *> PeriodicTableWidget::Lanthanides

◆ Metalloids

QVector<QPushButton *> PeriodicTableWidget::Metalloids

◆ NobleGases

QVector<QPushButton *> PeriodicTableWidget::NobleGases

◆ OtherNonMetals

QVector<QPushButton *> PeriodicTableWidget::OtherNonMetals

Vectors to Hold the QPushButtons of Elements in corresponding Groups.

Definition at line 28 of file PeriodicTableWidget.h.

Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().

◆ PostTransitionMetals

QVector<QPushButton *> PeriodicTableWidget::PostTransitionMetals

◆ TransitionMetals

QVector<QPushButton *> PeriodicTableWidget::TransitionMetals

◆ ui

Ui::PeriodicTable PeriodicTableWidget::ui
private

The Form containing the PeriodicTableWidget.

Definition at line 71 of file PeriodicTableWidget.h.

Referenced by PeriodicTableWidget(), populateGroupVectors(), and showGroupLegend().

◆ UnknownProperties

QVector<QPushButton *> PeriodicTableWidget::UnknownProperties

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