File indexing completed on 2024-05-12 17:12:39

0001 /*************************************************************************
0002  *    Copyright (C) 2007 by Romain Campioni                              *
0003  *    Copyright (C) 2009 by Renaud Guezennec                             *
0004  *    Copyright (C) 2011 by Joseph Boudou                                *
0005  *                                                                       *
0006  *    https://rolisteam.org/                                          *
0007  *                                                                       *
0008  *   Rolisteam is free software; you can redistribute it and/or modify   *
0009  *   it under the terms of the GNU General Public License as published   *
0010  *   by the Free Software Foundation; either version 2 of the License,   *
0011  *   or (at your option) any later version.                              *
0012  *                                                                       *
0013  *   This program is distributed in the hope that it will be useful,     *
0014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of      *
0015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
0016  *   GNU General Public License for more details.                        *
0017  *                                                                       *
0018  *   You should have received a copy of the GNU General Public License   *
0019  *   along with this program; if not, write to the                       *
0020  *   Free Software Foundation, Inc.,                                     *
0021  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           *
0022  *************************************************************************/
0023 
0024 #ifndef SELECTEUR_DIAMETRE_H
0025 #define SELECTEUR_DIAMETRE_H
0026 
0027 #include "rwidgets/rwidgets_global.h"
0028 #include <QSlider>
0029 #include <QWidget>
0030 class CircleDisplayer;
0031 
0032 /**
0033  * @brief Dessine un disque dont le diamĂȘtre varie grace a un QSlider.
0034  */
0035 class RWIDGET_EXPORT DiameterSelector : public QWidget
0036 {
0037     Q_OBJECT
0038 public:
0039     /**
0040      * @brief constuctor with arguments
0041      * @param parent widget
0042      * @param full or not
0043      * @param minimum value
0044      * @param maximum value
0045      */
0046     DiameterSelector(QWidget* parent= nullptr, bool filled= true, int minimum= 1, int maximum= 50);
0047     void setDiameter(int diameter);
0048     int getCurrentValue() const;
0049 
0050 signals:
0051     /**
0052      * @brief is emited when the value has been changed
0053      */
0054     void diameterChanged(int);
0055 
0056 private:
0057     int minimum;
0058     int maximum;
0059     CircleDisplayer* m_circle;
0060     QSlider* m_diameterSlider;
0061 };
0062 
0063 #endif