13#include <adtfjavascriptfiltersdk/qtquick_filter.h>
14#include <adtfbase/error_handling_intf.h>
18#include <adtfstreaming3/graph_element_editors.h>
20#include <QGuiApplication>
23#include <QQuickWidget>
36 cQtSubWindow(QString strName)
38 m_strTitle = strName.toStdString().c_str();
41 ~cQtSubWindow()
override
47 m_pView =
new QQuickView();
48 m_pView->setSource(QUrl::fromLocalFile(
"empty.qml"));
49 m_pView->setResizeMode(QQuickView::SizeRootObjectToView);
50 QWidget* pContainer = QWidget::createWindowContainer(m_pView);
51 pContainer->setObjectName(m_strTitle->GetPtr());
64 adtf::base::property_variable<adtf::util::cString>& GetTitle()
69 QQuickView* m_pView =
nullptr;
72class cQtSubWindowCreator :
public QObject
80 ~cQtSubWindowCreator() noexcept
override
82 if (IS_OK(_runtime->GetObject(m_pXSystem)))
84 for (
auto& pContainer : m_lstContainers)
86 m_pXSystem->DestroyWindow(*pContainer);
91 Q_INVOKABLE QQuickItem* CreateWindow(QString strName)
93 if (IS_OK(_runtime->GetObject(m_pXSystem)))
95 auto pSubWindow = std::make_unique<cQtSubWindow>(strName);
96 m_pXSystem->CreateWindow(*pSubWindow);
98 auto pView = pSubWindow->m_pView;
99 m_lstContainers.push_back(std::move(pSubWindow));
101 return pView->rootObject();
107 std::vector<std::unique_ptr<cQtSubWindow>> m_lstContainers;
108 adtf::ucom::object_ptr<adtf::ui::IQtXSystem> m_pXSystem;
virtual QWidget * CreateView()=0
virtual void ReleaseView()=0
Definition xsystem_qtwindow.h:231