Mantid
Loading...
Searching...
No Matches
PeriodicTableWidget.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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#pragma once
8
10#include "ui_PeriodicTableWidget.h"
11#include <QVector>
12#include <QWidget>
13
19class PeriodicTableWidget : public QWidget {
20 Q_OBJECT
21
22public:
24 PeriodicTableWidget(QWidget *parent = nullptr);
28 QVector<QPushButton *> OtherNonMetals;
29 QVector<QPushButton *> AlkaliMetals;
30 QVector<QPushButton *> AlkalineEarthMetals;
31 QVector<QPushButton *> TransitionMetals;
32 QVector<QPushButton *> Actinides;
33 QVector<QPushButton *> Lanthanides;
34 QVector<QPushButton *> UnknownProperties;
35 QVector<QPushButton *> PostTransitionMetals;
36 QVector<QPushButton *> Metalloids;
37 QVector<QPushButton *> Halogens;
38 QVector<QPushButton *> NobleGases;
39
41 QVector<QVector<QPushButton *>> AllElementButtons;
42
45 QString elementsSelectedToString(const QVector<QPushButton *> &elementsSelected);
46
50
52 void disableButtons(QVector<QPushButton *> buttons);
53
56
58 void enableButtonByName(const QString &elementStr);
59
62 bool compareButtonNameToStr(QPushButton *buttonToCompare, const QString &stringToCompare);
63
65 void showGroupLegend(bool checked);
66
67 QString getValue();
68
69private:
71 Ui::PeriodicTable ui;
73 void ColourNonMetals(const QVector<QPushButton *> &nonMetals);
74 void ColourAlkaliMetals(const QVector<QPushButton *> &alkaliMetals);
75 void ColourAlkalineEarthMetals(const QVector<QPushButton *> &alkalineEarthMetals);
76 void ColourTransitionMetals(const QVector<QPushButton *> &transMetals);
77 void ColourActinides(const QVector<QPushButton *> &actinides);
78 void ColourLanthanides(const QVector<QPushButton *> &lanthanides);
79 void ColourPostTransitionMetals(const QVector<QPushButton *> &postTransMetals);
80 void ColourUnknownProperties(const QVector<QPushButton *> &unknownProperties);
81 void ColourMetalloids(const QVector<QPushButton *> &metalloids);
82 void ColourHalogens(const QVector<QPushButton *> &halogens);
83 void ColourNobleGases(const QVector<QPushButton *> &nobleGases);
84
86 void ColourButton(QPushButton *elementButton, const QString &colour);
87
90
93
95 void ColourElements();
96};
PeriodicTableWidget: A Widget representing a colour coded Periodic Table of Elements,...
void ColourElements()
Colour all of the elements by calls to individual group colouring methods.
void ColourPostTransitionMetals(const QVector< QPushButton * > &postTransMetals)
bool compareButtonNameToStr(QPushButton *buttonToCompare, const QString &stringToCompare)
void populateAllButtonsVector()
Method to populate Vector with all Group vectors.
~PeriodicTableWidget() override
Destructor.
QVector< QPushButton * > NobleGases
QVector< QPushButton * > Lanthanides
void ColourHalogens(const QVector< QPushButton * > &halogens)
QVector< QPushButton * > PostTransitionMetals
void showGroupLegend(bool checked)
Displays or hides the Legend for the colour coding of periodic groups.
void enableButtonByName(const QString &elementStr)
Enables a button for an element by the element name i.e 'Au' for Gold.
void ColourNonMetals(const QVector< QPushButton * > &nonMetals)
Methods to colour element buttons by periodic group.
void ColourAlkaliMetals(const QVector< QPushButton * > &alkaliMetals)
void ColourLanthanides(const QVector< QPushButton * > &lanthanides)
QVector< QPushButton * > Actinides
QVector< QPushButton * > UnknownProperties
void ColourNobleGases(const QVector< QPushButton * > &nobleGases)
void ColourAlkalineEarthMetals(const QVector< QPushButton * > &alkalineEarthMetals)
Ui::PeriodicTable ui
The Form containing the PeriodicTableWidget.
QString elementsSelectedToString(const QVector< QPushButton * > &elementsSelected)
void ColourButton(QPushButton *elementButton, const QString &colour)
Methods to colour single element button by setting styleSheet.
QVector< QPushButton * > TransitionMetals
void disableButtons(QVector< QPushButton * > buttons)
Disables all buttons associated with a group.
void populateGroupVectors()
Method to populate Group Vectors with element QPushButtons.
void ColourMetalloids(const QVector< QPushButton * > &metalloids)
void disableAllElementButtons()
Disables All buttons in periodicTableWidget.
void ColourTransitionMetals(const QVector< QPushButton * > &transMetals)
void ColourActinides(const QVector< QPushButton * > &actinides)
QVector< QPushButton * > Halogens
QVector< QVector< QPushButton * > > AllElementButtons
Vector to hold all group vectors for access to All Buttons at once.
QVector< QPushButton * > Metalloids
void ColourUnknownProperties(const QVector< QPushButton * > &unknownProperties)
QVector< QPushButton * > OtherNonMetals
Vectors to Hold the QPushButtons of Elements in corresponding Groups.
QVector< QPushButton * > AlkalineEarthMetals
QVector< QPushButton * > AlkaliMetals