File indexing completed on 2024-05-05 12:57:31
0001 /* 0002 * Copyright (C) 2010-2015 by Stephen Allewell 0003 * steve.allewell@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 2 of the License, or 0008 * (at your option) any later version. 0009 */ 0010 0011 #ifndef Scale_H 0012 #define Scale_H 0013 0014 #include <QWidget> 0015 0016 #include "configuration.h" 0017 0018 class Scale : public QWidget 0019 { 0020 Q_OBJECT 0021 0022 public: 0023 explicit Scale(Qt::Orientation); 0024 virtual ~Scale() = default; 0025 0026 void setUnits(Configuration::EnumEditor_FormatScalesAs::type); 0027 void setCellSize(double); 0028 void setCellGrouping(int); 0029 void setCellCount(int); 0030 void setClothCount(double); 0031 void setClothCountUnits(Configuration::EnumEditor_ClothCountUnits::type); 0032 void setOffset(double); 0033 virtual QSize sizeHint() const Q_DECL_OVERRIDE; 0034 0035 protected: 0036 virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE; 0037 0038 private: 0039 Configuration::EnumEditor_FormatScalesAs::type m_units; 0040 double m_cellSize; 0041 int m_cellGrouping; 0042 int m_cellCount; 0043 double m_clothCount; 0044 Configuration::EnumEditor_ClothCountUnits::type m_clothCountUnits; 0045 double m_offset; 0046 Qt::Orientation m_orientation; 0047 }; 0048 0049 #endif // Scale_H