Falkon Develop
Cross-platform Qt-based web browser
checkboxdialog.cpp
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
4* Copyright (C) 2017 Razi Alavizadeh <s.r.alavizadeh@gmail.com>
5*
6* This program is free software: you can redistribute it and/or modify
7* it under the terms of the GNU General Public License as published by
8* the Free Software Foundation, either version 3 of the License, or
9* (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18* ============================================================ */
19#include "checkboxdialog.h"
20
21#include <QCheckBox>
22
23CheckBoxDialog::CheckBoxDialog(const QMessageBox::StandardButtons &buttons, QWidget* parent)
24 : QMessageBox(parent)
25 , m_checkBox(new QCheckBox)
26{
27 setCheckBox(m_checkBox);
28 setStandardButtons(buttons);
29 setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
30}
31
32void CheckBoxDialog::setCheckBoxText(const QString &text)
33{
34 m_checkBox->setText(text);
35}
36
38{
39 return m_checkBox->isChecked();
40}
41
43{
44 m_checkBox->setChecked(state == Qt::Checked);
45}
void setDefaultCheckState(Qt::CheckState state)
bool isChecked() const
void setCheckBoxText(const QString &text)
CheckBoxDialog(const QMessageBox::StandardButtons &buttons, QWidget *parent=nullptr)
State state