File indexing completed on 2026-07-12 05:31:51
0001 /************************************************************************* 0002 * Copyright (C) 2009 by Renaud Guezennec * 0003 * * 0004 * https://rolisteam.org/ * 0005 * * 0006 * rolisteam is free software; you can redistribute it and/or modify * 0007 * it under the terms of the GNU General Public License as published * 0008 * by the Free Software Foundation; either version 2 of the License, * 0009 * or (at your option) any later version. * 0010 * * 0011 * This program is distributed in the hope that it will be useful, * 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0014 * GNU General Public License for more details. * 0015 * * 0016 * You should have received a copy of the GNU General Public License * 0017 * along with this program; if not, write to the * 0018 * Free Software Foundation, Inc., * 0019 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 0020 *************************************************************************/ 0021 #ifndef CENTEREDCHECKBOX_H 0022 #define CENTEREDCHECKBOX_H 0023 0024 #include "rwidgets_global.h" 0025 #include <QCheckBox> 0026 #include <QWidget> 0027 #include <memory> 0028 /** 0029 * @brief The CenteredCheckBox class is a simple widget to display checkbox in the middle of their 0030 * parent. It is useful for ItemDelegate. 0031 */ 0032 class RWIDGET_EXPORT CenteredCheckBox : public QWidget 0033 { 0034 Q_OBJECT 0035 public: 0036 CenteredCheckBox(QWidget* parent= nullptr); 0037 0038 bool isCheckedDelegate() const; 0039 void setCheckedDelegate(bool); 0040 0041 signals: 0042 void commitEditor(); 0043 0044 private: 0045 std::unique_ptr<QCheckBox> m_editorCheckBox; 0046 }; 0047 0048 #endif // CENTEREDCHECKBOX_H