20#include <QQmlComponent>
21#include <QQmlParserStatus>
28class QmlSideBar :
public QObject,
public QQmlParserStatus
31 Q_INTERFACES(QQmlParserStatus)
73 Q_CLASSINFO(
"DefaultProperty",
"item")
76 explicit QmlSideBar(QObject *parent =
nullptr);
120 bool m_checkable =
false;
121 QQmlComponent *m_item =
nullptr;
125 void setName(
const QString &
name);
126 QString
title()
const;
127 void setTitle(
const QString &
title);
128 QString
icon()
const;
129 void setIcon(
const QString &
icon);
131 void setShortcut(
const QString &
shortcut);
134 QQmlComponent *
item()
const;
135 void setItem(QQmlComponent *
item);
143 QString
title()
const override;
148 void setIcon(
const QString &icon);
151 void setItem(QQmlComponent *item);
157 bool m_checkable =
false;
158 QQmlComponent *m_item =
nullptr;
void setItem(QQmlComponent *item)
QAction * createMenuAction() override
void setIcon(const QString &icon)
void setTitle(const QString &title)
void setCheckable(bool checkable)
QmlSideBarHelper(QObject *parent=nullptr)
void setShortcut(const QString &shortcut)
QString title() const override
QWidget * createSideBarWidget(BrowserWindow *mainWindow) override
The class exposing SideBar API to QML.
QQmlComponent * item
the GUI of the sidebar. This must be provided as QML Window. This is a default property.
void iconChanged(const QString &icon)
This signal is emitted when icon property is changed.
QString shortcut
shortcut for the sidebar action.
SideBarInterface * sideBar() const
QmlSideBar(QObject *parent=nullptr)
QString name
name of the sidebar. This is required property.
bool checkable
represents whether the sidebar action is checkable
void checkableChanged(bool checkable)
This signal is emitted when checkable property is changed.
void nameChanged(const QString &name)
This signal is emitted when name property is changed.
void itemChanged(QQmlComponent *item)
void componentComplete() override
void titleChanged(const QString &title)
This signal is emitted when title property is changed.
QString title
title of the sidebar action.
QString icon
icon path of the sidebar action.
void shortcutChanged(const QString &shortcut)
This signal is emitted when shortcut property is changed.
void classBegin() override