QmlMaterial 0.1.0
Loading...
Searching...
No Matches
tool_separator.hpp
1#pragma once
2
3#include "qml_material/control/control.hpp"
4
5namespace qml_material
6{
7
9class QML_MATERIAL_API ToolSeparator : public Control {
10 Q_OBJECT
11 QML_NAMED_ELEMENT(ToolSeparator)
12 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY
13 orientationChanged FINAL)
14 Q_PROPERTY(bool horizontal READ horizontal NOTIFY orientationChanged FINAL)
15 Q_PROPERTY(bool vertical READ vertical NOTIFY orientationChanged FINAL)
16
17public:
18 explicit ToolSeparator(QQuickItem* parent = nullptr): Control(parent) {}
19 Qt::Orientation orientation() const { return m_orientation; }
20 bool horizontal() const { return m_orientation == Qt::Horizontal; }
21 bool vertical() const { return m_orientation == Qt::Vertical; }
22 void setOrientation(Qt::Orientation value) {
23 if (m_orientation == value) return;
24 m_orientation = value;
25 Q_EMIT orientationChanged();
26 }
27 Q_SIGNAL void orientationChanged();
28
29private:
30 Qt::Orientation m_orientation = Qt::Vertical;
31};
32
33} // namespace qml_material