Plasma Engine  2.0
Loading...
Searching...
No Matches
DoubleSpinBox.moc.h
1#pragma once
2
3#include <GuiFoundation/GuiFoundationDLL.h>
4#include <QDoubleSpinBox>
5class plVariant;
6
7class PL_GUIFOUNDATION_DLL plQtDoubleSpinBox : public QDoubleSpinBox
8{
9 Q_OBJECT
10public:
11 explicit plQtDoubleSpinBox(QWidget* pParent, bool bIntMode = false);
12
13 void SetIntMode(bool bEnable);
14
15 void setDisplaySuffix(const char* szSuffix);
16 void setDefaultValue(double value);
17 void setDefaultValue(const plVariant& val);
18 using QDoubleSpinBox::setMaximum;
19 using QDoubleSpinBox::setMinimum;
20 void setMinimum(const plVariant& val);
21 void setMaximum(const plVariant& val);
22
23 virtual QString textFromValue(double fVal) const override;
24 virtual double valueFromText(const QString& sText) const override;
25
26 void setValueInvalid();
27 void setValue(double fVal);
28 void setValue(const plVariant& val);
29 double value() const;
30
31protected:
32 virtual void focusInEvent(QFocusEvent* event) override;
33 virtual void focusOutEvent(QFocusEvent* event) override;
34 virtual void mousePressEvent(QMouseEvent* event) override;
35 virtual void mouseReleaseEvent(QMouseEvent* event) override;
36 virtual void mouseMoveEvent(QMouseEvent* event) override;
37 virtual void keyPressEvent(QKeyEvent* event) override;
38 virtual bool event(QEvent* event) override;
39
40private Q_SLOTS:
41 void onCustomContextMenuRequested();
42
43private:
44 QString m_sSuffix;
45 double m_fDefaultValue;
46 mutable double m_fDisplayedValue;
47 mutable QString m_sDisplayedText;
48 mutable bool m_bInvalid;
49 bool m_bModified;
50 bool m_bIntMode;
51 bool m_bDragging;
52 double m_fStartDragValue;
53 QPoint m_LastDragPos;
54 plInt32 m_iDragDelta;
55};
56
Definition DoubleSpinBox.moc.h:8
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44