blob: 051b23a88a598895efbea14f4a09be6eb6fb6de5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
#ifndef WBASEWIDGET_H
#define WBASEWIDGET_H
#include <QString>
#include <QWidget>
#include <QList>
class ControlWidgetPropertyConnection;
class ControlParameterWidgetConnection;
class WBaseWidget {
public:
WBaseWidget(QWidget* pWidget);
virtual ~WBaseWidget();
void Init();
QWidget* toQWidget() {
return m_pWidget;
}
void setBaseTooltip(const QString& tooltip) {
m_baseTooltip = tooltip;
m_pWidget->setToolTip(tooltip);
}
QString baseTooltip() const {
return m_baseTooltip;
}
void addLeftConnection(ControlParameterWidgetConnection* pConnection);
void addRightConnection(ControlParameterWidgetConnection* pConnection);
void addConnection(ControlParameterWidgetConnection* pConnection);
void addPropertyConnection(ControlWidgetPropertyConnection* pConnection);
// Set a ControlWidgetConnection to be the display connection for the
// widget. The connection should also be added via an addConnection method
// or it will not be deleted or receive updates.
void setDisplayConnection(ControlParameterWidgetConnection* pConnection);
double getControlParameter() const;
double getControlParameterLeft() const;
double getControlParameterRight() const;
double getControlParameterDisplay() const;
protected:
virtual void onConnectedControlValueChanged(double v) {
Q_UNUSED(v);
}
void resetControlParameter();
void setControlParameter(double v);
void setControlParameterLeftDown(double v);
void setControlParameterLeftUp(double v);
void setControlParameterRightDown(double v);
void setControlParameterRightUp(double v);
// Tooltip handling. We support "debug tooltips" which are basically a way
// to expose debug information about widgets via the tooltip. To enable
// this, when widgets should call updateTooltip before they are about to
// display a tooltip.
void updateTooltip();
virtual void fillDebugTooltip(QStringList* debug);
protected:
QList<ControlParameterWidgetConnection*> m_connections;
ControlParameterWidgetConnection* m_pDisplayConnection;
QList<ControlParameterWidgetConnection*> m_leftConnections;
QList<ControlParameterWidgetConnection*> m_rightConnections;
QList<ControlWidgetPropertyConnection*> m_propertyConnections;
private:
QWidget* m_pWidget;
QString m_baseTooltip;
friend class ControlParameterWidgetConnection;
};
#endif /* WBASEWIDGET_H */
|