Qt Virtual Chart Table (QVCT)
CChartControl.hpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 #ifndef QVCT_CCHARTCONTROL_HPP
20 #define QVCT_CCHARTCONTROL_HPP
21 
22 // QT
23 #include <QPushButton>
24 #include <QSlider>
25 #include <QWidget>
26 
27 // QVCT
28 class CChartTable;
29 
30 
32 
38 class CChartControl: public QWidget
39 {
40  Q_OBJECT
41  friend class CChartTable;
42 
43 
44  //------------------------------------------------------------------------------
45  // FIELDS
46  //------------------------------------------------------------------------------
47 
48 private:
52  QPushButton* pqPushButtonScaleLock;
56  QPushButton* pqPushButtonScaleIn;
58  QPushButton* pqPushButtonScaleOut;
60  QPushButton* pqPushButtonScaleFit;
62  QPushButton* pqPushButtonTarget;
66  QPushButton* pqPushButtonMeasure;
68  QPushButton* pqPushButtonElevation;
70  QSlider* pqSliderScale;
71 
73 
75 
76 
77  //------------------------------------------------------------------------------
78  // CONSTRUCTORS / DESTRUCTOR
79  //------------------------------------------------------------------------------
80 
81 public:
82  CChartControl( QWidget* _pqParent = 0 );
83  virtual ~CChartControl() {};
84 
85 private:
87  void constructLayout();
88 
89 
90  //------------------------------------------------------------------------------
91  // METHODS
92  //------------------------------------------------------------------------------
93 
94  // SLOTS
95 private slots:
97  void slotPositionLock( bool _bLock );
99  void slotScaleLock( bool _bLock );
101  void slotScaleTo( int _iValue );
103  void slotScaleIn();
105  void slotScaleOut();
107  void slotElevation( bool _bAddOrShow );
109  void slotElevationAdd();
110 
111  // SETTERS
112 private:
114  void lockPosition( bool _bLock );
116  void lockScale( bool _bLock );
118  void setScale( double _fdScale );
120  void stepScale( bool _bIncrease, bool _bBigStep = true );
122  void enableTarget( bool _bEnable );
124  void enableMeasureSingle( bool _bEnable );
126  void enableMeasure( bool _bEnable );
128  void setElevation( bool _bHasElevation, bool _bShowElevation );
129 
130  // OTHER
131 public:
133  void enableControls( bool _bEnable );
135  void enablePointer( bool _bEnable );
136 
137 };
138 
139 #endif // QVCT_CCHARTCONTROL_HPP
[UI] Chart control user-interface
virtual ~CChartControl()
void slotScaleTo(int _iValue)
[UI:Slot] Slot to trigger scaling to the given value
QPushButton * pqPushButtonElevation
[UI:Button] Elevation model
void enableControls(bool _bEnable)
Enables/disables all chart controls.
void slotScaleIn()
[UI:Slot] Slot to trigger scale in (zoom out)
QSlider * pqSliderScale
[UI:Button] Scale slider
void stepScale(bool _bIncrease, bool _bBigStep=true)
Increases/decreases the scale by discrete steps.
void enablePointer(bool _bEnable)
Enables/disables pointer actions.
void slotElevation(bool _bAddOrShow)
[UI:Slot] Slot to manage elevation model (add, view, hide)
void slotPositionLock(bool _bLock)
[UI:Slot] Slot to modify the position lock/unlock status
QPushButton * pqPushButtonMeasure
[UI:Button] Ongoing measurements
bool bPointerEnable
Pointer actions activation status.
QPushButton * pqPushButtonScaleIn
[UI:Button] Scale in (zoom out)
void slotScaleLock(bool _bLock)
[UI:Slot] Slot to modify the scale lock/unlock status
void constructLayout()
Constructs the layout of the user-interface.
void slotElevationAdd()
[UI:Slot] Slot to add elevation model
void setScale(double _fdScale)
Sets the scale at the given value.
QPushButton * pqPushButtonScaleFit
[UI:Button] Scale fit
void slotScaleOut()
[UI:Slot] Slot to trigger scale out (zoom in)
QPushButton * pqPushButtonScaleLock
[UI:Button] Lock/unlock scale
void enableMeasureSingle(bool _bEnable)
Enables/disables single measurement.
void setElevation(bool _bHasElevation, bool _bShowElevation)
Sets elevation status.
void lockScale(bool _bLock)
Sets the scale lock/unlock status.
QPushButton * pqPushButtonPositionLock
[UI:Button] Lock/unlock position
void enableTarget(bool _bEnable)
Enables/disables target.
CChartControl(QWidget *_pqParent=0)
QPushButton * pqPushButtonScaleActual
[UI:Button] Scale actual
void enableMeasure(bool _bEnable)
Enables/disables ongoing measurements.
QPushButton * pqPushButtonTarget
[UI:Button] Target
QPushButton * pqPushButtonMeasureSingle
[UI:Button] Single measurement
void lockPosition(bool _bLock)
Sets the position lock/unlock status.
QPushButton * pqPushButtonScaleOut
[UI:Button] Scale out (zoom in)
[UI] Virtual "chart table" (view)
Definition: CChartTable.hpp:55