File indexing completed on 2024-10-27 04:39:09
0001 // SPDX-License-Identifier: GPL-2.0-or-later 0002 // SPDX-FileCopyrightText: 2018 Kevin Ottens <ervin@kde.org> 0003 0004 #ifndef PRESSUREEQUATION_H 0005 #define PRESSUREEQUATION_H 0006 0007 #include <QObject> 0008 0009 class PressureEquation : public QObject 0010 { 0011 Q_OBJECT 0012 Q_PROPERTY(float minWidth READ minWidth WRITE setMinWidth NOTIFY minWidthChanged) 0013 Q_PROPERTY(float maxWidth READ maxWidth WRITE setMaxWidth NOTIFY maxWidthChanged) 0014 0015 Q_PROPERTY(float pressure READ pressure WRITE setPressure NOTIFY pressureChanged) 0016 Q_PROPERTY(float width READ width NOTIFY widthChanged) 0017 public: 0018 using QObject::QObject; 0019 0020 float minWidth() const; 0021 float maxWidth() const; 0022 0023 float pressure() const; 0024 float width() const; 0025 0026 public Q_SLOTS: 0027 void setMinWidth(float minWidth); 0028 void setMaxWidth(float maxWidth); 0029 0030 void setPressure(float pressure); 0031 0032 Q_SIGNALS: 0033 void minWidthChanged(float minWidth); 0034 void maxWidthChanged(float maxWidth); 0035 0036 void pressureChanged(float pressure); 0037 void widthChanged(float width); 0038 0039 private: 0040 void updateWidth(); 0041 0042 float m_minWidth = 1.0f; 0043 float m_maxWidth = 1.0f; 0044 0045 float m_pressure = 0.0f; 0046 float m_width = m_maxWidth; 0047 }; 0048 0049 #endif // PRESSUREEQUATION_H