7#ifndef TOOLBARLAYOUTDELEGATE_H
8#define TOOLBARLAYOUTDELEGATE_H
10#include "displayhint.h"
11#include <QQmlIncubator>
23 ToolBarDelegateIncubator(QQmlComponent *component, QQmlContext *context);
25 void setStateCallback(std::function<
void(QQuickItem *)> callback);
26 void setCompletedCallback(std::function<
void(ToolBarDelegateIncubator *)> callback);
33 void setInitialState(QObject *
object)
override;
36 QQmlComponent *m_component;
37 QQmlContext *m_context;
38 std::function<void(QQuickItem *)> m_stateCallback;
39 std::function<void(ToolBarDelegateIncubator *)> m_completedCallback;
40 bool m_finished =
false;
48class ToolBarLayoutDelegate :
public QObject
52 ToolBarLayoutDelegate(ToolBarLayout *
parent);
53 ~ToolBarLayoutDelegate()
override;
56 void setAction(
QObject *action);
57 void createItems(QQmlComponent *fullComponent, QQmlComponent *iconComponent, std::function<
void(QQuickItem *)> callback);
60 bool isActionVisible()
const;
61 bool isHidden()
const;
62 bool isIconOnly()
const;
63 bool isKeepVisible()
const;
65 bool isVisible()
const;
72 void setPosition(qreal x, qreal y);
73 void setHeight(qreal height);
78 qreal implicitWidth()
const;
79 qreal implicitHeight()
const;
80 qreal maxHeight()
const;
81 qreal iconWidth()
const;
82 qreal fullWidth()
const;
85 Q_SLOT void actionVisibleChanged();
86 Q_SLOT void displayHintChanged();
87 inline void ensureItemVisibility()
90 m_full->setVisible(m_fullVisible);
93 m_icon->setVisible(m_iconVisible);
96 void cleanupIncubators();
97 void triggerRelayout();
99 ToolBarLayout *m_parent =
nullptr;
101 QQuickItem *m_full =
nullptr;
102 QQuickItem *m_icon =
nullptr;
103 ToolBarDelegateIncubator *m_fullIncubator =
nullptr;
104 ToolBarDelegateIncubator *m_iconIncubator =
nullptr;
106 DisplayHint::DisplayHints m_displayHint = DisplayHint::NoPreference;
107 bool m_ready =
false;
108 bool m_actionVisible =
true;
109 bool m_fullVisible =
false;
110 bool m_iconVisible =
false;
QObject * parent() const const
Status status() const const