20 Q_PROPERTY( QPointF origin READ origin
21 WRITE setOrigin NOTIFY originChanged )
23 Q_PROPERTY(
bool cascading READ isCascading WRITE setCascading
24 RESET resetCascading NOTIFY cascadingChanged )
26 Q_PROPERTY(
bool wrapping READ isWrapping
27 WRITE setWrapping NOTIFY wrappingChanged )
29 Q_PROPERTY( QVector< QskLabelData > options READ options
30 WRITE setOptions NOTIFY optionsChanged )
32 Q_PROPERTY(
int currentIndex READ currentIndex
33 WRITE setCurrentIndex NOTIFY currentIndexChanged )
35 Q_PROPERTY(
int triggeredIndex READ triggeredIndex NOTIFY triggered )
37 Q_PROPERTY( QString triggeredText READ triggeredText NOTIFY triggered )
38 Q_PROPERTY( QString currentText READ currentText NOTIFY currentIndexChanged )
43 QSK_SUBCONTROLS( Panel, Segment, Cursor, Text, Icon, Separator )
44 QSK_STATES( Selected, Pressed )
46 QskMenu( QQuickItem* parentItem =
nullptr );
49 bool isCascading()
const;
50 void setCascading(
bool );
51 void resetCascading();
53 bool isWrapping()
const;
54 void setWrapping(
bool );
56 void setOrigin(
const QPointF& );
57 QPointF origin()
const;
62 int addOption(
const QString&,
const QString& );
63 int addOption(
const QUrl&,
const QString& );
67 void setOptions(
const QVector< QskLabelData >& );
68 void setOptions(
const QStringList& );
70 QVector< QskLabelData > options()
const;
73 QVector< int > separators()
const;
74 QVector< int > actions()
const;
76 int currentIndex()
const;
78 QString currentText()
const;
80 int triggeredIndex()
const;
81 QString triggeredText()
const;
85 QRectF cellRect(
int index )
const;
86 int indexAtPosition(
const QPointF& )
const;
88 bool isPressed()
const;
90 QRectF clipRect()
const override;
93 Q_INVOKABLE
int exec();
96 void wrappingChanged(
bool );
97 void cascadingChanged(
bool );
98 void originChanged(
const QPointF& );
100 void triggered(
int index );
101 void currentIndexChanged(
int );
103 void optionsChanged();
106 void setCurrentIndex(
int );
110 void keyPressEvent( QKeyEvent* )
override;
111 void keyReleaseEvent( QKeyEvent* )
override;
114 void hoverMoveEvent( QHoverEvent* )
override;
117#ifndef QT_NO_WHEELEVENT
118 void wheelEvent( QWheelEvent* )
override;
121 void mousePressEvent( QMouseEvent* )
override;
123 void mouseReleaseEvent( QMouseEvent* )
override;
128 void updateResources()
override;
132 void traverse(
int steps );
135 std::unique_ptr< PrivateData > m_data;