Skip to content

Commit 652e53d

Browse files
committed
core docs
1 parent d311453 commit 652e53d

3 files changed

Lines changed: 17 additions & 20 deletions

File tree

_sources/edifice.rst.txt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ There is a lot of imperative and object-oriented Qt API which is meaningless
5757
or unnecessary in Edifice. In a normal Edifice application you will never (rarely)
5858
“inherit” from a class or override a “virtual” method.
5959

60-
You never “delete” or “remove” a widget in Edifice, instead you just conditionally
61-
declare it. When the condition is no longer true the widget will be removed.
60+
You never “add” or “remove” a widget in Edifice, instead you conditionally
61+
render it. When the condition is no longer true the widget will be removed,
62+
see :ref:`Dynamic Rendering`.
6263

6364
`QWidgets <https://doc.qt.io/qtforpython-6/api/qtwidgets/qwidget.html>`_
6465
are stateful objects but Edifice is designed to provide a
@@ -77,22 +78,18 @@ Reactive
7778

7879
For handling :ref:`Events`, pass a event-handling function as a **prop**.
7980

80-
Do not use Signal and Slots.
81-
The
81+
Never (rarely) use Signals and Slots. The
8282
`Signals and Slots <https://doc.qt.io/qtforpython-6/tutorials/basictutorial/signals_and_slots.html>`_
8383
tutorial explains that
8484
“Due to the nature of Qt, QObjects require a way to communicate” but
85-
due to the nature of Edifice, QObjects are forbidden to communicate
86-
because they are stateless and therefore have nothing to say.
85+
due to the nature of Edifice, QObjects are mostly forbidden to communicate
86+
because it would violate the *one-way information flow* of :ref:`Model-View-Update`.
8787

8888
Application state is managed with :func:`use_state` Hooks.
8989

9090
Application side-effects triggered by state changes are performed by
9191
:func:`use_effect` and :func:`use_async` Hooks.
9292

93-
For more more information about Edifice reactivity see
94-
:ref:`Model-View-Update`.
95-
9693
Rules of Edifice
9794
----------------
9895

@@ -196,7 +193,8 @@ which has child Elements representing different parts of your application.
196193
Dynamic Rendering
197194
^^^^^^^^^^^^^^^^^
198195

199-
For dynamism, use conditions and loops in your rendering declaration.
196+
For dynamism, use conditions and loops in your :func:`@component <component>`
197+
render function.
200198
The conditions and loops can depend on **props** or **state**. For example,
201199
this :func:`@component <component>` will render input fields only while
202200
the **props** indicate that they are wanted.

edifice.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,9 @@ <h3>Declarative<a class="headerlink" href="#declarative" title="Link to this hea
444444
<p>There is a lot of imperative and object-oriented Qt API which is meaningless
445445
or unnecessary in Edifice. In a normal Edifice application you will never (rarely)
446446
“inherit” from a class or override a “virtual” method.</p>
447-
<p>You never “delete” or “remove” a widget in Edifice, instead you just conditionally
448-
declare it. When the condition is no longer true the widget will be removed.</p>
447+
<p>You never “add” or “remove” a widget in Edifice, instead you conditionally
448+
render it. When the condition is no longer true the widget will be removed,
449+
see <a class="reference internal" href="#dynamic-rendering"><span class="std std-ref">Dynamic Rendering</span></a>.</p>
449450
<p><a class="reference external" href="https://doc.qt.io/qtforpython-6/api/qtwidgets/qwidget.html">QWidgets</a>
450451
are stateful objects but Edifice is designed to provide a
451452
<em>stateless</em> API for QWidgets. Each <a class="reference internal" href="base_components.html"><span class="doc">Base Element</span></a> wraps
@@ -459,18 +460,15 @@ <h3>Declarative<a class="headerlink" href="#declarative" title="Link to this hea
459460
<section id="reactive">
460461
<h3>Reactive<a class="headerlink" href="#reactive" title="Link to this heading">#</a></h3>
461462
<p>For handling <a class="reference internal" href="base_components.html#events"><span class="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
464464
<a class="reference external" href="https://doc.qt.io/qtforpython-6/tutorials/basictutorial/signals_and_slots.html">Signals and Slots</a>
465465
tutorial explains that
466466
“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 <a class="reference internal" href="#model-view-update"><span class="std std-ref">Model-View-Update</span></a>.</p>
469469
<p>Application state is managed with <a class="reference internal" href="stubs/edifice.use_state.html#edifice.use_state" title="edifice.use_state"><code class="xref py py-func docutils literal notranslate"><span class="pre">use_state()</span></code></a> Hooks.</p>
470470
<p>Application side-effects triggered by state changes are performed by
471471
<a class="reference internal" href="stubs/edifice.use_effect.html#edifice.use_effect" title="edifice.use_effect"><code class="xref py py-func docutils literal notranslate"><span class="pre">use_effect()</span></code></a> and <a class="reference internal" href="stubs/edifice.use_async.html#edifice.use_async" title="edifice.use_async"><code class="xref py py-func docutils literal notranslate"><span class="pre">use_async()</span></code></a> Hooks.</p>
472-
<p>For more more information about Edifice reactivity see
473-
<a class="reference internal" href="#model-view-update"><span class="std std-ref">Model-View-Update</span></a>.</p>
474472
</section>
475473
</section>
476474
<section id="rules-of-edifice">
@@ -556,7 +554,8 @@ <h2>Declaring Element Trees<a class="headerlink" href="#declaring-element-trees"
556554
which has child Elements representing different parts of your application.</p>
557555
<section id="dynamic-rendering">
558556
<h3>Dynamic Rendering<a class="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 <a class="reference internal" href="stubs/edifice.component.html#edifice.component" title="edifice.component"><code class="xref py py-func docutils literal notranslate"><span class="pre">&#64;component</span></code></a>
558+
render function.
560559
The conditions and loops can depend on <strong>props</strong> or <strong>state</strong>. For example,
561560
this <a class="reference internal" href="stubs/edifice.component.html#edifice.component" title="edifice.component"><code class="xref py py-func docutils literal notranslate"><span class="pre">&#64;component</span></code></a> will render input fields only while
562561
the <strong>props</strong> indicate that they are wanted.</p>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)