Mantid
|
PeriodicTableWidget: A Widget representing a colour coded Periodic Table of Elements, with corresponding buttons as the elements. More...
#include <PeriodicTableWidget.h>
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... | |
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.
PeriodicTableWidget::PeriodicTableWidget | ( | QWidget * | parent = nullptr | ) |
Constructor.
Default constructor.
parent | :: default parameter |
Hide the legend by default
Definition at line 14 of file PeriodicTableWidget.cpp.
References ColourElements(), populateAllButtonsVector(), populateGroupVectors(), and ui.
|
inlineoverride |
Destructor.
Definition at line 26 of file PeriodicTableWidget.h.
|
private |
Definition at line 45 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Definition at line 52 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Definition at line 59 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Methods to colour single element button by setting styleSheet.
Definition at line 150 of file PeriodicTableWidget.cpp.
Referenced by ColourActinides(), ColourAlkaliMetals(), ColourAlkalineEarthMetals(), ColourHalogens(), ColourLanthanides(), ColourMetalloids(), ColourNobleGases(), ColourNonMetals(), ColourPostTransitionMetals(), ColourTransitionMetals(), and ColourUnknownProperties().
|
private |
Colour all of the elements by calls to individual group colouring methods.
Definition at line 32 of file PeriodicTableWidget.cpp.
References Actinides, AlkaliMetals, AlkalineEarthMetals, ColourActinides(), ColourAlkaliMetals(), ColourAlkalineEarthMetals(), ColourHalogens(), ColourLanthanides(), ColourMetalloids(), ColourNobleGases(), ColourNonMetals(), ColourPostTransitionMetals(), ColourTransitionMetals(), ColourUnknownProperties(), Halogens, Lanthanides, Metalloids, NobleGases, OtherNonMetals, PostTransitionMetals, TransitionMetals, and UnknownProperties.
Referenced by PeriodicTableWidget().
|
private |
Definition at line 66 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Definition at line 73 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Definition at line 80 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Definition at line 87 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Methods to colour element buttons by periodic group.
Definition at line 94 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Definition at line 101 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Definition at line 108 of file PeriodicTableWidget.cpp.
References ColourButton().
Referenced by ColourElements().
|
private |
Definition at line 115 of file PeriodicTableWidget.cpp.
References ColourButton(), and UnknownProperties.
Referenced by ColourElements().
bool PeriodicTableWidget::compareButtonNameToStr | ( | QPushButton * | buttonToCompare, |
const QString & | stringToCompare | ||
) |
Definition at line 133 of file PeriodicTableWidget.cpp.
Referenced by enableButtonByName().
void PeriodicTableWidget::disableAllElementButtons | ( | ) |
Disables All buttons in periodicTableWidget.
Definition at line 137 of file PeriodicTableWidget.cpp.
References Actinides, AlkaliMetals, AlkalineEarthMetals, disableButtons(), Halogens, Lanthanides, Metalloids, NobleGases, OtherNonMetals, PostTransitionMetals, TransitionMetals, and UnknownProperties.
void PeriodicTableWidget::disableButtons | ( | QVector< QPushButton * > | buttons | ) |
Disables all buttons associated with a group.
Definition at line 195 of file PeriodicTableWidget.cpp.
Referenced by disableAllElementButtons().
QString PeriodicTableWidget::elementsSelectedToString | ( | const QVector< QPushButton * > & | elementsSelected | ) |
Definition at line 156 of file PeriodicTableWidget.cpp.
Referenced by getAllCheckedElementsStr().
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().
QString PeriodicTableWidget::getAllCheckedElementsStr | ( | ) |
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().
QString PeriodicTableWidget::getValue | ( | ) |
Definition at line 193 of file PeriodicTableWidget.cpp.
References getAllCheckedElementsStr().
|
private |
Method to populate Vector with all Group vectors.
Definition at line 335 of file PeriodicTableWidget.cpp.
References Actinides, AlkaliMetals, AlkalineEarthMetals, AllElementButtons, Halogens, Lanthanides, Metalloids, NobleGases, OtherNonMetals, PostTransitionMetals, TransitionMetals, and UnknownProperties.
Referenced by PeriodicTableWidget().
|
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().
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.
QVector<QPushButton *> PeriodicTableWidget::Actinides |
Definition at line 32 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
QVector<QPushButton *> PeriodicTableWidget::AlkaliMetals |
Definition at line 29 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
QVector<QPushButton *> PeriodicTableWidget::AlkalineEarthMetals |
Definition at line 30 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
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().
QVector<QPushButton *> PeriodicTableWidget::Halogens |
Definition at line 37 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
QVector<QPushButton *> PeriodicTableWidget::Lanthanides |
Definition at line 33 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
QVector<QPushButton *> PeriodicTableWidget::Metalloids |
Definition at line 36 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
QVector<QPushButton *> PeriodicTableWidget::NobleGases |
Definition at line 38 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
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().
QVector<QPushButton *> PeriodicTableWidget::PostTransitionMetals |
Definition at line 35 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
QVector<QPushButton *> PeriodicTableWidget::TransitionMetals |
Definition at line 31 of file PeriodicTableWidget.h.
Referenced by ColourElements(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().
|
private |
The Form containing the PeriodicTableWidget.
Definition at line 71 of file PeriodicTableWidget.h.
Referenced by PeriodicTableWidget(), populateGroupVectors(), and showGroupLegend().
QVector<QPushButton *> PeriodicTableWidget::UnknownProperties |
Definition at line 34 of file PeriodicTableWidget.h.
Referenced by ColourElements(), ColourUnknownProperties(), disableAllElementButtons(), getAllCheckedElementsStr(), populateAllButtonsVector(), and populateGroupVectors().