RadioButton moved to md.

This commit is contained in:
Achraf k 2022-02-17 03:39:07 +01:00
parent 1c07c06d85
commit 5651ee3ed2
3 changed files with 35 additions and 27 deletions

View File

@ -5,24 +5,27 @@
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QColor> #include <QColor>
#include "lib/qtmaterialcheckable_internal.h" #include "lib/qtmaterialcheckable_internal.h"
namespace md
{
/*! /*!
* \class QtMaterialRadioButtonPrivate * \class QtMaterialRadioButtonPrivate
* \internal * \internal
*/ */
QtMaterialRadioButtonPrivate::QtMaterialRadioButtonPrivate(QtMaterialRadioButton *q) RadioButtonPrivate::RadioButtonPrivate(RadioButton *q)
: QtMaterialCheckablePrivate(q) : CheckablePrivate(q)
{ {
} }
QtMaterialRadioButtonPrivate::~QtMaterialRadioButtonPrivate() RadioButtonPrivate::~RadioButtonPrivate()
{ {
} }
void QtMaterialRadioButtonPrivate::init() void RadioButtonPrivate::init()
{ {
Q_Q(QtMaterialRadioButton); Q_Q(RadioButton);
q->setAutoExclusive(true); q->setAutoExclusive(true);
@ -78,23 +81,24 @@ void QtMaterialRadioButtonPrivate::init()
* \class QtMaterialRadioButton * \class QtMaterialRadioButton
*/ */
QtMaterialRadioButton::QtMaterialRadioButton(QWidget *parent) RadioButton::RadioButton(QWidget *parent)
: QtMaterialCheckable(*new QtMaterialRadioButtonPrivate(this), parent) : Checkable(*new RadioButtonPrivate(this), parent)
{ {
d_func()->init(); d_func()->init();
} }
QtMaterialRadioButton::~QtMaterialRadioButton() RadioButton::~RadioButton()
{ {
} }
void QtMaterialRadioButton::setupProperties() void RadioButton::setupProperties()
{ {
QtMaterialCheckable::setupProperties(); Checkable::setupProperties();
Q_D(QtMaterialRadioButton); Q_D(RadioButton);
d->checkedState->assignProperty(d->checkedIcon, "color", checkedColor()); d->checkedState->assignProperty(d->checkedIcon, "color", checkedColor());
d->checkedState->assignProperty(d->uncheckedIcon, "color", uncheckedColor()); d->checkedState->assignProperty(d->uncheckedIcon, "color", uncheckedColor());
d->uncheckedState->assignProperty(d->uncheckedIcon, "color", uncheckedColor()); d->uncheckedState->assignProperty(d->uncheckedIcon, "color", uncheckedColor());
} }
}

View File

@ -2,23 +2,25 @@
#define QTMATERIALRADIOBUTTON_H #define QTMATERIALRADIOBUTTON_H
#include "lib/qtmaterialcheckable.h" #include "lib/qtmaterialcheckable.h"
namespace md
{
class QtMaterialRadioButtonPrivate; class RadioButtonPrivate;
class QtMaterialRadioButton : public QtMaterialCheckable class RadioButton : public Checkable
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QtMaterialRadioButton(QWidget *parent = 0); explicit RadioButton(QWidget *parent = 0);
~QtMaterialRadioButton(); ~RadioButton();
protected: protected:
void setupProperties(); void setupProperties();
private: private:
Q_DISABLE_COPY(QtMaterialRadioButton) Q_DISABLE_COPY(RadioButton)
Q_DECLARE_PRIVATE(QtMaterialRadioButton) Q_DECLARE_PRIVATE(RadioButton)
}; };
}
#endif // QTMATERIALRADIOBUTTON_H #endif // QTMATERIALRADIOBUTTON_H

View File

@ -2,19 +2,21 @@
#define QTMATERIALRADIOBUTTON_P_H #define QTMATERIALRADIOBUTTON_P_H
#include "lib/qtmaterialcheckable_p.h" #include "lib/qtmaterialcheckable_p.h"
namespace md
class QtMaterialRadioButton;
class QtMaterialRadioButtonPrivate : public QtMaterialCheckablePrivate
{ {
Q_DISABLE_COPY(QtMaterialRadioButtonPrivate)
Q_DECLARE_PUBLIC(QtMaterialRadioButton) class RadioButton;
class RadioButtonPrivate : public CheckablePrivate
{
Q_DISABLE_COPY(RadioButtonPrivate)
Q_DECLARE_PUBLIC(RadioButton)
public: public:
QtMaterialRadioButtonPrivate(QtMaterialRadioButton *q); RadioButtonPrivate(RadioButton *q);
~QtMaterialRadioButtonPrivate(); ~RadioButtonPrivate();
void init(); void init();
}; };
}
#endif // QTMATERIALRADIOBUTTON_P_H #endif // QTMATERIALRADIOBUTTON_P_H