History

add removeButton API to ToolbarScriptingInterface

Stephen Birarda committed 10 years ago

Commit 345478e1 parent 39c78051 file · +6 −2Browse files

Showing the changes to interface/src/scripting/ToolbarScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

interface/src/scripting/ToolbarScriptingInterface.cpp+6−2
@@ -14,7 +14,7 @@ class QmlWrapper : public QObject { · 13 unmodified lines
1414 Q_OBJECT
1515 public:
1616 QmlWrapper(QObject* qmlObject, QObject* parent = nullptr)
17− : QObject(parent), _qmlObject(qmlObject) {
17+ : QObject(parent), _qmlObject(qmlObject) {
1818 }
1919
2020 Q_INVOKABLE void writeProperty(QString propertyName, QVariant propertyValue) {
@@ -91,6 +91,10 @@ public: · 70 unmodified lines
9191
9292 return new ToolbarButtonProxy(rawButton, this);
9393 }
94+
95+ Q_INVOKABLE void removeButton(const QVariant& name) {
96+ QMetaObject::invokeMethod(_qmlObject, "removeButton", Qt::AutoConnection, Q_ARG(QVariant, name));
97+ }
9498 };
9599
96100
@@ -112,4 +116,4 @@ QObject* ToolbarScriptingInterface::getToolbar(const QString& toolbarId) { · 15 unmodified lines
112116 }
113117
114118
115−#include "ToolbarScriptingInterface.moc"
119+#include "ToolbarScriptingInterface.moc"