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 <QList>
12#include <QWidget>
13
19class PeriodicTableWidget : public QWidget {
20 Q_OBJECT
21
22public:
24 PeriodicTableWidget(QWidget *parent = nullptr);
26 ~PeriodicTableWidget() override {};
39
42
45 QString elementsSelectedToString(const QList<QPushButton *> &elementsSelected);
46
50
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 QList<QPushButton *> &nonMetals);
74 void ColourAlkaliMetals(const QList<QPushButton *> &alkaliMetals);
75 void ColourAlkalineEarthMetals(const QList<QPushButton *> &alkalineEarthMetals);
76 void ColourTransitionMetals(const QList<QPushButton *> &transMetals);
77 void ColourActinides(const QList<QPushButton *> &actinides);
78 void ColourLanthanides(const QList<QPushButton *> &lanthanides);
79 void ColourPostTransitionMetals(const QList<QPushButton *> &postTransMetals);
80 void ColourUnknownProperties(const QList<QPushButton *> &unknownProperties);
81 void ColourMetalloids(const QList<QPushButton *> &metalloids);
82 void ColourHalogens(const QList<QPushButton *> &halogens);
83 void ColourNobleGases(const QList<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 QList< QPushButton * > &postTransMetals)
bool compareButtonNameToStr(QPushButton *buttonToCompare, const QString &stringToCompare)
QList< QPushButton * > NobleGases
void populateAllButtonsVector()
Method to populate Vector with all Group vectors.
~PeriodicTableWidget() override
Destructor.
QList< QList< QPushButton * > > AllElementButtons
Vector to hold all group vectors for access to All Buttons at once.
QList< QPushButton * > TransitionMetals
QList< QPushButton * > Halogens
QList< QPushButton * > Metalloids
void ColourNonMetals(const QList< QPushButton * > &nonMetals)
Methods to colour element buttons by periodic group.
void showGroupLegend(bool checked)
Displays or hides the Legend for the colour coding of periodic groups.
QList< QPushButton * > Lanthanides
void enableButtonByName(const QString &elementStr)
Enables a button for an element by the element name i.e 'Au' for Gold.
void ColourAlkalineEarthMetals(const QList< QPushButton * > &alkalineEarthMetals)
void ColourHalogens(const QList< QPushButton * > &halogens)
void ColourNobleGases(const QList< QPushButton * > &nobleGases)
void ColourUnknownProperties(const QList< QPushButton * > &unknownProperties)
QList< QPushButton * > AlkaliMetals
Ui::PeriodicTable ui
The Form containing the PeriodicTableWidget.
void ColourButton(QPushButton *elementButton, const QString &colour)
Methods to colour single element button by setting styleSheet.
void ColourLanthanides(const QList< QPushButton * > &lanthanides)
QString elementsSelectedToString(const QList< QPushButton * > &elementsSelected)
void populateGroupVectors()
Method to populate Group Vectors with element QPushButtons.
void disableAllElementButtons()
Disables All buttons in periodicTableWidget.
void ColourAlkaliMetals(const QList< QPushButton * > &alkaliMetals)
void disableButtons(QList< QPushButton * > buttons)
Disables all buttons associated with a group.
QList< QPushButton * > AlkalineEarthMetals
QList< QPushButton * > Actinides
QList< QPushButton * > UnknownProperties
QList< QPushButton * > PostTransitionMetals
void ColourActinides(const QList< QPushButton * > &actinides)
void ColourTransitionMetals(const QList< QPushButton * > &transMetals)
QList< QPushButton * > OtherNonMetals
Vectors to Hold the QPushButtons of Elements in corresponding Groups.
void ColourMetalloids(const QList< QPushButton * > &metalloids)