File indexing completed on 2024-03-24 03:44:23
0001 /* 0002 SPDX-License-Identifier: GPL-2.0-or-later 0003 */ 0004 0005 #ifndef ISOTOPETABLESETTINGSCARD_H 0006 #define ISOTOPETABLESETTINGSCARD_H 0007 0008 #include "isotopeview.h" 0009 #include <QFrame> 0010 #include <QRadioButton> 0011 0012 class IsotopeTableSettingsCard : public QFrame 0013 { 0014 Q_OBJECT 0015 0016 public: 0017 explicit IsotopeTableSettingsCard(QWidget *parent = nullptr); 0018 IsotopeTableSettingsCard(QWidget *parent, int mode); 0019 QString text() const 0020 { 0021 return m_radioButton->text(); 0022 } 0023 int mode() const 0024 { 0025 return m_isotopeView->mode(); 0026 } 0027 bool isChecked() const 0028 { 0029 return m_radioButton->isChecked(); 0030 } 0031 0032 private: 0033 void initialize(); 0034 0035 private: 0036 IsotopeView *m_isotopeView = nullptr; 0037 QRadioButton *m_radioButton = nullptr; 0038 0039 public Q_SLOTS: 0040 void setText(const QString &text) 0041 { 0042 m_radioButton->setText(text); 0043 } 0044 void setMode(int mode) 0045 { 0046 m_isotopeView->setMode(mode); 0047 } 0048 void setZoom(qreal zoom) 0049 { 0050 m_isotopeView->setZoom(zoom); 0051 } 0052 void setChecked(bool checked) 0053 { 0054 m_radioButton->setChecked(checked); 0055 } 0056 void setRadioButtonObjectName(QString name) 0057 { 0058 m_radioButton->setObjectName(name); 0059 } 0060 0061 Q_SIGNALS: 0062 void checked(int mode); 0063 0064 protected: 0065 bool eventFilter(QObject *object, QEvent *event) override; 0066 }; 0067 0068 #endif // ISOTOPETABLESETTINGSCARD_H