File indexing completed on 2025-01-05 04:26:49

0001 /*
0002  * Replacement fot QT Bindings that were removed from QT5
0003  * Copyright (C) 2020  Pedro de Carvalho Gomes <pedrogomes81@gmail.com>
0004  *
0005  * This program is free software: you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation, either version 3 of the License, or
0008  * (at your option) any later version.
0009  *
0010  * This program is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017  */
0018 
0019 #ifndef GUICHECKBOX_H
0020 #define GUICHECKBOX_H
0021 
0022 #include "QtBinding.h"
0023 
0024 #include <QCheckBox>
0025 
0026 namespace QtBindings
0027 {
0028     namespace Gui
0029     {
0030         class CheckBox : public QCheckBox, public QtBindings::Base<CheckBox>
0031         {
0032             Q_OBJECT
0033         public:
0034             Q_INVOKABLE CheckBox(QWidget *parent = Q_NULLPTR);
0035             Q_INVOKABLE CheckBox(const CheckBox &other);
0036             Q_INVOKABLE CheckBox(const QString &text, QWidget *parent = Q_NULLPTR);
0037             Q_INVOKABLE ~CheckBox();
0038             CheckBox &operator=(const CheckBox &other);
0039         public slots:
0040             Qt::CheckState checkState() const;
0041             bool isTristate() const;
0042             void setCheckState(Qt::CheckState state);
0043             void setTristate(bool y = true);
0044             void setEnabled(bool enabled);
0045             virtual QSize minimumSizeHint() const override;
0046             virtual QSize sizeHint() const override;
0047         };
0048     }
0049 }
0050 Q_DECLARE_METATYPE(QtBindings::Gui::CheckBox)
0051 #endif //GUICHECKBOX_H