You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
are stateful objects but Edifice is designed to provide a
451
452
<em>stateless</em> API for QWidgets. Each <aclass="reference internal" href="base_components.html"><spanclass="doc">Base Element</span></a> wraps
@@ -459,18 +460,15 @@ <h3>Declarative<a class="headerlink" href="#declarative" title="Link to this hea
459
460
<sectionid="reactive">
460
461
<h3>Reactive<aclass="headerlink" href="#reactive" title="Link to this heading">#</a></h3>
461
462
<p>For handling <aclass="reference internal" href="base_components.html#events"><spanclass="std std-ref">Events</span></a>, pass a event-handling function as a <strong>prop</strong>.</p>
462
-
<p>Do not use Signal and Slots.
463
-
The
463
+
<p>Never (rarely) use Signals and Slots. The
464
464
<aclass="reference external" href="https://doc.qt.io/qtforpython-6/tutorials/basictutorial/signals_and_slots.html">Signals and Slots</a>
465
465
tutorial explains that
466
466
“Due to the nature of Qt, QObjects require a way to communicate” but
467
-
due to the nature of Edifice, QObjects are forbidden to communicate
468
-
because they are stateless and therefore have nothing to say.</p>
467
+
due to the nature of Edifice, QObjects are mostly forbidden to communicate
468
+
because it would violate the <em>one-way information flow</em> of <aclass="reference internal" href="#model-view-update"><spanclass="std std-ref">Model-View-Update</span></a>.</p>
469
469
<p>Application state is managed with <aclass="reference internal" href="stubs/edifice.use_state.html#edifice.use_state" title="edifice.use_state"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">use_state()</span></code></a> Hooks.</p>
470
470
<p>Application side-effects triggered by state changes are performed by
@@ -556,7 +554,8 @@ <h2>Declaring Element Trees<a class="headerlink" href="#declaring-element-trees"
556
554
which has child Elements representing different parts of your application.</p>
557
555
<sectionid="dynamic-rendering">
558
556
<h3>Dynamic Rendering<aclass="headerlink" href="#dynamic-rendering" title="Link to this heading">#</a></h3>
559
-
<p>For dynamism, use conditions and loops in your rendering declaration.
557
+
<p>For dynamism, use conditions and loops in your <aclass="reference internal" href="stubs/edifice.component.html#edifice.component" title="edifice.component"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">@component</span></code></a>
558
+
render function.
560
559
The conditions and loops can depend on <strong>props</strong> or <strong>state</strong>. For example,
561
560
this <aclass="reference internal" href="stubs/edifice.component.html#edifice.component" title="edifice.component"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">@component</span></code></a> will render input fields only while
562
561
the <strong>props</strong> indicate that they are wanted.</p>
0 commit comments