4#ifndef QWASMWINDOWTREENODE_INC
5#define QWASMWINDOWTREENODE_INC
21 auto *
window = asWasmWindow();
23 previousParent->m_childStack.removeWindow(
window);
29 currentParent->m_childStack.pushWindow(
window, positionPreference);
46 && m_childStack.topWindow()
47 && m_childStack.topWindow()->window()) {
49 const auto flags = m_childStack.topWindow()->window()->flags();
51 const QVariant showWithoutActivating = m_childStack.topWindow()->window()->property(
"_q_showWithoutActivating");
52 if (!showWithoutActivating.
isValid() || !showWithoutActivating.
toBool()) {
54 m_childStack.topWindow()->requestActivateWindow();
59 parentNode()->onSubtreeChanged(changeType, parent,
child);
73 parentNode()->m_childStack.windowPositionPreferenceChanged(asWasmWindow(),
82 parentNode()->setActiveChildNode(asWasmWindow());
85 m_activeIndex = ++s_nextActiveIndex;
93 parentNode()->m_childStack.raise(asWasmWindow());
94 parentNode()->bringToTop();
102 m_childStack.lower(asWasmWindow());
105template<
class Window>
106void QWasmWindowTreeNode<Window>::onTopWindowChanged()
108 constexpr int zOrderForElementInFrontOfScreen = 3;
109 int z = zOrderForElementInFrontOfScreen;
110 std::for_each(m_childStack.rbegin(), m_childStack.rend(),
111 [
this, &
z](
Window *
window) { setWindowZOrder(window, z++); });
114template<
class Window>
115void QWasmWindowTreeNode<Window>::setActiveChildNode(
Window *activeChild)
117 m_activeChild = activeChild;
119 auto it = m_childStack.begin();
120 if (
it == m_childStack.end())
122 for (;
it != m_childStack.end(); ++
it)
123 (*it)->onActivationChanged(*
it == m_activeChild);
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
virtual void setWindowZOrder(Window *window, int z)
void onPositionPreferenceChanged(typename QWasmWindowStack< Window >::PositionPreference positionPreference)
virtual Window * asWasmWindow()
virtual ~QWasmWindowTreeNode()
virtual void onSubtreeChanged(QWasmWindowTreeNodeChangeType changeType, QWasmWindowTreeNode *parent, Window *child)
virtual void onParentChanged(QWasmWindowTreeNode *previous, QWasmWindowTreeNode *current, typename QWasmWindowStack< Window >::PositionPreference positionPreference)
[Window class with invokable method]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
QWasmWindowTreeNodeChangeType
socketLayer bind(QHostAddress::Any, 4000)
QJSValueIterator it(object)