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 "GuiDialogButtonBox.h"
0020 
0021 using namespace QtBindings::Gui;
0022 
0023 DialogButtonBox::DialogButtonBox(QWidget *parent) : QDialogButtonBox(parent)
0024 {
0025 }
0026 
0027 DialogButtonBox::DialogButtonBox(const DialogButtonBox &other) : QDialogButtonBox(other.parentWidget())
0028 {
0029     *this = other;
0030 }
0031 
0032 
0033 DialogButtonBox::~DialogButtonBox()
0034 {
0035 }
0036 
0037 DialogButtonBox &
0038 DialogButtonBox::operator=(const DialogButtonBox &other)
0039 {
0040     if (this != &other) {
0041         this->setCenterButtons(other.centerButtons());
0042         this->setOrientation(other.orientation());
0043         this->setStandardButtons(other.standardButtons());;
0044         for (auto &otherButton : other.buttons() )
0045         {
0046            this->addButton(otherButton,QDialogButtonBox::AcceptRole);
0047         }
0048     }
0049     return *this;
0050 }