1 /* 2 RatioWidget.h - paint a ratio 3 SPDX-FileCopyrightText: 2004 Sebastian Stein <seb.kde@hpfsc.de> 4 SPDX-FileCopyrightText: 2008 Tadeu Araujo <tadeu.araujo@ltia.fc.unesp.br> 5 SPDX-FileCopyrightText: 2008 Danilo Balzaque <danilo.balzaque@ltia.fc.unesp.br> 6 7 SPDX-License-Identifier: GPL-2.0-or-later 8 */ 9 10 #ifndef RATIOWIDGET_H 11 #define RATIOWIDGET_H 12 13 #include "FractionBaseWidget.h" 14 #include "Ratio.h" 15 16 #include <QWidget> 17 18 class QPaintEvent; 19 20 /*! class to paint the ratio 21 * 22 * \author Sebastian Stein */ 23 class RatioWidget : public FractionBaseWidget 24 { 25 Q_OBJECT 26 public: 27 /** constructor */ 28 explicit RatioWidget(QWidget * parent = nullptr, const Ratio ¶_ratio = Ratio()); 29 30 /** destructor */ 31 ~RatioWidget() override; 32 33 /** set the task to be displayed */ 34 void setRatio(const Ratio ¶_ratio); 35 36 void setQuestionMixed(bool value); 37 38 private: 39 40 /** the ratio to be displayed */ 41 Ratio m_ratio; 42 43 /*identify if the fraction will appear in mixed form or not*/ 44 bool m_questionMixed; 45 46 /** overriding the paint event of FractionBaseWidget */ 47 void paintEvent(QPaintEvent*) override; 48 }; 49 50 #endif 51