Warning, /education/gcompris/src/activities/gnumch-equality/CellDelegate.qml is written in an unsupported language. File is not indexed.
0001 /* GCompris - CellDelegate.qml 0002 * 0003 * SPDX-FileCopyrightText: 2014 Manuel Tondeur <manueltondeur@gmail.com> 0004 * 0005 * Authors: 0006 * Joe Neeman (spuzzzzzzz@gmail.com) (GTK+ version) 0007 * Manuel Tondeur <manueltondeur@gmail.com> (Qt Quick port) 0008 * 0009 * SPDX-License-Identifier: GPL-3.0-or-later 0010 */ 0011 import QtQuick 2.12 0012 import GCompris 1.0 0013 0014 import "../../core" 0015 import "gnumch-equality.js" as Activity 0016 0017 Item { 0018 property Component delegate: cellDelegate 0019 0020 Component { 0021 id: cellDelegate 0022 Item { 0023 id: cellRectangle 0024 0025 property string num1: number1 0026 property string num2: number2 0027 property string operator: Activity.operator 0028 0029 function setText() { 0030 if (activity.type == "equality" || activity.type == "inequality") { 0031 0032 } else if (activity.type == "primes" || 0033 activity.type == "factors"|| 0034 activity.type == "multiples") { 0035 num2 = "" 0036 operator = "" 0037 } 0038 } 0039 0040 width: grid.cellWidth 0041 height: grid.cellHeight 0042 focus: false 0043 Component.onCompleted: setText() 0044 0045 GCText { 0046 id: numberText 0047 0048 anchors.fill: parent 0049 anchors.margins: ApplicationInfo.ratio * 5 0050 0051 horizontalAlignment: Text.AlignHCenter 0052 verticalAlignment: Text.AlignVCenter 0053 style: Text.Outline 0054 styleColor: "white" 0055 visible: show 0056 color: "#373737" 0057 0058 fontSizeMode: Text.Fit 0059 minimumPointSize: 7 0060 fontSize: 28 0061 maximumLineCount: 1 0062 0063 text: num1 + operator + num2 0064 } 0065 } 0066 } 0067 }