VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
entityAttributeSlider.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
6 #pragma once
7 
9 
10 #include <qwt_slider.h>
11 
12 #include <boost/signals2.hpp>
13 
14 class QTimer;
15 
16 namespace makVrf
17 {
24 
26  {
27  Q_OBJECT
28  Q_PROPERTY(QColor RequestedValueMarking MEMBER myRequestedValueMarking USER true)
29  Q_PROPERTY(QColor ActualValueMarking MEMBER myActualValueMarking USER true)
30 
31  public:
32  explicit DtEntityAttributeSlider(QWidget *parent = NULL);
33  explicit DtEntityAttributeSlider(Qt::Orientation ori, QWidget *parent = NULL);
34 
35  virtual ~DtEntityAttributeSlider();
36 
37  virtual double actualValue();
38  virtual double extraValue();
39  virtual bool extraValueEnabled();
40 
41  virtual void setActualValue(double actualValue);
42  virtual void setExtraValue(double extraValue);
43  virtual void setExtraValueEnabled(bool enabled);
44 
45  virtual void setRequestedValue(double value, bool singleClick = true);
46 
47  virtual void setDisplayActualData(bool display);
48 
49  virtual void setTitle(const QString& title);
50 
51  boost::signals2::signal<void(double value, bool singleClick)> signal_requestedValueChanged;
52  boost::signals2::signal<void(double value)> signal_actualValueChanged;
53 
54  protected slots:
55  void mouseClickTimeout();
56  protected:
57  virtual void paintEvent(QPaintEvent *event);
58  virtual void mousePressEvent(QMouseEvent *event);
59  virtual void mouseReleaseEvent(QMouseEvent *event);
60  virtual void mouseDoubleClickEvent(QMouseEvent *event);
61  virtual void wheelEvent(QWheelEvent* event);
62 
63  virtual void drawHandle(QPainter *painter, const QRect &rect, int pos) const;
64 
65  protected:
66  double myActualValue;
67  double myExtraValue;
68 
69  bool myExtraValueEnabled;
70  QTimer* myMouseClickTimer;
71  bool mySecondClick;
72  bool myTimerStopped;
73  bool myDisplayActualData;
74 
75  QString myTitle;
76  QColor myRequestedValueMarking;
77  QColor myActualValueMarking;
78  };
79 }
#define DT_DLL_VRFGUICOMMONQT
Definition: vrfGuiCommonQt.h:20
A slider that is manipulated with mouse clicks, instead of the handle widget. The widget purpose is s...
Definition: entityAttributeSlider.h:25

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)