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.
 
void disableButtons (QList< QPushButton * > buttons)
 Disables all buttons associated with a group.
 
QString elementsSelectedToString (const QList< QPushButton * > &elementsSelected)
 
void enableButtonByName (const QString &elementStr)
 Enables a button for an element by the element name i.e 'Au' for Gold.
 
QString getAllCheckedElementsStr ()
 
QString getValue ()
 
 PeriodicTableWidget (QWidget *parent=nullptr)
 Constructor.
 
void showGroupLegend (bool checked)
 Displays or hides the Legend for the colour coding of periodic groups.
 
 ~PeriodicTableWidget () override
 Destructor.
 

Public Attributes

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

Private Member Functions

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

Private Attributes

Ui::PeriodicTable ui
 The Form containing the PeriodicTableWidget.
 

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 QList< QPushButton * > &  actinides)
private

Definition at line 45 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourAlkaliMetals()

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

Definition at line 52 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourAlkalineEarthMetals()

void PeriodicTableWidget::ColourAlkalineEarthMetals ( const QList< 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 QList< QPushButton * > &  halogens)
private

Definition at line 66 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourLanthanides()

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

Definition at line 73 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourMetalloids()

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

Definition at line 80 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourNobleGases()

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

Definition at line 87 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourNonMetals()

void PeriodicTableWidget::ColourNonMetals ( const QList< 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 QList< QPushButton * > &  postTransMetals)
private

Definition at line 101 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourTransitionMetals()

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

Definition at line 108 of file PeriodicTableWidget.cpp.

References ColourButton().

Referenced by ColourElements().

◆ ColourUnknownProperties()

void PeriodicTableWidget::ColourUnknownProperties ( const QList< 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 ( QList< 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 QList< 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

QList<QPushButton *> PeriodicTableWidget::Actinides

◆ AlkaliMetals

QList<QPushButton *> PeriodicTableWidget::AlkaliMetals

◆ AlkalineEarthMetals

QList<QPushButton *> PeriodicTableWidget::AlkalineEarthMetals

◆ AllElementButtons

QList<QList<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

QList<QPushButton *> PeriodicTableWidget::Halogens

◆ Lanthanides

QList<QPushButton *> PeriodicTableWidget::Lanthanides

◆ Metalloids

QList<QPushButton *> PeriodicTableWidget::Metalloids

◆ NobleGases

QList<QPushButton *> PeriodicTableWidget::NobleGases

◆ OtherNonMetals

QList<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

QList<QPushButton *> PeriodicTableWidget::PostTransitionMetals

◆ TransitionMetals

QList<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

QList<QPushButton *> PeriodicTableWidget::UnknownProperties

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