VR-Forces 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  virtual bool active() const;
47 
48  virtual void setDisplayActualData(bool display);
49 
50  virtual void setTitle(const QString& title);
51 
52  boost::signals2::signal<void(double value, bool singleClick)> signal_requestedValueChanged;
53  boost::signals2::signal<void(double value)> signal_actualValueChanged;
54 
55  protected slots:
56  void mouseClickTimeout();
57  protected:
58  virtual void paintEvent(QPaintEvent *event);
59  virtual void mousePressEvent(QMouseEvent *event);
60  virtual void mouseReleaseEvent(QMouseEvent *event);
61  virtual void mouseDoubleClickEvent(QMouseEvent *event);
62  virtual void wheelEvent(QWheelEvent* event);
63 
64  virtual void drawHandle(QPainter *painter, const QRect &rect, int pos) const;
65 
66  protected:
67  double myActualValue;
68  double myExtraValue;
69 
70  bool myExtraValueEnabled;
71  QTimer* myMouseClickTimer;
72  bool mySecondClick;
73  bool myTimerStopped;
74  bool myDisplayActualData;
75  bool myActive = false;
76 
77  QString myTitle;
78  QColor myRequestedValueMarking;
79  QColor myActualValueMarking;
80  };
81 }
#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 Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)