mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Added default property to QmlPluginInterface for creating child items
This commit is contained in:
parent
c94976bf01
commit
d3a56e0b4e
@ -188,6 +188,11 @@ void QmlPluginInterface::setPopulateWebViewMenu(const QJSValue &value)
|
|||||||
m_populateWebViewMenu = value;
|
m_populateWebViewMenu = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QQmlListProperty<QObject> QmlPluginInterface::childItems()
|
||||||
|
{
|
||||||
|
return QQmlListProperty<QObject>(this, m_childItems);
|
||||||
|
}
|
||||||
|
|
||||||
void QmlPluginInterface::addButton(BrowserWindow *window)
|
void QmlPluginInterface::addButton(BrowserWindow *window)
|
||||||
{
|
{
|
||||||
if (m_browserAction->location().testFlag(QmlBrowserAction::NavigationToolBar)) {
|
if (m_browserAction->location().testFlag(QmlBrowserAction::NavigationToolBar)) {
|
||||||
|
@ -36,6 +36,8 @@ class QmlPluginInterface : public QObject, public PluginInterface
|
|||||||
Q_PROPERTY(QmlBrowserAction* browserAction READ browserAction WRITE setBrowserAction)
|
Q_PROPERTY(QmlBrowserAction* browserAction READ browserAction WRITE setBrowserAction)
|
||||||
Q_PROPERTY(QmlSideBar* sideBar READ sideBar WRITE setSideBar)
|
Q_PROPERTY(QmlSideBar* sideBar READ sideBar WRITE setSideBar)
|
||||||
Q_PROPERTY(QJSValue populateWebViewMenu READ readPopulateWebViewMenu WRITE setPopulateWebViewMenu)
|
Q_PROPERTY(QJSValue populateWebViewMenu READ readPopulateWebViewMenu WRITE setPopulateWebViewMenu)
|
||||||
|
Q_PROPERTY(QQmlListProperty<QObject> childItems READ childItems)
|
||||||
|
Q_CLASSINFO("DefaultProperty", "childItems")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QmlPluginInterface();
|
explicit QmlPluginInterface();
|
||||||
@ -59,6 +61,7 @@ private:
|
|||||||
QmlBrowserAction *m_browserAction;
|
QmlBrowserAction *m_browserAction;
|
||||||
QmlSideBar *m_sideBar;
|
QmlSideBar *m_sideBar;
|
||||||
QJSValue m_populateWebViewMenu;
|
QJSValue m_populateWebViewMenu;
|
||||||
|
QList<QObject*> m_childItems;
|
||||||
|
|
||||||
QJSValue readInit() const;
|
QJSValue readInit() const;
|
||||||
void setInit(const QJSValue &init);
|
void setInit(const QJSValue &init);
|
||||||
@ -72,6 +75,7 @@ private:
|
|||||||
void setSideBar(QmlSideBar *sideBar);
|
void setSideBar(QmlSideBar *sideBar);
|
||||||
QJSValue readPopulateWebViewMenu() const;
|
QJSValue readPopulateWebViewMenu() const;
|
||||||
void setPopulateWebViewMenu(const QJSValue &value);
|
void setPopulateWebViewMenu(const QJSValue &value);
|
||||||
|
QQmlListProperty<QObject> childItems();
|
||||||
|
|
||||||
void addButton(BrowserWindow *window);
|
void addButton(BrowserWindow *window);
|
||||||
void removeButton(BrowserWindow *window);
|
void removeButton(BrowserWindow *window);
|
||||||
|
Loading…
Reference in New Issue
Block a user