update
This commit is contained in:
@@ -4,11 +4,10 @@
|
||||
|
||||
class QDoubleSpinBox;
|
||||
class QSlider;
|
||||
class QLabel;
|
||||
class QSpinBox;
|
||||
|
||||
namespace gui {
|
||||
|
||||
// 0..1 浮点参数:Slider + DoubleSpinBox(可复用)
|
||||
class Float01ParamControl final : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -31,15 +30,43 @@ private:
|
||||
bool m_block = false;
|
||||
};
|
||||
|
||||
// Vec2 参数:两个 DoubleSpinBox(可复用)
|
||||
class Vec2ParamControl final : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Vec2ParamControl(QWidget* parent = nullptr);
|
||||
|
||||
void setValue(int x, int y);
|
||||
[[nodiscard]] int x() const;
|
||||
[[nodiscard]] int y() const;
|
||||
|
||||
[[nodiscard]] bool isActivelyEditing() const;
|
||||
|
||||
void setEnabled(bool on);
|
||||
|
||||
signals:
|
||||
void valueChanged(int x, int y);
|
||||
|
||||
private:
|
||||
void emitIfChanged();
|
||||
|
||||
QSpinBox* m_sx = nullptr;
|
||||
QSpinBox* m_sy = nullptr;
|
||||
bool m_block = false;
|
||||
int m_lastX = 0;
|
||||
int m_lastY = 0;
|
||||
};
|
||||
|
||||
/// 世界坐标等:可直接键盘输入小数,带宽幅
|
||||
class Vec2DoubleParamControl final : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Vec2DoubleParamControl(QWidget* parent = nullptr);
|
||||
|
||||
void setValue(double x, double y);
|
||||
double x() const;
|
||||
double y() const;
|
||||
[[nodiscard]] double x() const;
|
||||
[[nodiscard]] double y() const;
|
||||
|
||||
[[nodiscard]] bool isActivelyEditing() const;
|
||||
|
||||
void setEnabled(bool on);
|
||||
|
||||
@@ -49,12 +76,11 @@ signals:
|
||||
private:
|
||||
void emitIfChanged();
|
||||
|
||||
QDoubleSpinBox* m_x = nullptr;
|
||||
QDoubleSpinBox* m_y = nullptr;
|
||||
QDoubleSpinBox* m_sx = nullptr;
|
||||
QDoubleSpinBox* m_sy = nullptr;
|
||||
bool m_block = false;
|
||||
double m_lastX = 0.0;
|
||||
double m_lastY = 0.0;
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
|
||||
|
||||
Reference in New Issue
Block a user