|
@@ -13687,11 +13687,11 @@ given portion of the scale. One event is generated when the mouse button is
|
13687
|
13687
|
pressed.
|
13688
|
13688
|
|
13689
|
13689
|
@<ScaleControl implementation@>=
|
13690
|
|
-void ScaleControl::mousePressEvent(QMouseEvent *event)@t\2\2@>@/
|
13691
|
|
-{@t\1@>@/
|
|
13690
|
+void ScaleControl::mousePressEvent(QMouseEvent *event)
|
|
13691
|
+{
|
13692
|
13692
|
@<Check that the left button was pressed@>@;
|
13693
|
|
- scaleDown = true;
|
13694
|
|
- event->accept();@t\2@>@/
|
|
13693
|
+ scaleDown = @[true@];
|
|
13694
|
+ event->accept();
|
13695
|
13695
|
}
|
13696
|
13696
|
|
13697
|
13697
|
@ The primary action button on the mouse is the left button. While there might
|
|
@@ -13819,10 +13819,10 @@ during a cupping session, you are most likely waiting far too long to pour the
|
13819
|
13819
|
water.
|
13820
|
13820
|
|
13821
|
13821
|
@<Class declarations@>=
|
13822
|
|
-class IntensityControl : public QGraphicsView
|
13823
|
|
-{
|
13824
|
|
- Q_OBJECT
|
13825
|
|
- Q_PROPERTY(double value READ value WRITE setValue)
|
|
13822
|
+class IntensityControl : public QGraphicsView@/
|
|
13823
|
+{@/
|
|
13824
|
+ @[Q_OBJECT@]@;
|
|
13825
|
+ @[Q_PROPERTY(double value READ value WRITE setValue)@]@;
|
13826
|
13826
|
QGraphicsScene scene;
|
13827
|
13827
|
QGraphicsPolygonItem decrement;
|
13828
|
13828
|
QGraphicsPolygonItem increment;
|
|
@@ -13836,17 +13836,17 @@ class IntensityControl : public QGraphicsView
|
13836
|
13836
|
double theValue;
|
13837
|
13837
|
bool valueSet;
|
13838
|
13838
|
bool scaleDown;
|
13839
|
|
- public:
|
|
13839
|
+ public:@/
|
13840
|
13840
|
IntensityControl();
|
13841
|
13841
|
double value();
|
13842
|
|
- virtual QSize sizeHint() const;
|
13843
|
|
- public slots:
|
13844
|
|
- void setValue(double val);
|
13845
|
|
- signals:
|
13846
|
|
- void valueChanged(double);
|
13847
|
|
- protected:
|
|
13842
|
+ virtual QSize sizeHint() const;@/
|
|
13843
|
+ @[public slots@]:@/
|
|
13844
|
+ void setValue(double val);@/
|
|
13845
|
+ signals:@/
|
|
13846
|
+ void valueChanged(double);@/
|
|
13847
|
+ protected:@/
|
13848
|
13848
|
virtual void mousePressEvent(QMouseEvent *event);
|
13849
|
|
- virtual void mouseReleaseEvent(QMouseEvent *event);
|
|
13849
|
+ virtual void mouseReleaseEvent(QMouseEvent *event);@/
|
13850
|
13850
|
};
|
13851
|
13851
|
|
13852
|
13852
|
@ Note the similarity between this constructor and the the |ScaleControl|
|
|
@@ -13932,7 +13932,7 @@ void IntensityControl::setValue(double val)
|
13932
|
13932
|
{
|
13933
|
13933
|
scene.addItem(&indicator);
|
13934
|
13934
|
}
|
13935
|
|
- valueSet = true;
|
|
13935
|
+ valueSet = @[true@];
|
13936
|
13936
|
indicator.setPos(6, (100 - (val * 10)) + 16);
|
13937
|
13937
|
emit(valueChanged(val));
|
13938
|
13938
|
}
|
|
@@ -13958,7 +13958,7 @@ that the button has been pressed.
|
13958
|
13958
|
void IntensityControl::mousePressEvent(QMouseEvent *event)
|
13959
|
13959
|
{
|
13960
|
13960
|
@<Check that the left button was pressed@>@;
|
13961
|
|
- scaleDown = true;
|
|
13961
|
+ scaleDown = @[true@];
|
13962
|
13962
|
event->accept();
|
13963
|
13963
|
}
|
13964
|
13964
|
|
|
@@ -13977,7 +13977,7 @@ void IntensityControl::mouseReleaseEvent(QMouseEvent *event)
|
13977
|
13977
|
event->ignore();
|
13978
|
13978
|
return;
|
13979
|
13979
|
}
|
13980
|
|
- scaleDown = false;
|
|
13980
|
+ scaleDown = @[false@];
|
13981
|
13981
|
QPointF sceneCoordinate = mapToScene(event->x(), event->y());
|
13982
|
13982
|
if(sceneCoordinate.x() >= 0 && sceneCoordinate.x() <= 16)
|
13983
|
13983
|
{
|