Warning, /sdk/cutehmi/extensions/CuteHMI/Examples/Symbols/Pipes/Piping.2/View.qml is written in an unsupported language. File is not indexed.

0001 import QtQml 2.2
0002 import QtQuick 2.11
0003 import QtQuick.Controls 2.4
0004 import QtQuick.Layouts 1.3
0005 
0006 import CuteHMI.GUI 1.0
0007 import CuteHMI.Symbols.Pipes 1.0
0008 
0009 /**
0010   %View component.
0011 */
0012 Rectangle {
0013         id: root
0014 
0015         anchors.fill: parent
0016 
0017         color: Theme.palette.background
0018 
0019         Pipe {
0020                 from: PipeConnector {
0021                         x: 20
0022                         y: 20
0023                 }
0024 
0025                 to: PipeConnector {
0026                         x: 200
0027                         y: 20
0028                 }
0029         }
0030 
0031         PipeConnector {
0032                 id: verticalA
0033 
0034                 x: 300
0035                 y: 20
0036         }
0037 
0038         PipeConnector {
0039                 id: verticalB
0040                 x: 300
0041                 y: 200
0042         }
0043 
0044         Pipe {
0045                 from: verticalA
0046                 to: verticalB
0047         }
0048 
0049         //! [Red rectangle]
0050         Rectangle {
0051                 id: red
0052 
0053                 x: 400
0054                 y: 20
0055 
0056                 width: 40
0057                 height: 40
0058                 color: "red"
0059                 border.width: 1
0060 
0061                 //! [Red rectangle outlet property]
0062                 property PipeConnector outlet: PipeConnector {
0063                         x: 40
0064                         y: 20
0065                         parent: red
0066                 }
0067                 //! [Red rectangle outlet property]
0068         }
0069         //! [Red rectangle]
0070 
0071         Rectangle {
0072                 id: blue
0073 
0074                 x: 600
0075                 y: 20
0076 
0077                 width: 40
0078                 height: 40
0079                 color: "blue"
0080                 border.width: 1
0081 
0082                 property PipeConnector inlet: PipeConnector {
0083                         x: 0
0084                         y: 20
0085                         parent: blue
0086                 }
0087         }
0088 
0089         //! [Red-blue pipe]
0090         Pipe {
0091                 from: red.outlet
0092                 to: blue.inlet
0093 
0094                 color.interior: ["red", "blue"]
0095         }
0096         //! [Red-blue pipe]
0097 
0098         Rectangle {
0099                 id: green
0100 
0101                 x: 700
0102                 y: 20
0103 
0104                 width: 40
0105                 height: 40
0106                 color: "green"
0107                 border.width: 1
0108 
0109                 rotation: 90
0110 
0111                 property PipeConnector outlet: PipeConnector {
0112                         x: 40
0113                         y: 20
0114                         parent: green
0115                 }
0116         }
0117 
0118         Rectangle {
0119                 id: orange
0120 
0121                 x: 700
0122                 y: 200
0123 
0124                 width: 40
0125                 height: 40
0126                 color: "orange"
0127                 border.width: 1
0128 
0129                 rotation: 90
0130 
0131                 property PipeConnector inlet: PipeConnector {
0132                         x: 0
0133                         y: 20
0134                         parent: orange
0135                 }
0136         }
0137 
0138         Pipe {
0139                 from: green.outlet
0140                 to: orange.inlet
0141 
0142                 color.interior: ["green", "orange"]
0143         }
0144 
0145         // Pipe elments example
0146         Tee {
0147                 id: tee
0148 
0149                 x: 100
0150                 y: 300
0151 
0152                 color.interior: "yellow"
0153         }
0154 
0155         Tee {
0156                 id: teeFlip
0157 
0158                 x: 200
0159                 y: 300
0160 
0161                 rotation: 180
0162 
0163                 color.interior: "yellow"
0164         }
0165 
0166         Elbow {
0167                 id: elbow
0168 
0169                 x: 300
0170                 y: 300
0171 
0172                 color.interior: "yellow"
0173         }
0174 
0175         Elbow {
0176                 id: elbow90
0177 
0178                 x: 300
0179                 y: 400
0180                 rotation: 90
0181 
0182                 color.interior: "yellow"
0183         }
0184 
0185         Elbow {
0186                 id: elbow180
0187 
0188                 x: 100
0189                 y: 400
0190                 rotation: 180
0191 
0192                 color.interior: "yellow"
0193         }
0194 
0195         PipeEnd {
0196                 id: leftEnd
0197 
0198                 x: 20
0199                 y: 300
0200 
0201                 color.interior: "yellow"
0202         }
0203 
0204         PipeEnd {
0205                 id: topEnd
0206 
0207                 x: 200
0208                 y: 250
0209                 rotation: 90
0210 
0211                 color.interior: "yellow"
0212         }
0213 
0214         Pipe {
0215                 from: leftEnd.connector.sideB
0216                 to: tee.connector.sideA
0217 
0218                 color.interior: "orange"
0219         }
0220 
0221         Pipe {
0222                 from: tee.connector.sideB
0223                 to: teeFlip.connector.sideB
0224 
0225                 color.interior: "orange"
0226         }
0227 
0228         Pipe {
0229                 from: teeFlip.connector.sideA
0230                 to: elbow.connector.sideA
0231 
0232                 color.interior: "orange"
0233         }
0234 
0235         Pipe {
0236                 from: elbow.connector.sideB
0237                 to: elbow90.connector.sideA
0238 
0239                 color.interior: "orange"
0240         }
0241 
0242         Pipe {
0243                 from: elbow90.connector.sideB
0244                 to: elbow180.connector.sideA
0245 
0246                 color.interior: "orange"
0247         }
0248 
0249         Pipe {
0250                 from: elbow180.connector.sideB
0251                 to: tee.connector.middle
0252 
0253                 color.interior: "orange"
0254         }
0255 
0256         Pipe {
0257                 from: teeFlip.connector.middle
0258                 to: topEnd.connector.sideB
0259 
0260                 color.interior: "orange"
0261         }
0262 
0263         Tee {
0264                 id: tee_2
0265 
0266                 x: 400
0267                 y: 300
0268 
0269                 color.interior: "pink"
0270         }
0271 
0272         Tee {
0273                 id: teeFlip_2
0274 
0275                 x: 500
0276                 y: 300
0277 
0278                 rotation: 180
0279 
0280                 color.interior: "pink"
0281         }
0282 
0283         Elbow {
0284                 id: elbow_2
0285 
0286                 x: 600
0287                 y: 300
0288 
0289                 color.interior: "pink"
0290         }
0291 
0292         Elbow {
0293                 id: elbow90_2
0294 
0295                 x: 600
0296                 y: 400
0297                 rotation: 90
0298 
0299                 color.interior: "pink"
0300         }
0301 
0302         Elbow {
0303                 id: elbow180_2
0304 
0305                 x: 400
0306                 y: 400
0307                 rotation: 180
0308 
0309                 color.interior: "pink"
0310         }
0311 
0312         PipeEnd {
0313                 id: leftEnd_2
0314 
0315                 x: 320
0316                 y: 300
0317 
0318                 color.interior: "pink"
0319         }
0320 
0321         PipeEnd {
0322                 id: topEnd_2
0323 
0324                 x: 500
0325                 y: 250
0326                 rotation: 90
0327 
0328                 color.interior: "pink"
0329         }
0330 
0331         Cap {
0332                 id: topCap_2
0333 
0334                 x: 500
0335                 y: 200
0336 
0337                 color.interior: "pink"
0338                 rotation: -90
0339         }
0340 
0341         Pipe {
0342                 from: leftEnd_2.connector
0343                 to: tee_2.connector
0344 
0345                 color.interior: "violet"
0346         }
0347 
0348         Pipe {
0349                 from: tee_2.connector
0350                 to: teeFlip_2.connector
0351 
0352                 color.interior: "violet"
0353         }
0354 
0355         Pipe {
0356                 from: teeFlip_2.connector
0357                 to: elbow_2.connector
0358 
0359                 color.interior: "violet"
0360         }
0361 
0362         Pipe {
0363                 from: elbow_2.connector
0364                 to: elbow90_2.connector
0365 
0366                 color.interior: "violet"
0367         }
0368 
0369         Pipe {
0370                 from: elbow90_2.connector
0371                 to: elbow180_2.connector
0372 
0373                 color.interior: "violet"
0374         }
0375 
0376         Pipe {
0377                 from: elbow180_2.connector
0378                 to: tee_2.connector
0379 
0380                 color.interior: "violet"
0381         }
0382 
0383         Pipe {
0384                 from: teeFlip_2.connector
0385                 to: topEnd_2.connector
0386 
0387                 color.interior: "violet"
0388         }
0389 
0390         Pipe {
0391                 from: topEnd_2.connector
0392                 to: topCap_2.connector
0393 
0394                 color.interior: "violet"
0395         }
0396 }
0397 
0398 //(c)C: Copyright © 2020, Michał Policht <michal@policht.pl>. All rights reserved.
0399 //(c)C: SPDX-License-Identifier: LGPL-3.0-or-later OR MIT
0400 //(c)C: This file is a part of CuteHMI.
0401 //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
0402 //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
0403 //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI.  If not, see <https://www.gnu.org/licenses/>.
0404 //(c)C: Additionally, this file is licensed under terms of MIT license as expressed below.
0405 //(c)C: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
0406 //(c)C: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
0407 //(c)C: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.