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 #include "GuiCheckBox.h" 0020 0021 using namespace QtBindings::Gui; 0022 0023 CheckBox::CheckBox(QWidget *parent) : QCheckBox(parent) 0024 { 0025 } 0026 0027 CheckBox::CheckBox(const CheckBox &other) : QCheckBox(qobject_cast<QWidget*>( other.parent() )) 0028 { 0029 *this = other; 0030 } 0031 0032 CheckBox::CheckBox(const QString &text, QWidget *parent) : QCheckBox( 0033 text, parent) 0034 { 0035 } 0036 0037 CheckBox::~CheckBox() 0038 { 0039 } 0040 0041 Qt::CheckState CheckBox::checkState() const 0042 { 0043 return QCheckBox::checkState(); 0044 } 0045 0046 bool CheckBox::isTristate() const 0047 { 0048 return QCheckBox::isTristate(); 0049 } 0050 0051 void CheckBox::setCheckState(Qt::CheckState state) 0052 { 0053 QCheckBox::setCheckState(state); 0054 } 0055 0056 void CheckBox::setTristate(bool y) 0057 { 0058 QCheckBox::setTristate(y); 0059 } 0060 0061 void CheckBox::setEnabled(bool enabled) 0062 { 0063 QCheckBox::setEnabled(enabled); 0064 } 0065 0066 QSize CheckBox::minimumSizeHint() const 0067 { 0068 return QCheckBox::minimumSizeHint(); 0069 } 0070 0071 QSize CheckBox::sizeHint() const 0072 { 0073 return QCheckBox::sizeHint(); 0074 } 0075 0076 CheckBox &CheckBox::operator=(const CheckBox &other) 0077 { 0078 if (this != &other) { 0079 this->setCheckState( other.checkState() ); 0080 this->setTristate( other.isTristate() ); 0081 this->setEnabled( other.isEnabled() ); 0082 } 0083 return *this; 0084 } 0085