From 6fa57b79c11e9c015db84b9164d95a0d76da3123 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 24 Nov 2020 17:25:59 +0100 Subject: [PATCH] Doc: Describe using NOT check box in Binding Editor To use the NOT operator. Move the summary of logical operators into an include file and include it in both the States and Binding Editor docs. Fixes: QDS-3163 Change-Id: I8547c3dee50db35cf7d3037df84de7fe2d24ac3c Reviewed-by: Thomas Hartmann --- .../qtquick-states-binding-editor-not.png | Bin 0 -> 3256 bytes .../images/qtquick-states-binding-editor.png | Bin 3422 -> 3065 bytes .../qtquick/creator-logical-operators.qdocinc | 91 ++++++++++++++++++ .../qtquick-connection-editor-bindings.qdoc | 3 + doc/qtcreator/src/qtquick/qtquick-states.qdoc | 68 ++----------- 5 files changed, 100 insertions(+), 62 deletions(-) create mode 100644 doc/qtcreator/images/qtquick-states-binding-editor-not.png create mode 100644 doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc diff --git a/doc/qtcreator/images/qtquick-states-binding-editor-not.png b/doc/qtcreator/images/qtquick-states-binding-editor-not.png new file mode 100644 index 0000000000000000000000000000000000000000..334ddec39e66c4a9b8b05accae8f41eef04a58df GIT binary patch literal 3256 zcmeAS@N?(olHy`uVBq!ia0y~yU|hw(z_5aYiGhK^F347nfq|#q)5S5Q;?~=_xATOr z%eDWO+k4_+Qgchjf`v;}-Gzm3Th37N<5l6^qR25xHp_j{ie)04n!ZQ+jvD4DZgG^3 z+%(%+^?_3O#77qV7p(REi2N4(R-a}wPqO-$#EB)}e*AtJJi|23_}iyHe^Yhm9GU;O zS-?rkX#PhL0jCS{iY*K5oj4rpTLhZ^aVWC<6?EeGrQ9O$#hpX(ML$HrmDT^EqN8We zo^7wrE4lNFuCDGCwx0_QedzeNWZ%=(_uuokA5QmdcGcSz^D9X*KzhlnLm&G79rkGbv~9&&soxGJ5)Uh~PG$CS;^ zmSw6vZjFs#;p9+U~AnE_K~LS(p9u!)gD1&GS+7UU;P-(c)!(RaMloy6t&)i{35c@Si%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??2MGf=oeJqQUFNa^t8!7*8e4?!FG3)vZXWFGOMwi^`QIc&82dj5aqulwfr z|GnQYdPCyD$?X3Vzw^l0)%n@va z*TH!1&X4``YWp`Gzy9&#$DKQO203;vJj&27V;LmBW(V_8b-v8>)8glJ`m<2y@UC%$oKO5_Lg}?wF_E&#D)%kIz z-S3CT>;Jtz_Uzf=_xt|+_h1I(6S)hw5bW_3y0gvTm?FQv2}F)W`Yr-YpK_ck9Qy%h!(D+uZx{ zNWOpn&zFaL*XxzV-!=z%+rIeOnb-P$m3yNiGvkBfBG;>|SwBTOJM7x^@K@T`Ps>Ix zmAYT{$I;`&)Ub%eD|Jth2-Hk z`FFy#uBL5>u3Rq|ewA5vXx z740hsf2`v(LHc`NiTd%^SG~N}{(8ih@V?OA^s0ZhtiS%h(~H-(??1n8PgQyH=XXz6 z+S#|geN^}B%ge?3=l(=(-DP%v-=a--_Fai8E!i1#d)G&Iuj5C*Asp~rO#kn_qFyIp4qd*-`AJd`A+hTM|?co!T-PI)KumDdhF zw%dPsj^xjimX(#2mewx2ncQILvpw7<(oqB#cR~C;ho5j!L|1CdW zoPPKGfrZZPkFLAPTbJb&6&0;oaO6T#gW;Kp69o&|+m^k*zOT>u){`gIg}sd5bgJii z+-qcJkJB_UJTP}k>>b7hGdipp5G@o)R|MJ{fp$gS^!;Z~3p~+lyYMat0|Nttr>mdK II;Vst0N*+zs{jB1 diff --git a/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc b/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc new file mode 100644 index 00000000000..a8bd94c4621 --- /dev/null +++ b/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! +//! [logical operators] + \section2 Summary of Logical Operators + + You can use the following + \l{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators} + {logical operators} in the expressions to combine several conditions in one + expression: + + \table + \header + \li Operator + \li Meaning + \li Evaluates to \c true if + \row + \li ! + \li NOT + \li The condition is not met. + \row + \li && + \li AND + \li Both conditions are met. + \row + \li || + \li OR + \li Either of the conditions is met. + \row + \li < + \li Less than + \li The left operand is less than the right operand. + \row + \li > + \li Greater than + \li The left operand is greater than the right operand. + \row + \li >= + \li Greater than or equal + \li The left operand is greater than or equal to the right operand. + \row + \li <= + \li Less than or equal + \li The left operand is less than or equal to the right operand. + \row + \li == + \li Equal + \li The operands are equal. + \row + \li === + \li Strict equal + \li The operands are equal and of the same type. + \row + \li != + \li Not equal + \li The operands are not equal. + \row + \li !== + \li Strict not equal + \li The operands are of the same type but not equal, or are of + different type. + \endtable + + In addition, you can use arithmetic operators to compare numbers before + checks. However, we recommend that you create separate properties for this + purpose whenever possible. +//! [logical operators] +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc b/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc index d3139ce23b9..b0d2751b08f 100644 --- a/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc @@ -71,4 +71,7 @@ \uicontrol {Binding Editor}. For more information, see \l{Setting Bindings}. \image qmldesigner-binding-editor.png "Binding Editor" + + \include creator-logical-operators.qdocinc logical operators + */ diff --git a/doc/qtcreator/src/qtquick/qtquick-states.qdoc b/doc/qtcreator/src/qtquick/qtquick-states.qdoc index 0c5247b8432..5e17e6f7083 100644 --- a/doc/qtcreator/src/qtquick/qtquick-states.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-states.qdoc @@ -125,68 +125,7 @@ \l{Completing Code}{code completion} feature lists the components and their properties you can use in the expressions. - \section2 Summary of Logical Operators - - You can use the following - \l{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators} - {logical operators} in the expressions to combine several conditions in one - expression: - - \table - \header - \li Operator - \li Meaning - \li Evaluates to \c true if - \row - \li ! - \li NOT - \li The condition is not met. - \row - \li && - \li AND - \li Both conditions are met. - \row - \li || - \li OR - \li Either of the conditions is met. - \row - \li < - \li Less than - \li The left operand is less than the right operand. - \row - \li > - \li Greater than - \li The left operand is greater than the right operand. - \row - \li >= - \li Greater than or equal - \li The left operand is greater than or equal to the right operand. - \row - \li <= - \li Less than or equal - \li The left operand is less than or equal to the right operand. - \row - \li == - \li Equal - \li The operands are equal. - \row - \li === - \li Strict equal - \li The operands are equal and of the same type. - \row - \li != - \li Not equal - \li The operands are not equal. - \row - \li !== - \li Strict not equal - \li The operands are of the same type but not equal, or are of - different type. - \endtable - - In addition, you can use arithmetic operators to compare numbers before - checks. However, we recommend that you create separate properties for this - purpose whenever possible. + \include creator-logical-operators.qdocinc logical operators \section2 Examples of when Conditions @@ -197,6 +136,11 @@ when: control.pressed \endcode + To apply a state when the button is not pressed, select the \uicontrol NOT + check box. + + \image qtquick-states-binding-editor-not.png "NOT check box in Binding Editor" + To apply a state when the button is not pressed, selected, nor hovered on, you could combine conditions, as follows: