26#include <QQuickWidget>
49 const QList<BrowserWindow*> windows =
mApp->windows();
57 const QList<BrowserWindow*> windows =
mApp->windows();
78void QmlBrowserAction::setIdentity(
const QString &identity)
89void QmlBrowserAction::setName(
const QString &name)
100void QmlBrowserAction::setTitle(
const QString &title)
111void QmlBrowserAction::setToolTip(
const QString &toolTip)
122void QmlBrowserAction::setIcon(
const QString &icon)
133void QmlBrowserAction::setBadgeText(
const QString &badgeText)
144void QmlBrowserAction::setPopup(QQmlComponent *popup)
150void QmlBrowserAction::setLocation(
const Locations &locations)
152 m_locations = locations;
220 auto qmlEngine = qobject_cast<QmlEngine*>(m_popup->creationContext()->engine());
224 const QString pluginPath = qmlEngine->extensionPath();
242 qWarning() <<
"No popup to show";
246 auto *quickWidget =
new QQuickWidget();
247 quickWidget->setContent(m_popup->url(), m_popup, m_popup->create(m_popup->creationContext()));
249 auto *widget =
new QWidget();
250 quickWidget->setParent(widget);
252 widget->setWindowFlag(Qt::Popup);
253 widget->setAttribute(Qt::WA_DeleteOnClose);
256 connect(quickWidget, &QQuickWidget::destroyed,
this, [clickController]{
NavigationBar * navigationBar() const
StatusBar * statusBar() const
void removeToolButton(AbstractButtonInterface *button)
void addToolButton(AbstractButtonInterface *button)
void mainWindowCreated(BrowserWindow *window)
QString identity
identity for the button. This is a required property.
@ NavigationToolBar
to add the button in navigation tool bar
QQmlComponent * popup
the popup shown when the button is clicked. This must be a QML Window.
void badgeTextChanged(const QString &badgeText)
This signal is emitted when the badgeText property is changed.
QString title
title of the button.
QString icon
icon path of button
QString name
name of the button. This is a required property.
void identityChanged(const QString &identity)
This signal is emitted when identity property is changed.
void titleChanged(const QString &title)
This signal is emitted when title property is changed.
void toolTipChanged(const QString &toolTip)
This signal is emitted when the toolTip property is changed.
QmlBrowserActionButton * button() const
~QmlBrowserAction() override
QString toolTip
tool tip of the button.
void nameChanged(const QString &name)
This signal is emitted when name property is changed.
void iconChanged(const QString &icon)
This signal is emitted when the icon property is changed.
void locationChanged(const Locations &locations)
This signal is emitted when the locations property is changed.
QString badgeText
badge text of the button
void clicked()
This signal is emitted when the button is clicked.
void componentComplete() override
Locations location
represents locations where the button is to be added.
QmlBrowserAction(QObject *parent=nullptr)
void popupChanged(QQmlComponent *popup)
This signal is emitted when the popup property is changed.
static QmlStaticData & instance()
QIcon getIcon(const QString &iconPath, const QString &pluginPath)
void addButton(AbstractButtonInterface *button)
void removeButton(AbstractButtonInterface *button)