diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-03-21 20:42:38 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-03-21 20:42:47 +0100 |
commit | 6767114285db9d0e16dc278d08f231e8561546b4 (patch) | |
tree | 0945902a2242fd7ec0a1f7fd3e6acbb769e723bd /examples/quick | |
parent | ee076afedccbe1d37306a7972051f84eb036d655 (diff) | |
parent | c32b109e9dea44c6775c2dbf8f164870c1dc8971 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: Ib5662d80d5b2f58cf4634c54c054545ba9df807e
Diffstat (limited to 'examples/quick')
742 files changed, 6549 insertions, 18010 deletions
diff --git a/examples/quick/animation/animation.qml b/examples/quick/animation/animation.qml index eb341a7883..efc4e6fa27 100644 --- a/examples/quick/animation/animation.qml +++ b/examples/quick/animation/animation.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/basics/animators.qml b/examples/quick/animation/basics/animators.qml index 3b8ff8391a..430e71bb26 100644 --- a/examples/quick/animation/basics/animators.qml +++ b/examples/quick/animation/basics/animators.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/basics/color-animation.qml b/examples/quick/animation/basics/color-animation.qml index 42cde9b899..7fbfe0224b 100644 --- a/examples/quick/animation/basics/color-animation.qml +++ b/examples/quick/animation/basics/color-animation.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/basics/property-animation.qml b/examples/quick/animation/basics/property-animation.qml index e70a1c8f07..a764c395ee 100644 --- a/examples/quick/animation/basics/property-animation.qml +++ b/examples/quick/animation/basics/property-animation.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/behaviors/SideRect.qml b/examples/quick/animation/behaviors/SideRect.qml index 8076b991f7..8b37a6a0ca 100644 --- a/examples/quick/animation/behaviors/SideRect.qml +++ b/examples/quick/animation/behaviors/SideRect.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/behaviors/behavior-example.qml b/examples/quick/animation/behaviors/behavior-example.qml index 30280face4..1d07e6bb90 100644 --- a/examples/quick/animation/behaviors/behavior-example.qml +++ b/examples/quick/animation/behaviors/behavior-example.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/behaviors/tvtennis.qml b/examples/quick/animation/behaviors/tvtennis.qml index 5cd83b641b..89d912777a 100644 --- a/examples/quick/animation/behaviors/tvtennis.qml +++ b/examples/quick/animation/behaviors/tvtennis.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/behaviors/wigglytext.qml b/examples/quick/animation/behaviors/wigglytext.qml index f4af8c7869..cc2e086b51 100644 --- a/examples/quick/animation/behaviors/wigglytext.qml +++ b/examples/quick/animation/behaviors/wigglytext.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/doc/src/animation.qdoc b/examples/quick/animation/doc/src/animation.qdoc index a23e2ddf0a..578fb4b849 100644 --- a/examples/quick/animation/doc/src/animation.qdoc +++ b/examples/quick/animation/doc/src/animation.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/animation/easing/easing.qml b/examples/quick/animation/easing/easing.qml index 85c2fae9c1..6db5599a66 100644 --- a/examples/quick/animation/easing/easing.qml +++ b/examples/quick/animation/easing/easing.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/main.cpp b/examples/quick/animation/main.cpp index a9c680139d..2defa0a32e 100644 --- a/examples/quick/animation/main.cpp +++ b/examples/quick/animation/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/pathanimation/pathanimation.qml b/examples/quick/animation/pathanimation/pathanimation.qml index 663c8c9d14..b98fbebefc 100644 --- a/examples/quick/animation/pathanimation/pathanimation.qml +++ b/examples/quick/animation/pathanimation/pathanimation.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/pathinterpolator/pathinterpolator.qml b/examples/quick/animation/pathinterpolator/pathinterpolator.qml index 7aa43f3bd7..0c0d7bad46 100644 --- a/examples/quick/animation/pathinterpolator/pathinterpolator.qml +++ b/examples/quick/animation/pathinterpolator/pathinterpolator.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/states/states.qml b/examples/quick/animation/states/states.qml index fbda1f646d..498fb6867c 100644 --- a/examples/quick/animation/states/states.qml +++ b/examples/quick/animation/states/states.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/animation/states/transitions.qml b/examples/quick/animation/states/transitions.qml index b886855500..1cfdfec18a 100644 --- a/examples/quick/animation/states/transitions.qml +++ b/examples/quick/animation/states/transitions.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/bezierCurve/bezierCurve.qml b/examples/quick/canvas/bezierCurve/bezierCurve.qml index d2270e805e..4f573ed64e 100644 --- a/examples/quick/canvas/bezierCurve/bezierCurve.qml +++ b/examples/quick/canvas/bezierCurve/bezierCurve.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/canvas.qml b/examples/quick/canvas/canvas.qml index e54f654f46..7768e1092b 100644 --- a/examples/quick/canvas/canvas.qml +++ b/examples/quick/canvas/canvas.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/clip/clip.qml b/examples/quick/canvas/clip/clip.qml index 5e5fb3737e..1771121cd6 100644 --- a/examples/quick/canvas/clip/clip.qml +++ b/examples/quick/canvas/clip/clip.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/doc/src/canvas.qdoc b/examples/quick/canvas/doc/src/canvas.qdoc index f2545ac51e..14ee363164 100644 --- a/examples/quick/canvas/doc/src/canvas.qdoc +++ b/examples/quick/canvas/doc/src/canvas.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/canvas/main.cpp b/examples/quick/canvas/main.cpp index 04385bdea2..e2f5eb6bde 100644 --- a/examples/quick/canvas/main.cpp +++ b/examples/quick/canvas/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml b/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml index b3d552d25e..cd93205995 100644 --- a/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml +++ b/examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/roundedrect/roundedrect.qml b/examples/quick/canvas/roundedrect/roundedrect.qml index 9fa01b0508..08ede9b1e7 100644 --- a/examples/quick/canvas/roundedrect/roundedrect.qml +++ b/examples/quick/canvas/roundedrect/roundedrect.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/smile/smile.qml b/examples/quick/canvas/smile/smile.qml index 25e9d031de..880116726f 100644 --- a/examples/quick/canvas/smile/smile.qml +++ b/examples/quick/canvas/smile/smile.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/squircle/squircle.qml b/examples/quick/canvas/squircle/squircle.qml index 04c9df42d3..5416bfa1c7 100644 --- a/examples/quick/canvas/squircle/squircle.qml +++ b/examples/quick/canvas/squircle/squircle.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/canvas/tiger/tiger.qml b/examples/quick/canvas/tiger/tiger.qml index c0534c6ecd..71367d560a 100644 --- a/examples/quick/canvas/tiger/tiger.qml +++ b/examples/quick/canvas/tiger/tiger.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/dialcontrol/content/Dial.qml b/examples/quick/customitems/dialcontrol/content/Dial.qml index d8f930f979..108b0e7410 100644 --- a/examples/quick/customitems/dialcontrol/content/Dial.qml +++ b/examples/quick/customitems/dialcontrol/content/Dial.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/dialcontrol/content/QuitButton.qml b/examples/quick/customitems/dialcontrol/content/QuitButton.qml index 37cb7d0266..87dc159c5d 100644 --- a/examples/quick/customitems/dialcontrol/content/QuitButton.qml +++ b/examples/quick/customitems/dialcontrol/content/QuitButton.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/dialcontrol/dialcontrol.qml b/examples/quick/customitems/dialcontrol/dialcontrol.qml index 32b64ac676..d0a623a72a 100644 --- a/examples/quick/customitems/dialcontrol/dialcontrol.qml +++ b/examples/quick/customitems/dialcontrol/dialcontrol.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/dialcontrol/doc/src/dialcontrol.qdoc b/examples/quick/customitems/dialcontrol/doc/src/dialcontrol.qdoc index 9bc6a61716..cd50650c0b 100644 --- a/examples/quick/customitems/dialcontrol/doc/src/dialcontrol.qdoc +++ b/examples/quick/customitems/dialcontrol/doc/src/dialcontrol.qdoc @@ -1,39 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/customitems/dialcontrol/main.cpp b/examples/quick/customitems/dialcontrol/main.cpp index 6a14753252..6ebe203a70 100644 --- a/examples/quick/customitems/dialcontrol/main.cpp +++ b/examples/quick/customitems/dialcontrol/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/flipable/content/Card.qml b/examples/quick/customitems/flipable/content/Card.qml index c6b58539b0..ffffdb6b7d 100644 --- a/examples/quick/customitems/flipable/content/Card.qml +++ b/examples/quick/customitems/flipable/content/Card.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/flipable/doc/src/flipable.qdoc b/examples/quick/customitems/flipable/doc/src/flipable.qdoc index c4b7969b7e..58f5492251 100644 --- a/examples/quick/customitems/flipable/doc/src/flipable.qdoc +++ b/examples/quick/customitems/flipable/doc/src/flipable.qdoc @@ -1,39 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** +** $QT_BEGIN_LICENSE:FDL$ +** 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. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/customitems/flipable/flipable.qml b/examples/quick/customitems/flipable/flipable.qml index 731cb7a088..3662898864 100644 --- a/examples/quick/customitems/flipable/flipable.qml +++ b/examples/quick/customitems/flipable/flipable.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/maskedmousearea/main.cpp b/examples/quick/customitems/maskedmousearea/main.cpp index 22e7fdbf6e..63558d1b20 100644 --- a/examples/quick/customitems/maskedmousearea/main.cpp +++ b/examples/quick/customitems/maskedmousearea/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp index 66a58ab0f9..9a107e0143 100644 --- a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp +++ b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/maskedmousearea/maskedmousearea.h b/examples/quick/customitems/maskedmousearea/maskedmousearea.h index 8536c0d5dc..28ff6ca9df 100644 --- a/examples/quick/customitems/maskedmousearea/maskedmousearea.h +++ b/examples/quick/customitems/maskedmousearea/maskedmousearea.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/maskedmousearea/maskedmousearea.qml b/examples/quick/customitems/maskedmousearea/maskedmousearea.qml index e8002589b1..2474edaf78 100644 --- a/examples/quick/customitems/maskedmousearea/maskedmousearea.qml +++ b/examples/quick/customitems/maskedmousearea/maskedmousearea.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/painteditem/doc/src/textballoons.qdoc b/examples/quick/customitems/painteditem/doc/src/textballoons.qdoc index 3dc361e4a9..4541ba0bd9 100644 --- a/examples/quick/customitems/painteditem/doc/src/textballoons.qdoc +++ b/examples/quick/customitems/painteditem/doc/src/textballoons.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/customitems/progressbar/content/ProgressBar.qml b/examples/quick/customitems/progressbar/content/ProgressBar.qml index d76c321d7a..594cccfe75 100644 --- a/examples/quick/customitems/progressbar/content/ProgressBar.qml +++ b/examples/quick/customitems/progressbar/content/ProgressBar.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/progressbar/main.qml b/examples/quick/customitems/progressbar/main.qml index 5dc795625a..2dd67621a8 100644 --- a/examples/quick/customitems/progressbar/main.qml +++ b/examples/quick/customitems/progressbar/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/scrollbar/ScrollBar.qml b/examples/quick/customitems/scrollbar/ScrollBar.qml index bbf549a34e..f2e46c5681 100644 --- a/examples/quick/customitems/scrollbar/ScrollBar.qml +++ b/examples/quick/customitems/scrollbar/ScrollBar.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/scrollbar/doc/src/scrollbar.qdoc b/examples/quick/customitems/scrollbar/doc/src/scrollbar.qdoc index e5a4b11742..37852222c0 100644 --- a/examples/quick/customitems/scrollbar/doc/src/scrollbar.qdoc +++ b/examples/quick/customitems/scrollbar/doc/src/scrollbar.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/customitems/scrollbar/main.qml b/examples/quick/customitems/scrollbar/main.qml index 79c93474a9..9248e44a42 100644 --- a/examples/quick/customitems/scrollbar/main.qml +++ b/examples/quick/customitems/scrollbar/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/searchbox/SearchBox.qml b/examples/quick/customitems/searchbox/SearchBox.qml index a8ef3e988b..13927e0d6f 100644 --- a/examples/quick/customitems/searchbox/SearchBox.qml +++ b/examples/quick/customitems/searchbox/SearchBox.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/searchbox/main.qml b/examples/quick/customitems/searchbox/main.qml index 7ad369598e..bc6900ba7e 100644 --- a/examples/quick/customitems/searchbox/main.qml +++ b/examples/quick/customitems/searchbox/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/slideswitch/content/Switch.qml b/examples/quick/customitems/slideswitch/content/Switch.qml index f8b4415262..72eb13e1e3 100644 --- a/examples/quick/customitems/slideswitch/content/Switch.qml +++ b/examples/quick/customitems/slideswitch/content/Switch.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/slideswitch/doc/src/example-slideswitch.qdoc b/examples/quick/customitems/slideswitch/doc/src/example-slideswitch.qdoc index 67a36eb8d8..19c79dea97 100644 --- a/examples/quick/customitems/slideswitch/doc/src/example-slideswitch.qdoc +++ b/examples/quick/customitems/slideswitch/doc/src/example-slideswitch.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -75,7 +75,7 @@ Item { the text will only be visible when the switch is on. -\section2 Images and user interaction +\section2 Images and User Interaction \snippet customitems/slideswitch/content/Switch.qml 4 First, we create the background image of the switch. diff --git a/examples/quick/customitems/slideswitch/slideswitch.qml b/examples/quick/customitems/slideswitch/slideswitch.qml index 0bdf444baf..7ddbfc2928 100644 --- a/examples/quick/customitems/slideswitch/slideswitch.qml +++ b/examples/quick/customitems/slideswitch/slideswitch.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/spinner/content/Spinner.qml b/examples/quick/customitems/spinner/content/Spinner.qml index a956b99d9a..0eec968ed1 100644 --- a/examples/quick/customitems/spinner/content/Spinner.qml +++ b/examples/quick/customitems/spinner/content/Spinner.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/spinner/main.qml b/examples/quick/customitems/spinner/main.qml index b105420dd2..82b31aba0c 100644 --- a/examples/quick/customitems/spinner/main.qml +++ b/examples/quick/customitems/spinner/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/tabwidget/TabWidget.qml b/examples/quick/customitems/tabwidget/TabWidget.qml index 9a2ed6b46e..d0e6f8224b 100644 --- a/examples/quick/customitems/tabwidget/TabWidget.qml +++ b/examples/quick/customitems/tabwidget/TabWidget.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/customitems/tabwidget/doc/src/tabwidget.qdoc b/examples/quick/customitems/tabwidget/doc/src/tabwidget.qdoc index 862c527d9f..a45c8107cb 100644 --- a/examples/quick/customitems/tabwidget/doc/src/tabwidget.qdoc +++ b/examples/quick/customitems/tabwidget/doc/src/tabwidget.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -29,7 +29,7 @@ \title TabWidget Example \example customitems/tabwidget \brief The TabWidget example shows how to create a tabwidget using property aliases - and QML Object default properties + and QML Object default properties. This example shows how to create a tab widget. It also demonstrates how \l {Property aliases}{property aliases} and diff --git a/examples/quick/customitems/tabwidget/main.qml b/examples/quick/customitems/tabwidget/main.qml index fa48214b0c..6867cf450b 100644 --- a/examples/quick/customitems/tabwidget/main.qml +++ b/examples/quick/customitems/tabwidget/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/delegatechooser/delegatechooser.pro b/examples/quick/delegatechooser/delegatechooser.pro new file mode 100644 index 0000000000..f06864ba89 --- /dev/null +++ b/examples/quick/delegatechooser/delegatechooser.pro @@ -0,0 +1,8 @@ +TEMPLATE = app +QT += quick qml + +SOURCES += main.cpp +RESOURCES += qml.qrc ../shared/shared.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/quick/delegatechooser +INSTALLS += target diff --git a/examples/quick/delegatechooser/delegatechooser.qml b/examples/quick/delegatechooser/delegatechooser.qml new file mode 100644 index 0000000000..afb8518abf --- /dev/null +++ b/examples/quick/delegatechooser/delegatechooser.qml @@ -0,0 +1,145 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQml.Models 2.12 +import QtQuick.Layouts 1.12 +import Qt.labs.qmlmodels 1.0 + +Rectangle { + visible: true + width: 640 + height: 640 + + ListModel { + id: listModel + ListElement { dataType: "rect"; color: "green" } + ListElement { dataType: "image"; source: "../shared/images/qt-logo.png" } + ListElement { dataType: "rect"; color: "green" } + ListElement { dataType: "image"; source: "../shared/images/qt-logo.png" } + ListElement { dataType: "rect"; color: "blue" } + ListElement { dataType: "rect"; color: "blue" } + ListElement { dataType: "rect"; color: "blue" } + ListElement { dataType: "rect"; color: "blue" } + ListElement { dataType: "rect"; color: "blue" } + ListElement { dataType: "rect"; color: "blue" } + } + + ListModel { + id: listModel2 + ListElement { dataType: "rect"; color: "blue" } + ListElement { dataType: "rect"; color: "blue" } + ListElement { dataType: "rect"; color: "green" } + ListElement { dataType: "image"; source: "../shared/images/qt-logo.png" } + ListElement { dataType: "rect"; color: "green" } + ListElement { dataType: "image"; source: "../shared/images/qt-logo.png" } + ListElement { dataType: "rect"; color: "blue" } + ListElement { dataType: "rect"; color: "lightsteelblue" } + ListElement { dataType: "rect"; color: "fuchsia" } + ListElement { dataType: "rect"; color: "lime" } + } + + DelegateChooser { + id: fancyDelegate + role: "dataType" + DelegateChoice { + roleValue: "rect" + delegate: DelegateChooser { + DelegateChoice { + row: 0 + Rectangle { + width: parent.width + height: 50 + color: "red" + border.color: "black" + border.width: 1 + } + } + DelegateChoice { + Rectangle { + width: parent.width + height: 50 + color: model.color + border.color: "black" + border.width: 1 + } + } + } + } + DelegateChoice { + roleValue: "image" + delegate: Image { + width: parent.width + height: 100 + source: model.source + fillMode: Image.PreserveAspectFit + } + } + } + + Item { + anchors.fill: parent + id: ite + RowLayout { + ListView { + Layout.preferredHeight: ite.height + Layout.preferredWidth: ite.width * 0.5 + model: listModel + delegate: fancyDelegate + } + ListView { + Layout.preferredHeight: ite.height + Layout.preferredWidth: ite.width * 0.5 + model: listModel2 + delegate: fancyDelegate + } + } + } +} diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml b/examples/quick/delegatechooser/main.cpp index 836abdf6a9..5df9207e24 100644 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml +++ b/examples/quick/delegatechooser/main.cpp @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtQml module of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage @@ -47,13 +47,5 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -import QtQuick 2.0 - -Image { - id: container - property bool on: false - - source: "images/busy.png"; visible: container.on - NumberAnimation on rotation { running: container.on; from: 0; to: 360; loops: Animation.Infinite; duration: 1200 } -} +#include "../shared/shared.h" +DECLARATIVE_EXAMPLE_MAIN(delegatechooser) diff --git a/examples/quick/delegatechooser/qml.qrc b/examples/quick/delegatechooser/qml.qrc new file mode 100644 index 0000000000..0788f84c64 --- /dev/null +++ b/examples/quick/delegatechooser/qml.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>delegatechooser.qml</file> + </qresource> +</RCC> diff --git a/examples/quick/demos/calqlatr/calqlatr.pro b/examples/quick/demos/calqlatr/calqlatr.pro deleted file mode 100644 index 20543c08da..0000000000 --- a/examples/quick/demos/calqlatr/calqlatr.pro +++ /dev/null @@ -1,19 +0,0 @@ -TEMPLATE = app - -QT += qml quick -SOURCES += main.cpp - -RESOURCES += calqlatr.qrc \ - ../../shared/shared.qrc - -OTHER_FILES = calqlatr.qml \ - content/Button.qml \ - content/Display.qml \ - content/NumberPad.qml \ - content/calculator.js \ - content/images/paper-edge-left.png \ - content/images/paper-edge-right.png \ - content/images/paper-grip.png - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/calqlatr -INSTALLS += target diff --git a/examples/quick/demos/calqlatr/calqlatr.qml b/examples/quick/demos/calqlatr/calqlatr.qml deleted file mode 100644 index 017d819b01..0000000000 --- a/examples/quick/demos/calqlatr/calqlatr.qml +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "content" -import "content/calculator.js" as CalcEngine - - -Rectangle { - id: window - width: 320 - height: 480 - focus: true - color: "#272822" - - onWidthChanged: controller.reload() - onHeightChanged: controller.reload() - - function operatorPressed(operator) { - CalcEngine.operatorPressed(operator) - numPad.buttonPressed() - } - function digitPressed(digit) { - CalcEngine.digitPressed(digit) - numPad.buttonPressed() - } - function isButtonDisabled(op) { - return CalcEngine.disabled(op) - } - - Item { - id: pad - width: 180 - NumberPad { id: numPad; y: 10; anchors.horizontalCenter: parent.horizontalCenter } - } - - AnimationController { - id: controller - animation: ParallelAnimation { - id: anim - NumberAnimation { target: display; property: "x"; duration: 400; from: -16; to: window.width - display.width; easing.type: Easing.InOutQuad } - NumberAnimation { target: pad; property: "x"; duration: 400; from: window.width - pad.width; to: 0; easing.type: Easing.InOutQuad } - SequentialAnimation { - NumberAnimation { target: pad; property: "scale"; duration: 200; from: 1; to: 0.97; easing.type: Easing.InOutQuad } - NumberAnimation { target: pad; property: "scale"; duration: 200; from: 0.97; to: 1; easing.type: Easing.InOutQuad } - } - } - } - - Keys.onPressed: { - if (event.key == Qt.Key_0) - digitPressed("0") - else if (event.key == Qt.Key_1) - digitPressed("1") - else if (event.key == Qt.Key_2) - digitPressed("2") - else if (event.key == Qt.Key_3) - digitPressed("3") - else if (event.key == Qt.Key_4) - digitPressed("4") - else if (event.key == Qt.Key_5) - digitPressed("5") - else if (event.key == Qt.Key_6) - digitPressed("6") - else if (event.key == Qt.Key_7) - digitPressed("7") - else if (event.key == Qt.Key_8) - digitPressed("8") - else if (event.key == Qt.Key_9) - digitPressed("9") - else if (event.key == Qt.Key_Plus) - operatorPressed("+") - else if (event.key == Qt.Key_Minus) - operatorPressed("−") - else if (event.key == Qt.Key_Asterisk) - operatorPressed("×") - else if (event.key == Qt.Key_Slash) - operatorPressed("÷") - else if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return) - operatorPressed("=") - else if (event.key == Qt.Key_Comma || event.key == Qt.Key_Period) - digitPressed(".") - else if (event.key == Qt.Key_Backspace) - operatorPressed("backspace") - } - - Display { - id: display - x: -16 - width: window.width - pad.width - height: parent.height - - MouseArea { - id: mouseInput - property real startX: 0 - property real oldP: 0 - property bool rewind: false - - anchors { - bottom: parent.bottom - left: parent.left - right: parent.right - } - height: 50 - onPositionChanged: { - var reverse = startX > window.width / 2 - var mx = mapToItem(window, mouseInput.mouseX, mouseInput.mouseY).x - var p = Math.abs((mx - startX) / (window.width - display.width)) - if (p < oldP) - rewind = reverse ? false : true - else - rewind = reverse ? true : false - controller.progress = reverse ? 1 - p : p - oldP = p - } - onPressed: startX = mapToItem(window, mouseInput.mouseX, mouseInput.mouseY).x - onReleased: { - if (rewind) - controller.completeToBeginning() - else - controller.completeToEnd() - } - } - } - -} diff --git a/examples/quick/demos/calqlatr/calqlatr.qmlproject b/examples/quick/demos/calqlatr/calqlatr.qmlproject deleted file mode 100644 index ce2d59d310..0000000000 --- a/examples/quick/demos/calqlatr/calqlatr.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "calqlatr.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/demos/calqlatr/calqlatr.qrc b/examples/quick/demos/calqlatr/calqlatr.qrc deleted file mode 100644 index 7483304e02..0000000000 --- a/examples/quick/demos/calqlatr/calqlatr.qrc +++ /dev/null @@ -1,12 +0,0 @@ -<RCC> - <qresource prefix="/demos/calqlatr"> - <file>calqlatr.qml</file> - <file>content/Button.qml</file> - <file>content/calculator.js</file> - <file>content/Display.qml</file> - <file>content/NumberPad.qml</file> - <file>content/images/paper-edge-left.png</file> - <file>content/images/paper-edge-right.png</file> - <file>content/images/paper-grip.png</file> - </qresource> -</RCC> diff --git a/examples/quick/demos/calqlatr/content/Button.qml b/examples/quick/demos/calqlatr/content/Button.qml deleted file mode 100644 index 9c5c6ecf6e..0000000000 --- a/examples/quick/demos/calqlatr/content/Button.qml +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - id: button - property alias text: textItem.text - property color color: "#eceeea" - - property bool operator: false - property bool dimmable: false - property bool dimmed: false - - width: 30 - height: 50 - - Text { - id: textItem - font.pixelSize: 48 - wrapMode: Text.WordWrap - lineHeight: 0.75 - color: (dimmable && dimmed) ? Qt.darker(button.color) : button.color - Behavior on color { ColorAnimation { duration: 120; easing.type: Easing.OutElastic} } - states: [ - State { - name: "pressed" - when: mouse.pressed && !dimmed - PropertyChanges { - target: textItem - color: Qt.lighter(button.color) - } - } - ] - } - - MouseArea { - id: mouse - anchors.fill: parent - anchors.margins: -5 - onClicked: { - if (operator) - window.operatorPressed(parent.text) - else - window.digitPressed(parent.text) - } - } - - function updateDimmed() { - dimmed = window.isButtonDisabled(button.text) - } - - Component.onCompleted: { - numPad.buttonPressed.connect(updateDimmed) - updateDimmed() - } -} diff --git a/examples/quick/demos/calqlatr/content/Display.qml b/examples/quick/demos/calqlatr/content/Display.qml deleted file mode 100644 index cf93d878bb..0000000000 --- a/examples/quick/demos/calqlatr/content/Display.qml +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Window 2.0 - -Item { - id: display - property real fontSize: Math.floor(Screen.pixelDensity * 5.0) - property bool enteringDigits: false - property int maxDigits: (width / fontSize) + 1 - property string displayedOperand - property string errorString: qsTr("ERROR") - property bool isError: displayedOperand === errorString - - function displayOperator(operator) - { - listView.model.append({ "operator": operator, "operand": "" }) - enteringDigits = true - listView.positionViewAtEnd() - } - - function newLine(operator, operand) - { - displayedOperand = displayNumber(operand) - listView.model.append({ "operator": operator, "operand": displayedOperand }) - enteringDigits = false - listView.positionViewAtEnd() - } - - function appendDigit(digit) - { - if (!enteringDigits) - listView.model.append({ "operator": "", "operand": "" }) - var i = listView.model.count - 1; - listView.model.get(i).operand = listView.model.get(i).operand + digit; - enteringDigits = true - listView.positionViewAtEnd() - } - - function setDigit(digit) - { - var i = listView.model.count - 1; - listView.model.get(i).operand = digit; - listView.positionViewAtEnd() - } - - function clear() - { - displayedOperand = "" - if (enteringDigits) { - var i = listView.model.count - 1 - if (i >= 0) - listView.model.remove(i) - enteringDigits = false - } - } - - // Returns a string representation of a number that fits in - // display.maxDigits characters, trying to keep as much precision - // as possible. If the number cannot be displayed, returns an - // error string. - function displayNumber(num) { - if (typeof(num) != "number") - return errorString; - - var intNum = parseInt(num); - var intLen = intNum.toString().length; - - // Do not count the minus sign as a digit - var maxLen = num < 0 ? maxDigits + 1 : maxDigits; - - if (num.toString().length <= maxLen) { - if (isFinite(num)) - return num.toString(); - return errorString; - } - - // Integer part of the number is too long - try - // an exponential notation - if (intNum == num || intLen > maxLen - 3) { - var expVal = num.toExponential(maxDigits - 6).toString(); - if (expVal.length <= maxLen) - return expVal; - } - - // Try a float presentation with fixed number of digits - var floatStr = parseFloat(num).toFixed(maxDigits - intLen - 1).toString(); - if (floatStr.length <= maxLen) - return floatStr; - - return errorString; - } - - Item { - id: theItem - width: parent.width + 32 - height: parent.height - - Rectangle { - id: rect - x: 16 - color: "white" - height: parent.height - width: display.width - 16 - } - Image { - anchors.right: rect.left - source: "images/paper-edge-left.png" - height: parent.height - fillMode: Image.TileVertically - } - Image { - anchors.left: rect.right - source: "images/paper-edge-right.png" - height: parent.height - fillMode: Image.TileVertically - } - - Image { - id: grip - source: "images/paper-grip.png" - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - anchors.bottomMargin: 20 - } - - ListView { - id: listView - x: 16; y: 30 - width: display.width - height: display.height - 50 - y - delegate: Item { - height: display.fontSize * 1.1 - width: parent.width - Text { - id: operator - x: 6 - font.pixelSize: display.fontSize - color: "#6da43d" - text: model.operator - } - Text { - id: operand - font.pixelSize: display.fontSize - anchors.right: parent.right - anchors.rightMargin: 22 - text: model.operand - } - } - model: ListModel { } - } - - } - -} diff --git a/examples/quick/demos/calqlatr/content/NumberPad.qml b/examples/quick/demos/calqlatr/content/NumberPad.qml deleted file mode 100644 index 6e7d441dd2..0000000000 --- a/examples/quick/demos/calqlatr/content/NumberPad.qml +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Grid { - columns: 3 - columnSpacing: 32 - rowSpacing: 16 - - signal buttonPressed - - Button { text: "7" } - Button { text: "8" } - Button { text: "9" } - Button { text: "4" } - Button { text: "5" } - Button { text: "6" } - Button { text: "1" } - Button { text: "2" } - Button { text: "3" } - Button { text: "0" } - Button { text: "."; dimmable: true } - Button { text: " " } - Button { text: "±"; color: "#6da43d"; operator: true; dimmable: true } - Button { text: "−"; color: "#6da43d"; operator: true; dimmable: true } - Button { text: "+"; color: "#6da43d"; operator: true; dimmable: true } - Button { text: "√"; color: "#6da43d"; operator: true; dimmable: true } - Button { text: "÷"; color: "#6da43d"; operator: true; dimmable: true } - Button { text: "×"; color: "#6da43d"; operator: true; dimmable: true } - Button { text: "C"; color: "#6da43d"; operator: true } - Button { text: " "; color: "#6da43d"; operator: true } - Button { text: "="; color: "#6da43d"; operator: true; dimmable: true } -} diff --git a/examples/quick/demos/calqlatr/content/calculator.js b/examples/quick/demos/calqlatr/content/calculator.js deleted file mode 100644 index 496a93ba79..0000000000 --- a/examples/quick/demos/calqlatr/content/calculator.js +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -var curVal = 0 -var memory = 0 -var lastOp = "" -var previousOperator = "" -var digits = "" - -function disabled(op) { - if (digits == "" && !((op >= "0" && op <= "9") || op == ".")) - return true - else if (op == '=' && previousOperator.length != 1) - return true - else if (op == "." && digits.toString().search(/\./) != -1) { - return true - } else if (op == "√" && digits.toString().search(/-/) != -1) { - return true - } else { - return false - } -} - -function digitPressed(op) -{ - if (disabled(op)) - return - if (digits.toString().length >= display.maxDigits) - return - if (lastOp.toString().length == 1 && ((lastOp >= "0" && lastOp <= "9") || lastOp == ".") ) { - digits = digits + op.toString() - display.appendDigit(op.toString()) - } else { - digits = op - display.appendDigit(op.toString()) - } - lastOp = op -} - -function operatorPressed(op) -{ - if (disabled(op)) - return - lastOp = op - - if (op == "±") { - digits = Number(digits.valueOf() * -1) - display.setDigit(display.displayNumber(digits)) - return - } - - if (previousOperator == "+") { - digits = Number(digits.valueOf()) + Number(curVal.valueOf()) - } else if (previousOperator == "−") { - digits = Number(curVal.valueOf()) - Number(digits.valueOf()) - } else if (previousOperator == "×") { - digits = Number(curVal) * Number(digits.valueOf()) - } else if (previousOperator == "÷") { - digits = Number(curVal) / Number(digits.valueOf()) - } - - if (op == "+" || op == "−" || op == "×" || op == "÷") { - previousOperator = op - curVal = digits.valueOf() - digits = "" - display.displayOperator(previousOperator) - return - } - - if (op == "=") { - display.newLine("=", digits.valueOf()) - } - - curVal = 0 - previousOperator = "" - - if (op == "1/x") { - digits = (1 / digits.valueOf()).toString() - } else if (op == "x^2") { - digits = (digits.valueOf() * digits.valueOf()).toString() - } else if (op == "Abs") { - digits = (Math.abs(digits.valueOf())).toString() - } else if (op == "Int") { - digits = (Math.floor(digits.valueOf())).toString() - } else if (op == "√") { - digits = Number(Math.sqrt(digits.valueOf())) - display.newLine("√", digits.valueOf()) - } else if (op == "mc") { - memory = 0; - } else if (op == "m+") { - memory += digits.valueOf() - } else if (op == "mr") { - digits = memory.toString() - } else if (op == "m-") { - memory = digits.valueOf() - } else if (op == "backspace") { - digits = digits.toString().slice(0, -1) - display.clear() - display.appendDigit(digits) - } else if (op == "Off") { - Qt.quit(); - } - - // Reset the state on 'C' operator or after - // an error occurred - if (op == "C" || display.isError) { - display.clear() - curVal = 0 - memory = 0 - lastOp = "" - digits = "" - } -} - diff --git a/examples/quick/demos/calqlatr/content/images/paper-edge-left.png b/examples/quick/demos/calqlatr/content/images/paper-edge-left.png Binary files differdeleted file mode 100644 index ca29a3ae10..0000000000 --- a/examples/quick/demos/calqlatr/content/images/paper-edge-left.png +++ /dev/null diff --git a/examples/quick/demos/calqlatr/content/images/paper-edge-right.png b/examples/quick/demos/calqlatr/content/images/paper-edge-right.png Binary files differdeleted file mode 100644 index 7c2da7b930..0000000000 --- a/examples/quick/demos/calqlatr/content/images/paper-edge-right.png +++ /dev/null diff --git a/examples/quick/demos/calqlatr/content/images/paper-grip.png b/examples/quick/demos/calqlatr/content/images/paper-grip.png Binary files differdeleted file mode 100644 index 953c408bca..0000000000 --- a/examples/quick/demos/calqlatr/content/images/paper-grip.png +++ /dev/null diff --git a/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png b/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png Binary files differdeleted file mode 100644 index af67f63dd1..0000000000 --- a/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png +++ /dev/null diff --git a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc b/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc deleted file mode 100644 index 85e77b96b4..0000000000 --- a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc +++ /dev/null @@ -1,195 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Qt Quick Demo - Calqlatr - \ingroup qtquickdemos - \example demos/calqlatr - \brief A QML app designed for portrait devices that uses custom components, - animated with AnimationController, and JavaScript for the application logic. - \image qtquick-demo-calqlatr.png - - \e{Calqlatr} demonstrates various QML and \l{Qt Quick} features, such as - displaying custom components and using animation to move the components - around in the application view. The application logic is implemented in - JavaScript and the appearance is implemented in QML. - - \include examples-run.qdocinc - - \section1 Displaying Custom Components - - In the Calqlatr application, we use the following custom types that are - each defined in a separate .qml file: - - \list - \li Button.qml - \li Display.qml - \li NumberPad.qml - \endlist - - To use the custom types, we add an import statement to the main QML file, - calqlatr.qml that imports the folder called \c content where the types are - located: - - \code - import "content" - \endcode - - We can then display custom components by adding the component types to - any QML file. For example, we use the NumberPad type in calqlatr.qml to - create the number pad of the calculator. We place the type inside an - \l{Item} QML type, which is the base type for all visual items in Qt Quick: - - \quotefromfile demos/calqlatr/calqlatr.qml - \skipto Item - \printuntil } - \printuntil } - - Further, we use the Button type in the \c NumberPad type to create the - calculator buttons. Button.qml specifies the basic properties for a - button that we can modify for each button instance in NumberPad.qml. For the - digit and separator buttons, we additionally specify the text property using - the property alias \c text that we define in Button.qml. - - For the operator buttons, we also specify another color (green) using the - property alias \c color and set the operator property to \c true. We use - the operator property in functions that perform the calculations. - - We place the buttons inside a \l{Grid} QML type to position them in a grid: - - \quotefromfile demos/calqlatr/content/NumberPad.qml - \skipto Grid - \printuntil /^\}/ - - Some of the buttons also have a \c dimmable property set, meaning that they - can be visually disabled (dimmed) whenever the calculator engine does not - accept input from that button. As an example, the button for square root - operator is dimmed for negative values. - - \section1 Animating Components - - We use the Display type to display calculations. In Display.qml, we use - images to make the display component look like a slip of paper that contains - a grip. Users can drag the grip to move the display from left to right. - - When users release the grip, the AnimationController QML type that we define - in the calqlatr.qml file finishes running the controlled animation in either - a forwards or a backwards direction. To run the animation, we call either - completeToEnd() or completeToBeginning(), depending on the direction. We do - this in the MouseArea's \c onReleased signal handler, where \c controller - is the id of our AnimationController: - - \quotefromfile demos/calqlatr/calqlatr.qml - \skipto MouseArea - \printuntil { - \dots 12 - \skipto onReleased - \printuntil } - \printuntil } - - Unlike other QML animation types, AnimationController is not driven by - internal timers but by explicitly setting its progress property to a - value between \c 0.0 and \c 1.0. - - Inside the AnimationController, we run two NumberAnimation instances in - parallel to move the number pad and the display components simultaneously to - the opposite sides of the view. In addition, we run a SequentialAnimation - instance to scale the number pad during the transition, giving the animation - some depth. - - \quotefromfile demos/calqlatr/calqlatr.qml - \skipto AnimationController - \printuntil 1; easing.type - \printuntil } - \printuntil } - \printuntil } - - We use the easing curve of the type \c Easing.InOutQuad to accelerate the - motion until halfway and then decelerate it. - - In Button.qml, the text colors of the number pad buttons are also animated. - - \quotefromfile demos/calqlatr/content/Button.qml - \skipto Text - \printuntil id: - \dots 8 - \skipto color: - \printuntil ] - \printuntil } - - We use \l {QtQml::Qt::darker()}{Qt.darker()} to darken the color when the - button is dimmed, and \l {QtQml::Qt::lighter()}{Qt.lighter()} to \e {light up} - the button when pressed. The latter is done in a separate \l [QML] {State} - {state} called \e "pressed", which activates when the \c pressed - property of the button's MouseArea is set. - - The color changes are animated by defining a \l Behavior on the \c color - property. - - In order to dynamically change the \c dimmed property of all the buttons - of the \c NumberPad, we connect its \c buttonPressed signal to the - \c Button's \c updateDimmed() function in Button.qml: - - \quotefromfile demos/calqlatr/content/Button.qml - \skipto function updateDimmed() { - \printuntil buttonPressed.connect - \printuntil } - - This way, when a button is pressed, all buttons on the \c NumPad - receive a \c buttonPressed signal and are activated or deactivated - according to the state of the calculator engine. - - \section1 Performing Calculations - - The calculator.js file defines our calculator engine. It contains variables - to store the calculator state, and functions that are called when the - user presses the digit and operator buttons. To use the engine, we - import calculator.js in the calqlatr.qml file as \c CalcEngine: - - \code - import "content/calculator.js" as CalcEngine - \endcode - - Importing the engine creates a new instance of it. Therefore, we only do it - in the main QML file, \c calqlatr.qml. The root item defined in this file - contains helper functions that allow other types to access the calculator - engine: - - \quotefromfile demos/calqlatr/calqlatr.qml - \skipto operatorPressed - \printuntil CalcEngine.disabled - \printuntil } - - When users press a digit, the text from the digit appears on the - display. When they press an operator, the appropriate calculation is - performed, and the result can be displayed using the equals (=) operator. - The clear (C) operator resets the calculator engine. - - \section1 List of Files - - \sa {QML Applications} -*/ diff --git a/examples/quick/demos/calqlatr/main.cpp b/examples/quick/demos/calqlatr/main.cpp deleted file mode 100644 index ca4f206da4..0000000000 --- a/examples/quick/demos/calqlatr/main.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(demos/calqlatr/calqlatr) diff --git a/examples/quick/demos/clocks/clocks.pro b/examples/quick/demos/clocks/clocks.pro deleted file mode 100644 index 21d3f7f971..0000000000 --- a/examples/quick/demos/clocks/clocks.pro +++ /dev/null @@ -1,14 +0,0 @@ -TEMPLATE = app - -QT += qml quick - -SOURCES += main.cpp -RESOURCES += clocks.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/clocks -INSTALLS += target - -OTHER_FILES += \ - clocks.qml \ - content/Clock.qml \ - content/*.png diff --git a/examples/quick/demos/clocks/clocks.qml b/examples/quick/demos/clocks/clocks.qml deleted file mode 100644 index d9694d169c..0000000000 --- a/examples/quick/demos/clocks/clocks.qml +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "content" as Content - -Rectangle { - id: root - width: 640; height: 320 - color: "#646464" - - ListView { - id: clockview - anchors.fill: parent - orientation: ListView.Horizontal - cacheBuffer: 2000 - snapMode: ListView.SnapOneItem - highlightRangeMode: ListView.ApplyRange - - delegate: Content.Clock { city: cityName; shift: timeShift } - model: ListModel { - ListElement { cityName: "New York"; timeShift: -4 } - ListElement { cityName: "London"; timeShift: 0 } - ListElement { cityName: "Oslo"; timeShift: 1 } - ListElement { cityName: "Mumbai"; timeShift: 5.5 } - ListElement { cityName: "Tokyo"; timeShift: 9 } - ListElement { cityName: "Brisbane"; timeShift: 10 } - ListElement { cityName: "Los Angeles"; timeShift: -8 } - } - } - - Image { - anchors.left: parent.left - anchors.bottom: parent.bottom - anchors.margins: 10 - source: "content/arrow.png" - rotation: -90 - opacity: clockview.atXBeginning ? 0 : 0.5 - Behavior on opacity { NumberAnimation { duration: 500 } } - } - - Image { - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.margins: 10 - source: "content/arrow.png" - rotation: 90 - opacity: clockview.atXEnd ? 0 : 0.5 - Behavior on opacity { NumberAnimation { duration: 500 } } - } -} diff --git a/examples/quick/demos/clocks/clocks.qmlproject b/examples/quick/demos/clocks/clocks.qmlproject deleted file mode 100644 index b15654600e..0000000000 --- a/examples/quick/demos/clocks/clocks.qmlproject +++ /dev/null @@ -1,8 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "clocks.qml" - QmlFiles { directory: "." } - JavaScriptFiles { directory: "." } - ImageFiles { directory: "." } -} diff --git a/examples/quick/demos/clocks/clocks.qrc b/examples/quick/demos/clocks/clocks.qrc deleted file mode 100644 index eaff4729ae..0000000000 --- a/examples/quick/demos/clocks/clocks.qrc +++ /dev/null @@ -1,15 +0,0 @@ -<RCC> - <qresource prefix="/demos/clocks"> - <file>clocks.qml</file> - <file>content/arrow.png</file> - <file>content/background.png</file> - <file>content/center.png</file> - <file>content/clock-night.png</file> - <file>content/clock.png</file> - <file>content/Clock.qml</file> - <file>content/hour.png</file> - <file>content/minute.png</file> - <file>content/quit.png</file> - <file>content/second.png</file> - </qresource> -</RCC> diff --git a/examples/quick/demos/clocks/content/Clock.qml b/examples/quick/demos/clocks/content/Clock.qml deleted file mode 100644 index 9e6ed16c80..0000000000 --- a/examples/quick/demos/clocks/content/Clock.qml +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - id : clock - width: { - if (ListView.view && ListView.view.width >= 200) - return ListView.view.width / Math.floor(ListView.view.width / 200.0); - else - return 200; - } - - height: { - if (ListView.view && ListView.view.height >= 240) - return ListView.view.height; - else - return 240; - } - - property alias city: cityLabel.text - property int hours - property int minutes - property int seconds - property real shift - property bool night: false - property bool internationalTime: true //Unset for local time - - function timeChanged() { - var date = new Date; - hours = internationalTime ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours() - night = ( hours < 7 || hours > 19 ) - minutes = internationalTime ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes() - seconds = date.getUTCSeconds(); - } - - Timer { - interval: 100; running: true; repeat: true; - onTriggered: clock.timeChanged() - } - - Item { - anchors.centerIn: parent - width: 200; height: 240 - - Image { id: background; source: "clock.png"; visible: clock.night == false } - Image { source: "clock-night.png"; visible: clock.night == true } - - - Image { - x: 92.5; y: 27 - source: "hour.png" - transform: Rotation { - id: hourRotation - origin.x: 7.5; origin.y: 73; - angle: (clock.hours * 30) + (clock.minutes * 0.5) - Behavior on angle { - SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } - } - } - } - - Image { - x: 93.5; y: 17 - source: "minute.png" - transform: Rotation { - id: minuteRotation - origin.x: 6.5; origin.y: 83; - angle: clock.minutes * 6 - Behavior on angle { - SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } - } - } - } - - Image { - x: 97.5; y: 20 - source: "second.png" - transform: Rotation { - id: secondRotation - origin.x: 2.5; origin.y: 80; - angle: clock.seconds * 6 - Behavior on angle { - SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } - } - } - } - - Image { - anchors.centerIn: background; source: "center.png" - } - - Text { - id: cityLabel - y: 210; anchors.horizontalCenter: parent.horizontalCenter - color: "white" - font.family: "Helvetica" - font.bold: true; font.pixelSize: 16 - style: Text.Raised; styleColor: "black" - } - } -} diff --git a/examples/quick/demos/clocks/content/arrow.png b/examples/quick/demos/clocks/content/arrow.png Binary files differdeleted file mode 100644 index e437312217..0000000000 --- a/examples/quick/demos/clocks/content/arrow.png +++ /dev/null diff --git a/examples/quick/demos/clocks/content/background.png b/examples/quick/demos/clocks/content/background.png Binary files differdeleted file mode 100644 index a885950862..0000000000 --- a/examples/quick/demos/clocks/content/background.png +++ /dev/null diff --git a/examples/quick/demos/clocks/content/center.png b/examples/quick/demos/clocks/content/center.png Binary files differdeleted file mode 100644 index 7fbd802a44..0000000000 --- a/examples/quick/demos/clocks/content/center.png +++ /dev/null diff --git a/examples/quick/demos/clocks/content/clock-night.png b/examples/quick/demos/clocks/content/clock-night.png Binary files differdeleted file mode 100644 index cc7151a397..0000000000 --- a/examples/quick/demos/clocks/content/clock-night.png +++ /dev/null diff --git a/examples/quick/demos/clocks/content/clock.png b/examples/quick/demos/clocks/content/clock.png Binary files differdeleted file mode 100644 index 462edacc0e..0000000000 --- a/examples/quick/demos/clocks/content/clock.png +++ /dev/null diff --git a/examples/quick/demos/clocks/content/hour.png b/examples/quick/demos/clocks/content/hour.png Binary files differdeleted file mode 100644 index 9f33fc5d48..0000000000 --- a/examples/quick/demos/clocks/content/hour.png +++ /dev/null diff --git a/examples/quick/demos/clocks/content/minute.png b/examples/quick/demos/clocks/content/minute.png Binary files differdeleted file mode 100644 index e2f216c897..0000000000 --- a/examples/quick/demos/clocks/content/minute.png +++ /dev/null diff --git a/examples/quick/demos/clocks/content/quit.png b/examples/quick/demos/clocks/content/quit.png Binary files differdeleted file mode 100644 index b822057d4e..0000000000 --- a/examples/quick/demos/clocks/content/quit.png +++ /dev/null diff --git a/examples/quick/demos/clocks/content/second.png b/examples/quick/demos/clocks/content/second.png Binary files differdeleted file mode 100644 index d95d99e83d..0000000000 --- a/examples/quick/demos/clocks/content/second.png +++ /dev/null diff --git a/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png b/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png Binary files differdeleted file mode 100644 index 94b641d891..0000000000 --- a/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png +++ /dev/null diff --git a/examples/quick/demos/clocks/doc/src/clocks.qdoc b/examples/quick/demos/clocks/doc/src/clocks.qdoc deleted file mode 100644 index b5bd446cd3..0000000000 --- a/examples/quick/demos/clocks/doc/src/clocks.qdoc +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Qt Quick Demo - Clocks - \ingroup qtquickdemos - \example demos/clocks - \brief A QML clock application that demonstrates using a ListView type to - display data generated by a ListModel and a SpringAnimation type to animate - images. - \image qtquick-demo-clocks-small.png - - \e Clocks demonstrates using a ListView type to display data generated by a - ListModel. The delegate used by the model is specified as a custom QML type - that is specified in the Clock.qml file. - - JavaScript methods are used to fetch the current time in several cities in - different time zones and QML types are used to display the time on a clock - face with animated clock hands. - - \include examples-run.qdocinc - - \section1 Displaying Data Generated by List Models - - In the clocks.qml file, we use a \l Rectangle type to create the application - main window: - - \quotefromfile demos/clocks/clocks.qml - \skipto Rectangle - \printuntil color - - We use a ListView type to display a list of the items provided by a - ListModel type: - - \printuntil Los Angeles - \printuntil } - \printuntil } - - List elements are defined like other QML types except that they contain a - collection of \e role definitions instead of properties. Roles both define - how the data is accessed and include the data itself. - - For each list element, we use the \c cityName role to specify the name of a - city and the \c timeShift role to specify a time zone as a positive or - negative offset from UTC (coordinated universal time). - - The Clock custom type is used as the ListView's \c delegate, defining the - visual appearance of list items. To use the Clock type, we add an import - statement that imports the folder called \c content where the type is - located: - - \quotefromfile demos/clocks/clocks.qml - \skipto content - \printuntil " - - We use an \l Image type to display arrows that indicate whether users can - flick the view to see more clocks on the left or right: - - \quotefromfile demos/clocks/clocks.qml - \skipto Image - \printuntil /^\}/ - - We use the \c opacity property to hide the arrows when the list view is - located at the beginning or end of the x axis. - - In Clock.qml, we define a \c timeChanged() function in which we use - methods from the JavaScript \c Date object to fetch the current time in - UTC and to adjust it to the correct time zone: - - \quotefromfile demos/clocks/content/Clock.qml - \skipto timeChanged - \printuntil } - - We use a \l Timer type to update the time at intervals of 100 milliseconds: - - \printuntil } - - We use \l Image types within an \l Item type to display the time on an - analog clock face. Different images are used for daytime and nighttime - hours: - - \printuntil clock-night.png - - A \l Rotation transform applied to \l Image types provides a way to rotate - the clock hands. The \c origin property holds the point that stays fixed - relative to the parent as the rest of the item rotates. The \c angle - property determines the angle to rotate the hands in degrees clockwise. - - \printuntil center.png - \printuntil } - - We use a \l Behavior type on the \c angle property to apply a - SpringAnimation when the time changes. The \c spring and \c damping - properties enable the spring-like motion of the clock hands, and a - \c modulus of \c 360 makes the animation target values wrap around at a - full circle. - - We use a \l Text type to display the city name below the clock: - - \printuntil } - - \sa {QML Applications} -*/ diff --git a/examples/quick/demos/clocks/main.cpp b/examples/quick/demos/clocks/main.cpp deleted file mode 100644 index dd642fc24f..0000000000 --- a/examples/quick/demos/clocks/main.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(demos/clocks/clocks) diff --git a/examples/quick/demos/demos.pro b/examples/quick/demos/demos.pro deleted file mode 100644 index 0644b81a22..0000000000 --- a/examples/quick/demos/demos.pro +++ /dev/null @@ -1,11 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = samegame \ - calqlatr \ - clocks \ - tweetsearch \ - maroon \ - photosurface \ - stocqt - -qtHaveModule(xmlpatterns): SUBDIRS += rssnews photoviewer - diff --git a/examples/quick/demos/maroon/content/BuildButton.qml b/examples/quick/demos/maroon/content/BuildButton.qml deleted file mode 100644 index b44b158d78..0000000000 --- a/examples/quick/demos/maroon/content/BuildButton.qml +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "logic.js" as Logic - -Item { - id: container - width: 64 - height: 64 - property alias source: img.source - property int index - property int row: 0 - property int col: 0 - property int towerType - property bool canBuild: true - property Item gameCanvas: parent.parent.parent - signal clicked() - - Image { - id: img - opacity: (canBuild && gameCanvas.coins >= Logic.towerData[towerType-1].cost) ? 1.0 : 0.4 - } - Text { - anchors.right: parent.right - font.pointSize: 14 - font.bold: true - color: "#ffffff" - text: Logic.towerData[towerType - 1].cost - } - MouseArea { - anchors.fill: parent - onClicked: { - Logic.buildTower(towerType, col, row) - container.clicked() - } - } - Image { - visible: col == index && row != 0 - source: "gfx/dialog-pointer.png" - anchors.top: parent.bottom - anchors.topMargin: 4 - anchors.horizontalCenter: parent.horizontalCenter - } - Image { - visible: col == index && row == 0 - source: "gfx/dialog-pointer.png" - rotation: 180 - anchors.bottom: parent.top - anchors.bottomMargin: 6 - anchors.horizontalCenter: parent.horizontalCenter - } -} diff --git a/examples/quick/demos/maroon/content/GameCanvas.qml b/examples/quick/demos/maroon/content/GameCanvas.qml deleted file mode 100644 index e461a3aaf1..0000000000 --- a/examples/quick/demos/maroon/content/GameCanvas.qml +++ /dev/null @@ -1,240 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "logic.js" as Logic -import "towers" as Towers - -Item { - id: grid - - property int squareSize: 64 - property int rows: 6 - property int cols: 4 - property Item canvas: grid - property int score: 0 - property int coins: 100 - property int lives: 3 - property int waveNumber: 0 - property int waveProgress: 0 - property var towers - property var mobs - property bool gameRunning: false - property bool gameOver: false - property bool errored: false - property string errorString: "" - - width: cols * squareSize - height: rows * squareSize - - function freshState() { - lives = 3 - coins = 100 - score = 0 - waveNumber = 0 - waveProgress = 0 - gameOver = false - gameRunning = false - towerMenu.shown = false - helpButton.comeBack(); - } - - Text { - id: errorText // Mostly for debug purposes - text: errorString - visible: errored - color: "red" - font.pixelSize: 18 - wrapMode: Text.WordWrap - width: parent.width / 1.2 - height: parent.height / 1.2 - anchors.centerIn: parent - z: 1000 - } - - Timer { - interval: 16 - running: true - repeat: true - onTriggered: Logic.tick() - } - - MouseArea { - id: ma - anchors.fill: parent - onClicked: { - if (towerMenu.visible) - towerMenu.finish() - else - towerMenu.open(mouse.x, mouse.y) - } - } - - Image { - id: towerMenu - visible: false - z: 1500 - scale: 0.9 - opacity: 0.7 - property int dragDistance: 16 - property int targetRow: 0 - property int targetCol: 0 - property bool shown: false - property bool towerExists: false - - function finish() { - shown = false - } - - function open(xp,yp) { - if (!grid.gameRunning) - return - targetRow = Logic.row(yp) - targetCol = Logic.col(xp) - if (targetRow == 0) - towerMenu.y = (targetRow + 1) * grid.squareSize - else - towerMenu.y = (targetRow - 1) * grid.squareSize - towerExists = (grid.towers[Logic.towerIdx(targetCol, targetRow)] != null) - shown = true - helpButton.goAway(); - } - - states: State { - name: "shown"; when: towerMenu.shown && !grid.gameOver - PropertyChanges { target: towerMenu; visible: true; scale: 1; opacity: 1 } - } - - transitions: Transition { - PropertyAction { property: "visible" } - NumberAnimation { properties: "opacity,scale"; duration: 500; easing.type: Easing.OutElastic } - } - - x: -32 - source: "gfx/dialog.png" - Row { - id: buttonRow - height: 100 - anchors.centerIn: parent - spacing: 8 - BuildButton { - row: towerMenu.targetRow; col: towerMenu.targetCol - anchors.verticalCenter: parent.verticalCenter - towerType: 1; index: 0 - canBuild: !towerMenu.towerExists - source: "gfx/dialog-melee.png" - onClicked: towerMenu.finish() - } - BuildButton { - row: towerMenu.targetRow; col: towerMenu.targetCol - anchors.verticalCenter: parent.verticalCenter - towerType: 2; index: 1 - canBuild: !towerMenu.towerExists - source: "gfx/dialog-shooter.png" - onClicked: towerMenu.finish() - } - BuildButton { - row: towerMenu.targetRow; col: towerMenu.targetCol - anchors.verticalCenter: parent.verticalCenter - towerType: 3; index: 2 - canBuild: !towerMenu.towerExists - source: "gfx/dialog-bomb.png" - onClicked: towerMenu.finish() - } - BuildButton { - row: towerMenu.targetRow; col: towerMenu.targetCol - anchors.verticalCenter: parent.verticalCenter - towerType: 4; index: 3 - canBuild: !towerMenu.towerExists - source: "gfx/dialog-factory.png" - onClicked: towerMenu.finish() - } - } - } - - - Keys.onPressed: { // Cheat Codes while Testing - if (event.key == Qt.Key_Up && (event.modifiers & Qt.ShiftModifier)) - grid.coins += 10; - if (event.key == Qt.Key_Left && (event.modifiers & Qt.ShiftModifier)) - grid.lives += 1; - if (event.key == Qt.Key_Down && (event.modifiers & Qt.ShiftModifier)) - Logic.gameState.waveProgress += 1000; - if (event.key == Qt.Key_Right && (event.modifiers & Qt.ShiftModifier)) - Logic.endGame(); - } - - Image { - id: helpButton - z: 1010 - source: "gfx/button-help.png" - function goAway() { - helpMA.enabled = false; - helpButton.opacity = 0; - } - function comeBack() { - helpMA.enabled = true; - helpButton.opacity = 1; - } - Behavior on opacity { NumberAnimation {} } - MouseArea { - id: helpMA - anchors.fill: parent - onClicked: {helpImage.visible = true; helpButton.visible = false;} - } - - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - anchors.bottomMargin: 0 - } - - Image { - id: helpImage - z: 1010 - source: "gfx/help.png" - anchors.fill: parent - visible: false - MouseArea { - anchors.fill: parent - onClicked: helpImage.visible = false; - } - } - -} diff --git a/examples/quick/demos/maroon/content/GameOverScreen.qml b/examples/quick/demos/maroon/content/GameOverScreen.qml deleted file mode 100644 index db045ba760..0000000000 --- a/examples/quick/demos/maroon/content/GameOverScreen.qml +++ /dev/null @@ -1,115 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 -import "logic.js" as Logic - -Item { - id: gameOverScreen - width: 320 - height: 400 - property GameCanvas gameCanvas - - Image { - id: img - source: "gfx/text-gameover.png" - anchors.centerIn: parent - } - - ParticleSystem { - anchors.fill: parent - ImageParticle { - id: cloud - source: "gfx/cloud.png" - alphaVariation: 0.25 - opacity: 0.25 - } - - Wander { - xVariance: 100; - pace: 1; - } - - Emitter { - id: cloudLeft - width: 160 - height: 160 - anchors.right: parent.left - emitRate: 0.5 - lifeSpan: 12000 - velocity: PointDirection{ x: 64; xVariation: 2; yVariation: 2 } - size: 160 - } - - Emitter { - id: cloudRight - width: 160 - height: 160 - anchors.left: parent.right - emitRate: 0.5 - lifeSpan: 12000 - velocity: PointDirection{ x: -64; xVariation: 2; yVariation: 2 } - size: 160 - } - } - - - Text { - visible: gameCanvas != undefined - text: "You saved " + gameCanvas.score + " fishes!" - anchors.top: img.bottom - anchors.topMargin: 12 - anchors.horizontalCenter: parent.horizontalCenter - font.bold: true - color: "#000000" - opacity: 0.5 - } - - Image { - source: "gfx/button-play.png" - anchors.bottom: parent.bottom - anchors.bottomMargin: 0 - MouseArea { - anchors.fill: parent - onClicked: gameCanvas.gameOver = false//This will actually trigger the state change in main.qml - } - } -} diff --git a/examples/quick/demos/maroon/content/InfoBar.qml b/examples/quick/demos/maroon/content/InfoBar.qml deleted file mode 100644 index ff5738de51..0000000000 --- a/examples/quick/demos/maroon/content/InfoBar.qml +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - height: childrenRect.height - - // Display the number of lives - Row { - anchors.left: parent.left - anchors.leftMargin: 10 - spacing: 5 - Repeater { - id: rep - model: Math.min(10, canvas.lives) - delegate: Image { source: "gfx/lifes.png" } - } - } - - // Display the number of fishes saved - Row { - anchors.right: points.left - anchors.rightMargin: 20 - spacing: 5 - Image { source: "gfx/scores.png" } - Text { - text: canvas.score - font.bold: true - } - } - - // Display the number of coins - Row { - id: points - anchors.right: parent.right - anchors.rightMargin: 10 - spacing: 5 - Image { source: "gfx/points.png" } - Text { - id: pointsLabel - text: canvas.coins - font.bold: true - } - } -} - diff --git a/examples/quick/demos/maroon/content/NewGameScreen.qml b/examples/quick/demos/maroon/content/NewGameScreen.qml deleted file mode 100644 index f078300d05..0000000000 --- a/examples/quick/demos/maroon/content/NewGameScreen.qml +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -// This is the first screen. -// It shows the logo and emit a startButtonClicked signal -// when the user press the "PLAY" button. - -Item { - id: newGameScreen - width: 320 - height: 480 - - signal startButtonClicked - - Image { - source: "gfx/logo.png" - anchors.top: parent.top - anchors.topMargin: 60 - } - - Image { - source: "gfx/logo-fish.png" - anchors.top: parent.top - - SequentialAnimation on x { - loops: Animation.Infinite - NumberAnimation { from: x + 148; to: x + 25; duration: 2000; easing.type: Easing.InOutQuad } - NumberAnimation { from: x + 25; to: x + 148; duration: 1600; easing.type: Easing.InOutQuad } - } - SequentialAnimation on anchors.topMargin { - loops: Animation.Infinite - NumberAnimation { from: 100; to: 60; duration: 1600; easing.type: Easing.InOutQuad } - NumberAnimation { from: 60; to: 100; duration: 2000; easing.type: Easing.InOutQuad } - } - } - - Image { - source: "gfx/logo-bubble.png" - anchors.top: parent.top - - SequentialAnimation on x { - loops: Animation.Infinite - NumberAnimation { from: x + 140; to: x + 40; duration: 2000; easing.type: Easing.InOutQuad } - NumberAnimation { from: x + 40; to: x + 140; duration: 1600; easing.type: Easing.InOutQuad } - } - SequentialAnimation on anchors.topMargin { - loops: Animation.Infinite - NumberAnimation { from: 100; to: 60; duration: 1600; easing.type: Easing.InOutQuad } - NumberAnimation { from: 60; to: 100; duration: 2000; easing.type: Easing.InOutQuad } - } - SequentialAnimation on width { - loops: Animation.Infinite - NumberAnimation { from: 140; to: 160; duration: 1000; easing.type: Easing.InOutQuad } - NumberAnimation { from: 160; to: 140; duration: 800; easing.type: Easing.InOutQuad } - } - SequentialAnimation on height { - loops: Animation.Infinite - NumberAnimation { from: 150; to: 140; duration: 800; easing.type: Easing.InOutQuad } - NumberAnimation { from: 140; to: 150; duration: 1000; easing.type: Easing.InOutQuad } - } - } - - Image { - source: "gfx/button-play.png" - anchors.bottom: parent.bottom - anchors.bottomMargin: 60 - MouseArea { - anchors.fill: parent - onClicked: newGameScreen.startButtonClicked() - } - } -} diff --git a/examples/quick/demos/maroon/content/SoundEffect.qml b/examples/quick/demos/maroon/content/SoundEffect.qml deleted file mode 100644 index 136b33aa9b..0000000000 --- a/examples/quick/demos/maroon/content/SoundEffect.qml +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -//Proxies a SoundEffect if QtMultimedia is installed -Item { - id: container - property QtObject effect: Qt.createQmlObject("import QtMultimedia 5.0; SoundEffect{ source: '" + container.source + "'; muted: !Qt.application.active }", container); - property url source: "" - onSourceChanged: if (effect != null) effect.source = source; - function play() { - if (effect != null) - effect.play(); - } -} diff --git a/examples/quick/demos/maroon/content/audio/bomb-action.wav b/examples/quick/demos/maroon/content/audio/bomb-action.wav Binary files differdeleted file mode 100644 index b334dc1e5b..0000000000 --- a/examples/quick/demos/maroon/content/audio/bomb-action.wav +++ /dev/null diff --git a/examples/quick/demos/maroon/content/audio/catch-action.wav b/examples/quick/demos/maroon/content/audio/catch-action.wav Binary files differdeleted file mode 100644 index 3e22124abf..0000000000 --- a/examples/quick/demos/maroon/content/audio/catch-action.wav +++ /dev/null diff --git a/examples/quick/demos/maroon/content/audio/catch.wav b/examples/quick/demos/maroon/content/audio/catch.wav Binary files differdeleted file mode 100644 index d3eade87f8..0000000000 --- a/examples/quick/demos/maroon/content/audio/catch.wav +++ /dev/null diff --git a/examples/quick/demos/maroon/content/audio/currency.wav b/examples/quick/demos/maroon/content/audio/currency.wav Binary files differdeleted file mode 100644 index 0d9ef2c200..0000000000 --- a/examples/quick/demos/maroon/content/audio/currency.wav +++ /dev/null diff --git a/examples/quick/demos/maroon/content/audio/factory-action.wav b/examples/quick/demos/maroon/content/audio/factory-action.wav Binary files differdeleted file mode 100644 index a2ace6c221..0000000000 --- a/examples/quick/demos/maroon/content/audio/factory-action.wav +++ /dev/null diff --git a/examples/quick/demos/maroon/content/audio/melee-action.wav b/examples/quick/demos/maroon/content/audio/melee-action.wav Binary files differdeleted file mode 100644 index d325af4700..0000000000 --- a/examples/quick/demos/maroon/content/audio/melee-action.wav +++ /dev/null diff --git a/examples/quick/demos/maroon/content/audio/projectile-action.wav b/examples/quick/demos/maroon/content/audio/projectile-action.wav Binary files differdeleted file mode 100644 index 4e2284fceb..0000000000 --- a/examples/quick/demos/maroon/content/audio/projectile-action.wav +++ /dev/null diff --git a/examples/quick/demos/maroon/content/audio/shooter-action.wav b/examples/quick/demos/maroon/content/audio/shooter-action.wav Binary files differdeleted file mode 100644 index 3e12b9419a..0000000000 --- a/examples/quick/demos/maroon/content/audio/shooter-action.wav +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/background.png b/examples/quick/demos/maroon/content/gfx/background.png Binary files differdeleted file mode 100644 index d548b9314e..0000000000 --- a/examples/quick/demos/maroon/content/gfx/background.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/bomb-action.png b/examples/quick/demos/maroon/content/gfx/bomb-action.png Binary files differdeleted file mode 100644 index 42da5d789f..0000000000 --- a/examples/quick/demos/maroon/content/gfx/bomb-action.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/bomb-idle.png b/examples/quick/demos/maroon/content/gfx/bomb-idle.png Binary files differdeleted file mode 100644 index 3bd62e261d..0000000000 --- a/examples/quick/demos/maroon/content/gfx/bomb-idle.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/bomb.png b/examples/quick/demos/maroon/content/gfx/bomb.png Binary files differdeleted file mode 100644 index 380da7d1a5..0000000000 --- a/examples/quick/demos/maroon/content/gfx/bomb.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/button-help.png b/examples/quick/demos/maroon/content/gfx/button-help.png Binary files differdeleted file mode 100644 index aecebc1275..0000000000 --- a/examples/quick/demos/maroon/content/gfx/button-help.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/button-play.png b/examples/quick/demos/maroon/content/gfx/button-play.png Binary files differdeleted file mode 100644 index 6cdad6c845..0000000000 --- a/examples/quick/demos/maroon/content/gfx/button-play.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/catch-action.png b/examples/quick/demos/maroon/content/gfx/catch-action.png Binary files differdeleted file mode 100644 index 78ca9fe1cc..0000000000 --- a/examples/quick/demos/maroon/content/gfx/catch-action.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/catch.png b/examples/quick/demos/maroon/content/gfx/catch.png Binary files differdeleted file mode 100644 index b7620fe3de..0000000000 --- a/examples/quick/demos/maroon/content/gfx/catch.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/cloud.png b/examples/quick/demos/maroon/content/gfx/cloud.png Binary files differdeleted file mode 100644 index d7c35f8555..0000000000 --- a/examples/quick/demos/maroon/content/gfx/cloud.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/currency.png b/examples/quick/demos/maroon/content/gfx/currency.png Binary files differdeleted file mode 100644 index 1571341f6c..0000000000 --- a/examples/quick/demos/maroon/content/gfx/currency.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/dialog-bomb.png b/examples/quick/demos/maroon/content/gfx/dialog-bomb.png Binary files differdeleted file mode 100644 index 708d916ad7..0000000000 --- a/examples/quick/demos/maroon/content/gfx/dialog-bomb.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/dialog-factory.png b/examples/quick/demos/maroon/content/gfx/dialog-factory.png Binary files differdeleted file mode 100644 index d2e2a48e31..0000000000 --- a/examples/quick/demos/maroon/content/gfx/dialog-factory.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/dialog-melee.png b/examples/quick/demos/maroon/content/gfx/dialog-melee.png Binary files differdeleted file mode 100644 index 069d18d477..0000000000 --- a/examples/quick/demos/maroon/content/gfx/dialog-melee.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/dialog-pointer.png b/examples/quick/demos/maroon/content/gfx/dialog-pointer.png Binary files differdeleted file mode 100644 index 9b51a090f9..0000000000 --- a/examples/quick/demos/maroon/content/gfx/dialog-pointer.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/dialog-shooter.png b/examples/quick/demos/maroon/content/gfx/dialog-shooter.png Binary files differdeleted file mode 100644 index af980caabd..0000000000 --- a/examples/quick/demos/maroon/content/gfx/dialog-shooter.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/dialog.png b/examples/quick/demos/maroon/content/gfx/dialog.png Binary files differdeleted file mode 100644 index d528ba78d1..0000000000 --- a/examples/quick/demos/maroon/content/gfx/dialog.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/factory-action.png b/examples/quick/demos/maroon/content/gfx/factory-action.png Binary files differdeleted file mode 100644 index 8981678267..0000000000 --- a/examples/quick/demos/maroon/content/gfx/factory-action.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/factory-idle.png b/examples/quick/demos/maroon/content/gfx/factory-idle.png Binary files differdeleted file mode 100644 index a145582c8f..0000000000 --- a/examples/quick/demos/maroon/content/gfx/factory-idle.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/factory.png b/examples/quick/demos/maroon/content/gfx/factory.png Binary files differdeleted file mode 100644 index bfb9f3fb79..0000000000 --- a/examples/quick/demos/maroon/content/gfx/factory.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/grid.png b/examples/quick/demos/maroon/content/gfx/grid.png Binary files differdeleted file mode 100644 index b59555247a..0000000000 --- a/examples/quick/demos/maroon/content/gfx/grid.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/help.png b/examples/quick/demos/maroon/content/gfx/help.png Binary files differdeleted file mode 100644 index 4654e4c69b..0000000000 --- a/examples/quick/demos/maroon/content/gfx/help.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/lifes.png b/examples/quick/demos/maroon/content/gfx/lifes.png Binary files differdeleted file mode 100644 index 135310b38c..0000000000 --- a/examples/quick/demos/maroon/content/gfx/lifes.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/logo-bubble.png b/examples/quick/demos/maroon/content/gfx/logo-bubble.png Binary files differdeleted file mode 100644 index 136151caff..0000000000 --- a/examples/quick/demos/maroon/content/gfx/logo-bubble.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/logo-fish.png b/examples/quick/demos/maroon/content/gfx/logo-fish.png Binary files differdeleted file mode 100644 index c41833a0c9..0000000000 --- a/examples/quick/demos/maroon/content/gfx/logo-fish.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/logo.png b/examples/quick/demos/maroon/content/gfx/logo.png Binary files differdeleted file mode 100644 index 787ac99ce8..0000000000 --- a/examples/quick/demos/maroon/content/gfx/logo.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/melee-action.png b/examples/quick/demos/maroon/content/gfx/melee-action.png Binary files differdeleted file mode 100644 index c53873bfcc..0000000000 --- a/examples/quick/demos/maroon/content/gfx/melee-action.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/melee-idle.png b/examples/quick/demos/maroon/content/gfx/melee-idle.png Binary files differdeleted file mode 100644 index 621d9dff54..0000000000 --- a/examples/quick/demos/maroon/content/gfx/melee-idle.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/melee.png b/examples/quick/demos/maroon/content/gfx/melee.png Binary files differdeleted file mode 100644 index ab240151f3..0000000000 --- a/examples/quick/demos/maroon/content/gfx/melee.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/mob-idle.png b/examples/quick/demos/maroon/content/gfx/mob-idle.png Binary files differdeleted file mode 100644 index dedacc7866..0000000000 --- a/examples/quick/demos/maroon/content/gfx/mob-idle.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/mob.png b/examples/quick/demos/maroon/content/gfx/mob.png Binary files differdeleted file mode 100644 index 7569c3525a..0000000000 --- a/examples/quick/demos/maroon/content/gfx/mob.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/points.png b/examples/quick/demos/maroon/content/gfx/points.png Binary files differdeleted file mode 100644 index 1d2386dbe7..0000000000 --- a/examples/quick/demos/maroon/content/gfx/points.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/projectile-action.png b/examples/quick/demos/maroon/content/gfx/projectile-action.png Binary files differdeleted file mode 100644 index aa2e650aeb..0000000000 --- a/examples/quick/demos/maroon/content/gfx/projectile-action.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/projectile.png b/examples/quick/demos/maroon/content/gfx/projectile.png Binary files differdeleted file mode 100644 index c25a0c3890..0000000000 --- a/examples/quick/demos/maroon/content/gfx/projectile.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/scores.png b/examples/quick/demos/maroon/content/gfx/scores.png Binary files differdeleted file mode 100644 index af757fe64a..0000000000 --- a/examples/quick/demos/maroon/content/gfx/scores.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/shooter-action.png b/examples/quick/demos/maroon/content/gfx/shooter-action.png Binary files differdeleted file mode 100644 index 08e7e300ca..0000000000 --- a/examples/quick/demos/maroon/content/gfx/shooter-action.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/shooter-idle.png b/examples/quick/demos/maroon/content/gfx/shooter-idle.png Binary files differdeleted file mode 100644 index 663098d3b0..0000000000 --- a/examples/quick/demos/maroon/content/gfx/shooter-idle.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/shooter.png b/examples/quick/demos/maroon/content/gfx/shooter.png Binary files differdeleted file mode 100644 index d44401e055..0000000000 --- a/examples/quick/demos/maroon/content/gfx/shooter.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/sunlight.png b/examples/quick/demos/maroon/content/gfx/sunlight.png Binary files differdeleted file mode 100644 index d1c7042117..0000000000 --- a/examples/quick/demos/maroon/content/gfx/sunlight.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/text-1.png b/examples/quick/demos/maroon/content/gfx/text-1.png Binary files differdeleted file mode 100644 index 3ea399cc90..0000000000 --- a/examples/quick/demos/maroon/content/gfx/text-1.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/text-2.png b/examples/quick/demos/maroon/content/gfx/text-2.png Binary files differdeleted file mode 100644 index 934a481f3b..0000000000 --- a/examples/quick/demos/maroon/content/gfx/text-2.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/text-3.png b/examples/quick/demos/maroon/content/gfx/text-3.png Binary files differdeleted file mode 100644 index 47523f55b8..0000000000 --- a/examples/quick/demos/maroon/content/gfx/text-3.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/text-blank.png b/examples/quick/demos/maroon/content/gfx/text-blank.png Binary files differdeleted file mode 100644 index 4a687b24dc..0000000000 --- a/examples/quick/demos/maroon/content/gfx/text-blank.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/text-gameover.png b/examples/quick/demos/maroon/content/gfx/text-gameover.png Binary files differdeleted file mode 100644 index 4f53ef0b29..0000000000 --- a/examples/quick/demos/maroon/content/gfx/text-gameover.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/text-go.png b/examples/quick/demos/maroon/content/gfx/text-go.png Binary files differdeleted file mode 100644 index bfc26f71fc..0000000000 --- a/examples/quick/demos/maroon/content/gfx/text-go.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/gfx/wave.png b/examples/quick/demos/maroon/content/gfx/wave.png Binary files differdeleted file mode 100644 index f97426c4e7..0000000000 --- a/examples/quick/demos/maroon/content/gfx/wave.png +++ /dev/null diff --git a/examples/quick/demos/maroon/content/logic.js b/examples/quick/demos/maroon/content/logic.js deleted file mode 100644 index 7e087d8be4..0000000000 --- a/examples/quick/demos/maroon/content/logic.js +++ /dev/null @@ -1,264 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -.pragma library // Shared game state -.import QtQuick 2.0 as QQ - -// Game Stuff -var gameState // Local reference -function getGameState() { return gameState; } - -var towerData = [ // Name and cost, stats are in the delegate per instance - { "name": "Melee", "cost": 20 }, - { "name": "Ranged", "cost": 50 }, - { "name": "Bomb", "cost": 75 }, - { "name": "Factory", "cost": 25 } -] - -var waveBaseData = [300, 290, 280, 270, 220, 180, 160, 80, 80, 80, 30, 30, 30, 30]; -var waveData = []; - -var towerComponents = new Array(towerData.length); -var mobComponent = Qt.createComponent("mobs/MobBase.qml"); - -function endGame() -{ - gameState.gameRunning = false; - gameState.gameOver = true; - for (var i = 0; i < gameState.cols; i++) { - for (var j = 0; j < gameState.rows; j++) { - if (gameState.towers[towerIdx(i, j)]) { - gameState.towers[towerIdx(i, j)].destroy(); - gameState.towers[towerIdx(i, j)] = null; - } - } - for (var j in gameState.mobs[i]) - gameState.mobs[i][j].destroy(); - gameState.mobs[i].splice(0,gameState.mobs[i].length); //Leaves queue reusable - } -} - -function startGame(gameCanvas) -{ - waveData = new Array(); - for (var i in waveBaseData) - waveData[i] = waveBaseData[i]; - gameState.freshState(); - for (var i = 0; i < gameCanvas.cols; i++) { - for (var j = 0; j < gameCanvas.rows; j++) - gameState.towers[towerIdx(i, j)] = null; - gameState.mobs[i] = new Array(); - } - gameState.towers[towerIdx(0, 0)] = newTower(3, 0, 0);//Start with a starfish in the corner - gameState.gameRunning = true; - gameState.gameOver = false; -} - -function newGameState(gameCanvas) -{ - for (var i = 0; i < towerComponents.length; i++) { - towerComponents[i] = Qt.createComponent("towers/" + towerData[i].name + ".qml"); - if (towerComponents[i].status == QQ.Component.Error) { - gameCanvas.errored = true; - gameCanvas.errorString += "Loading Tower " + towerData[i].name + "\n" + (towerComponents[i].errorString()); - console.log(towerComponents[i].errorString()); - } - } - gameState = gameCanvas; - gameState.freshState(); - gameState.towers = new Array(gameCanvas.rows * gameCanvas.cols); - gameState.mobs = new Array(gameCanvas.cols); - return gameState; -} - -function row(y) -{ - return Math.floor(y / gameState.squareSize); -} - -function col(x) -{ - return Math.floor(x / gameState.squareSize); -} - -function towerIdx(x, y) -{ - return y + (x * gameState.rows); -} - -function newMob(col) -{ - var ret = mobComponent.createObject(gameState.canvas, - { "col" : col, - "speed" : (Math.min(2.0, 0.10 * (gameState.waveNumber + 1))), - "y" : gameState.canvas.height }); - gameState.mobs[col].push(ret); - return ret; -} - -function newTower(type, row, col) -{ - var ret = towerComponents[type].createObject(gameState.canvas); - ret.row = row; - ret.col = col; - ret.fireCounter = ret.rof; - ret.spawn(); - return ret; -} - -function buildTower(type, x, y) -{ - if (gameState.towers[towerIdx(x,y)] != null) { - if (type <= 0) { - gameState.towers[towerIdx(x,y)].sell(); - gameState.towers[towerIdx(x,y)] = null; - } - } else { - if (gameState.coins < towerData[type - 1].cost) - return; - gameState.towers[towerIdx(x, y)] = newTower(type - 1, y, x); - gameState.coins -= towerData[type - 1].cost; - } -} - -function killMob(col, mob) -{ - if (!mob) - return; - var idx = gameState.mobs[col].indexOf(mob); - if (idx == -1 || !mob.hp) - return; - mob.hp = 0; - mob.die(); - gameState.mobs[col].splice(idx,1); -} - -function killTower(row, col) -{ - var tower = gameState.towers[towerIdx(col, row)]; - if (!tower) - return; - tower.hp = 0; - tower.die(); - gameState.towers[towerIdx(col, row)] = null; -} - -function tick() -{ - if (!gameState.gameRunning) - return; - - // Spawn - gameState.waveProgress += 1; - var i = gameState.waveProgress; - var j = 0; - while (i > 0 && j < waveData.length) - i -= waveData[j++]; - if ( i == 0 ) // Spawn a mob - newMob(Math.floor(Math.random() * gameState.cols)); - if ( j == waveData.length ) { // Next Wave - gameState.waveNumber += 1; - gameState.waveProgress = 0; - var waveModifier = 10; // Constant governing how much faster the next wave is to spawn (not fish speed) - for (var k in waveData ) // Slightly faster - if (waveData[k] > waveModifier) - waveData[k] -= waveModifier; - } - - // Towers Attack - for (var j in gameState.towers) { - var tower = gameState.towers[j]; - if (tower == null) - continue; - if (tower.fireCounter > 0) { - tower.fireCounter -= 1; - continue; - } - var column = tower.col; - for (var k in gameState.mobs[column]) { - var conflict = gameState.mobs[column][k]; - if (conflict.y <= gameState.canvas.height && conflict.y + conflict.height > tower.y - && conflict.y - ((tower.row + 1) * gameState.squareSize) < gameState.squareSize * tower.range) { // In Range - tower.fire(); - tower.fireCounter = tower.rof; - conflict.hit(tower.damage); - } - } - - // Income - if (tower.income) { - gameState.coins += tower.income; - tower.fire(); - tower.fireCounter = tower.rof; - } - } - - // Mobs move - for (var i = 0; i < gameState.cols; i++) { - for (var j = 0; j < gameState.mobs[i].length; j++) { - var mob = gameState.mobs[i][j]; - var newPos = gameState.mobs[i][j].y - gameState.mobs[i][j].speed; - if (newPos < 0) { - gameState.lives -= 1; - killMob(i, mob); - if (gameState.lives <= 0) - endGame(); - continue; - } - var conflict = gameState.towers[towerIdx(i, row(newPos))]; - if (conflict != null) { - if (mob.y < conflict.y + gameState.squareSize) - gameState.mobs[i][j].y += gameState.mobs[i][j].speed * 10; // Moved inside tower, now hurry back out - if (mob.fireCounter > 0) { - mob.fireCounter--; - } else { - gameState.mobs[i][j].fire(); - conflict.hp -= mob.damage; - if (conflict.hp <= 0) - killTower(conflict.row, conflict.col); - mob.fireCounter = mob.rof; - } - } else { - gameState.mobs[i][j].y = newPos; - } - } - } - -} diff --git a/examples/quick/demos/maroon/content/mobs/MobBase.qml b/examples/quick/demos/maroon/content/mobs/MobBase.qml deleted file mode 100644 index b281408c9e..0000000000 --- a/examples/quick/demos/maroon/content/mobs/MobBase.qml +++ /dev/null @@ -1,262 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "../logic.js" as Logic -import ".." - -Item { - id: container - property string name: "Fish" - property int col: 0 - property real hp: 3 - property real damage: 1 - property real speed: 0.25 - property int rof: 30 //In ticks - property int fireCounter: 0 - property bool dying: false - width: parent ? parent.squareSize : 0 - height: parent ? parent.squareSize : 0 - x: col * width - z: 1001 - function fire() { } - - function die() { - if (dying) - return; - dying = true; - bubble.jumpTo("burst"); - if (fishSprite.currentSprite == "front") - fishSprite.jumpTo(Math.random() > 0.5 ? "left" : "right" ); - fishSwim.start(); - Logic.gameState.score += 1; - killedSound.play(); - bubble.scale = 0.9 - destroy(350); - } - - function inked() { - if (hp > 0) - ink.jumpTo("dirty"); - } - - function hit(dmg) { - hp -= dmg; - - if (hp <= 0) - Logic.killMob(col, container); - } - - Component.onCompleted: spawnSound.play() - - SoundEffect { - id: spawnSound - source: "../audio/catch.wav" - } - SoundEffect { - id: killedSound - source: "../audio/catch-action.wav" - } - - SpriteSequence { - id: fishSprite - width: 64 - height: 64 - interpolate: false - goalSprite: "" - - Sprite { - name: "left" - source: "../gfx/mob-idle.png" - frameWidth: 64 - frameHeight: 64 - frameCount: 1 - frameDuration: 800 - frameDurationVariation: 400 - to: { "front" : 1 } - } - - Sprite { - name: "front" - source: "../gfx/mob-idle.png" - frameCount: 1 - frameX: 64 - frameWidth: 64 - frameHeight: 64 - frameDuration: 800 - frameDurationVariation: 400 - to: { "left" : 1, "right" : 1 } - } - - Sprite { - name: "right" - source: "../gfx/mob-idle.png" - frameCount: 1 - frameX: 128 - frameWidth: 64 - frameHeight: 64 - frameDuration: 800 - frameDurationVariation: 400 - to: { "front" : 1 } - } - - - Sprite { //WORKAROUND: This prevents the triggering of a rendering error which is currently under investigation. - name: "dummy" - source: "../gfx/melee-idle.png" - frameCount: 8 - frameWidth: 64 - frameHeight: 64 - frameX: 0 - frameDuration: 200 - } - - NumberAnimation on x { - id: fishSwim - running: false - property bool goingLeft: fishSprite.currentSprite == "right" - to: goingLeft ? -360 : 360 - duration: 300 - } - } - - SpriteSequence { - id: bubble - width: 64 - height: 64 - scale: 0.4 + (0.2 * hp) - interpolate: false - goalSprite: "" - - Behavior on scale { - NumberAnimation { duration: 150; easing.type: Easing.OutBack } - } - - Sprite { - name: "big" - source: "../gfx/catch.png" - frameCount: 1 - to: { "burst" : 0 } - } - - Sprite { - name: "burst" - source: "../gfx/catch-action.png" - frameCount: 3 - frameX: 64 - frameDuration: 200 - } - - Sprite { //WORKAROUND: This prevents the triggering of a rendering error which is currently under investigation. - name: "dummy" - source: "../gfx/melee-idle.png" - frameCount: 8 - frameWidth: 64 - frameHeight: 64 - frameX: 0 - frameDuration: 200 - } - SequentialAnimation on width { - loops: Animation.Infinite - NumberAnimation { from: width * 1; to: width * 1.1; duration: 800; easing.type: Easing.InOutQuad } - NumberAnimation { from: width * 1.1; to: width * 1; duration: 1000; easing.type: Easing.InOutQuad } - } - SequentialAnimation on height { - loops: Animation.Infinite - NumberAnimation { from: height * 1; to: height * 1.15; duration: 1200; easing.type: Easing.InOutQuad } - NumberAnimation { from: height * 1.15; to: height * 1; duration: 1000; easing.type: Easing.InOutQuad } - } - } - - SpriteSequence { - id: ink - width: 64 - height: 64 - scale: bubble.scale - goalSprite: "" - - Sprite { - name: "clean" - source: "../gfx/projectile-action.png" - frameCount: 1 - frameX: 0 - frameWidth: 64 - frameHeight: 64 - } - Sprite { - name: "dirty" - source: "../gfx/projectile-action.png" - frameCount: 3 - frameX: 64 - frameWidth: 64 - frameHeight: 64 - frameDuration: 150 - to: {"clean":1} - } - - Sprite { //WORKAROUND: This prevents the triggering of a rendering error which is currently under investigation. - name: "dummy" - source: "../gfx/melee-idle.png" - frameCount: 8 - frameWidth: 64 - frameHeight: 64 - frameX: 0 - frameDuration: 200 - } - SequentialAnimation on width { - loops: Animation.Infinite - NumberAnimation { from: width * 1; to: width * 1.1; duration: 800; easing.type: Easing.InOutQuad } - NumberAnimation { from: width * 1.1; to: width * 1; duration: 1000; easing.type: Easing.InOutQuad } - } - SequentialAnimation on height { - loops: Animation.Infinite - NumberAnimation { from: height * 1; to: height * 1.15; duration: 1200; easing.type: Easing.InOutQuad } - NumberAnimation { from: height * 1.15; to: height * 1; duration: 1000; easing.type: Easing.InOutQuad } - } - - } - - SequentialAnimation on x { - loops: Animation.Infinite - NumberAnimation { from: x; to: x - 5; duration: 900; easing.type: Easing.InOutQuad } - NumberAnimation { from: x - 5; to: x; duration: 900; easing.type: Easing.InOutQuad } - } -} - diff --git a/examples/quick/demos/maroon/content/towers/Bomb.qml b/examples/quick/demos/maroon/content/towers/Bomb.qml deleted file mode 100644 index 85e0c8e53b..0000000000 --- a/examples/quick/demos/maroon/content/towers/Bomb.qml +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "../logic.js" as Logic -import ".." - -TowerBase { - id: container - hp: 10 - range: 0.4 - rof: 10 - property real detonationRange: 2.5 - - function fire() { - sound.play() - sprite.jumpTo("shoot") - animDelay.start() - } - - function finishFire() { - var sCol = Math.max(0, col - 1) - var eCol = Math.min(Logic.gameState.cols - 1, col + 1) - var killList = new Array() - for (var i = sCol; i <= eCol; i++) { - for (var j = 0; j < Logic.gameState.mobs[i].length; j++) - if (Math.abs(Logic.gameState.mobs[i][j].y - container.y) < Logic.gameState.squareSize * detonationRange) - killList.push(Logic.gameState.mobs[i][j]) - while (killList.length > 0) - Logic.killMob(i, killList.pop()) - } - Logic.killTower(row, col); - } - - Timer { - id: animDelay - running: false - interval: shootState.frameCount * shootState.frameDuration - onTriggered: finishFire() - } - - function die() - { - destroy() // No blink, because we usually meant to die - } - - SoundEffect { - id: sound - source: "../audio/bomb-action.wav" - } - - SpriteSequence { - id: sprite - width: 64 - height: 64 - interpolate: false - goalSprite: "" - - Sprite { - name: "idle" - source: "../gfx/bomb-idle.png" - frameCount: 4 - frameDuration: 800 - } - - Sprite { - id: shootState - name: "shoot" - source: "../gfx/bomb-action.png" - frameCount: 6 - frameDuration: 155 - to: { "dying" : 1 } // So that if it takes a frame to clean up, it is on the last frame of the explosion - } - - Sprite { - name: "dying" - source: "../gfx/bomb-action.png" - frameCount: 1 - frameX: 64 * 5 - frameWidth: 64 - frameHeight: 64 - frameDuration: 155 - } - - SequentialAnimation on x { - loops: Animation.Infinite - NumberAnimation { from: x; to: x + 4; duration: 900; easing.type: Easing.InOutQuad } - NumberAnimation { from: x + 4; to: x; duration: 900; easing.type: Easing.InOutQuad } - } - SequentialAnimation on y { - loops: Animation.Infinite - NumberAnimation { from: y; to: y - 4; duration: 900; easing.type: Easing.InOutQuad } - NumberAnimation { from: y - 4; to: y; duration: 900; easing.type: Easing.InOutQuad } - } - } -} diff --git a/examples/quick/demos/maroon/content/towers/Factory.qml b/examples/quick/demos/maroon/content/towers/Factory.qml deleted file mode 100644 index 154b12731e..0000000000 --- a/examples/quick/demos/maroon/content/towers/Factory.qml +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "../logic.js" as Logic -import ".." - -TowerBase { - id: container - rof: 160 - income: 5 - SpriteSequence { - id: sprite - width: 64 - height: 64 - interpolate: false - goalSprite: "" - - Sprite { - name: "idle" - source: "../gfx/factory-idle.png" - frameCount: 4 - frameDuration: 200 - } - - Sprite { - name: "action" - source: "../gfx/factory-action.png" - frameCount: 4 - frameDuration: 90 - to: { "idle" : 1 } - } - - SequentialAnimation on x { - loops: Animation.Infinite - NumberAnimation { from: x; to: x + 4; duration: 900; easing.type: Easing.InOutQuad } - NumberAnimation { from: x + 4; to: x; duration: 900; easing.type: Easing.InOutQuad } - } - SequentialAnimation on y { - loops: Animation.Infinite - NumberAnimation { from: y; to: y - 4; duration: 900; easing.type: Easing.InOutQuad } - NumberAnimation { from: y - 4; to: y; duration: 900; easing.type: Easing.InOutQuad } - } - } - - SoundEffect { - id: actionSound - source: "../audio/factory-action.wav" - } - - function fire() { - actionSound.play() - sprite.jumpTo("action") - coinLaunch.start() - } - - function spawn() { - coin.target = Logic.gameState.mapToItem(container, 240, -32) - } - - Image { - id: coin - property var target: { "x" : 0, "y" : 0 } - source: "../gfx/currency.png" - visible: false - } - - SequentialAnimation { - id: coinLaunch - PropertyAction { target: coin; property: "visible"; value: true } - ParallelAnimation { - NumberAnimation { target: coin; property: "x"; from: 16; to: coin.target.x } - NumberAnimation { target: coin; property: "y"; from: 16; to: coin.target.y } - } - PropertyAction { target: coin; property: "visible"; value: false } - } -} diff --git a/examples/quick/demos/maroon/content/towers/Melee.qml b/examples/quick/demos/maroon/content/towers/Melee.qml deleted file mode 100644 index ee2621fa2c..0000000000 --- a/examples/quick/demos/maroon/content/towers/Melee.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import ".." - -TowerBase { - hp: 4 - range: 0.1 - damage: 1 - rof: 40 - income: 0 - - SpriteSequence { - id: sprite - width: 64 - height: 64 - interpolate: false - goalSprite: "" - - Sprite { - name: "idle" - source: "../gfx/melee-idle.png" - frameCount: 8 - frameDuration: 250 - } - - Sprite { - name: "shoot" - source: "../gfx/melee-action.png" - frameCount: 2 - frameDuration: 200 - to: { "idle" : 1 } - } - } - - function fire() { - shootSound.play() - sprite.jumpTo("shoot") - } - - SoundEffect { - id: shootSound - source: "../audio/melee-action.wav" - } -} diff --git a/examples/quick/demos/maroon/content/towers/Ranged.qml b/examples/quick/demos/maroon/content/towers/Ranged.qml deleted file mode 100644 index 9a4180f14c..0000000000 --- a/examples/quick/demos/maroon/content/towers/Ranged.qml +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "../logic.js" as Logic -import ".." - -TowerBase { - id: container - hp: 2 - range: 6 - damage: 0 // By projectile - rof: 40 - income: 0 - property var targetMob - property real realDamage: 1 - function fire() { - proj.x = 32 - proj.width / 2 - proj.y = 0 - targetMob = Logic.gameState.mobs[col][0] - projAnim.to = targetMob.y - container.y -10 - projAnim.start() - shootSound.play() - sprite.jumpTo("shoot") - } - - Image { - id: proj - y: 1000 - SequentialAnimation on y { - id: projAnim - running: false - property real to: 1000 - SmoothedAnimation { - to: projAnim.to - velocity: 400 - } - ScriptAction { - script: { - if (targetMob && targetMob.hit) { - targetMob.hit(realDamage) - targetMob.inked() - projSound.play() - } - } - } - PropertyAction { - value: 1000; - } - } - source: "../gfx/projectile.png" - } - - SoundEffect { - id: shootSound - source: "../audio/shooter-action.wav" - } - SoundEffect { - id: projSound - source: "../audio/projectile-action.wav" - } - - SpriteSequence { - id: sprite - width: 64 - height: 64 - interpolate: false - goalSprite: "" - - Sprite { - name: "idle" - source: "../gfx/shooter-idle.png" - frameCount: 4 - frameDuration: 250 - } - - Sprite { - name: "shoot" - source: "../gfx/shooter-action.png" - frameCount: 5 - frameDuration: 90 - to: { "idle" : 1 } - } - - SequentialAnimation on x { - loops: Animation.Infinite - NumberAnimation { from: x; to: x - 4; duration: 900; easing.type: Easing.InOutQuad } - NumberAnimation { from: x - 4; to: x; duration: 900; easing.type: Easing.InOutQuad } - } - } -} diff --git a/examples/quick/demos/maroon/content/towers/TowerBase.qml b/examples/quick/demos/maroon/content/towers/TowerBase.qml deleted file mode 100644 index 127f2eeec6..0000000000 --- a/examples/quick/demos/maroon/content/towers/TowerBase.qml +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - property real hp: 1 - property real range: 0 - property real damage: 0 - property int rof: 100 - property int fireCounter: 0 - property int income: 0 - property int row: 0 - property int col: 0 - - width: parent ? parent.squareSize : 0 - height: parent ? parent.squareSize : 0 - //This is how it is placed on the gameboard, do not modify/animate the X/Y/Z of a TowerBase please - x: col * width - y: row * height - z: 1000 - - function fire() { } - function spawn() { } //After all game properties are set - function die() { stdDeath.start(); destroy(1000); } - function sell() { destroy(); } - - SequentialAnimation on opacity { - id: stdDeath - running: false - loops: 2 - NumberAnimation { from: 1; to: 0; } - NumberAnimation { from: 0; to: 1; } - } -} diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png Binary files differdeleted file mode 100644 index 6d41179c23..0000000000 --- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png +++ /dev/null diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png Binary files differdeleted file mode 100644 index c8f37486f6..0000000000 --- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png +++ /dev/null diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-3.jpg b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-3.jpg Binary files differdeleted file mode 100644 index a83e282d5f..0000000000 --- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-3.jpg +++ /dev/null diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-4.jpg b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-4.jpg Binary files differdeleted file mode 100644 index 8a6063b7c7..0000000000 --- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-4.jpg +++ /dev/null diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-5.jpg b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-5.jpg Binary files differdeleted file mode 100644 index e3e4a2ec89..0000000000 --- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-5.jpg +++ /dev/null diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-6.jpg b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-6.jpg Binary files differdeleted file mode 100644 index ad6b4bf156..0000000000 --- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-6.jpg +++ /dev/null diff --git a/examples/quick/demos/maroon/doc/src/maroon.qdoc b/examples/quick/demos/maroon/doc/src/maroon.qdoc deleted file mode 100644 index 3e38f8cfca..0000000000 --- a/examples/quick/demos/maroon/doc/src/maroon.qdoc +++ /dev/null @@ -1,889 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Qt Quick Demo - Maroon in Trouble - \ingroup qtquickdemos - \example demos/maroon - \brief A Qt Quick game for touch devices that uses SpriteSequence, - ParticleSystem, Emitter, and Wander types to animate objects and the SoundEffect type to - play sound effects. - - \image qtquick-demo-maroon-med-2.png - - \e{Maroon in Trouble} demonstrates QML features that are useful when - developing games: - - \list - \li Using custom QML types to create different screens for - different stages of the game. - \li Using the \l Item and \l Image types to construct a game background. - \li Using the SequentialAnimation, NumberAnimation, ParticleSystem, - \l Emitter, and \l Wander types to animate background objects. - \li Using the \l Timer and \l Repeater types to display a countdown - sequence before starting the game. - \li Using a custom QML type with custom properties to construct a game - board. - \li Using the SpriteSequence and \l Sprite types to add animated objects - to the game board. - \li Using a custom QML type that uses the \l Image type with some custom - properties to add a menu where the players can buy objects. - \li Using custom properties with private functions to keep track of game - statistics and a custom QML type to display them to the players. - \li Using the \l State type with JavaScript functions to manage game - states. - \li Using the \l SoundEffect type to play individual sound effects - depending on the object type and the action applied to the object. - \li Using signal handlers to specify keyboard shortcuts for some game - actions. - \li Using resource files to package game resources for deployment and - delivery. - \endlist - - \include examples-run.qdocinc - - \section1 Adding Screens - - In the Maroon in Trouble app, we use the following custom types that - are each defined in a separate .qml file to create the game screens: - - \list - \li NewGameScreen.qml - \li GameCanvas.qml - \li GameOverScreen.qml - \endlist - - To use the custom types, we add an import statement to the main QML file, - maroon.qml that imports the folder called \c content where the types are - located: - - \quotefromfile demos/maroon/maroon.qml - \skipto content - \printuntil " - - We use the screen types at different stages of the game. The NewGameScreen - type is used to create the screen that appears when the players start the - app. In NewGameScreen.qml, we use an \l{Image} type to create a New Game - button that the players can press to start a new game. - - \image qtquick-demo-maroon-med-1.png - - Tapping the button initiates a countdown timer that triggers the creation - of the game canvas by using the GameCanvas type. Another \l{Timer} type - spawns mobs of fish inside bubbles that the players must free before they - reach the surface. The players can tap on the screen to open a menu where - they can buy different types of weapons (melee, ranged, and bombs) to burst - the bubbles. - - \image qtquick-demo-maroon-med-2.png - - When the game finishes, a screen created by using the GameOverScreen type - appears. On this screen, the players can see their score and start a new - game. - - \image qtquick-demo-maroon-med-3.jpg - - The screens are all created on the same background and use some of the same - images and animations. - - \section1 Constructing the Background - - In the maroon.qml file, we use an \l{Item} type with the id \c root and a - fixed width and height to create a main window for the game: - - \skipto Item - \printuntil passedSplash - - We declare two custom properties for the root item, \c gameState and - \c passedSplash that we will use later to manage game states. - - We use an \l{Image} item to display the game background image: - - \printuntil anchors.bottom - - We want to be able to load the background image only once at app startup - and still use different scenes for the game screens. Therefore, - background.png is three times the length of the root item and displays a - scene that stretches from the bottom of sea to the sky above the horizon. - - We use the \c anchors.bottom property to anchor the background image to the - bottom of the \l{Column} layout that we use to position the screens: - - \skipto Column - \printuntil GameOverScreen - - We set a negative value for the \c y property to set the first scene at the - bottom of the sea. We calculate the position by subtracting the height of - a screen from the \c height property. - - Within the column layout, we use an \l{Item} type to add objects to the - background. Within the item, we use \l{Row} layout objects to position - \l{Image} objects that display waves on the game canvas and the game over - screen: - - \printuntil } - \printuntil } - \dots - \skipto Row - \printuntil } - \printuntil } - - The second row of waves is positioned on the y axis with a slight offset to - the first row. We also use the \c opacity property to make the waves appear - lighter in color than the first two waves, which gives the background some - depth. - - We use \l{Image} objects to also display sunlight on the new game screen and - on the game canvas: - - \skipto Image - \printuntil anchors - \dots - \skipto Image - \printuntil anchors - - We set the \c opacity property of the images to \c 0.02 and \c 0.04 to give - some depth to the rays of sunshine. We use the \c y property to position the - images at fixed locations on the y axis and the - \c {anchors.horizontalCenter} property to center them horizontally in - relation to their parent. - - We use an \l {Image} type to display an image that adds a deepening shadow - to the background: - - \skipto Image - \printuntil } - - We set the \c opacity property of the image to \c 0.5 to make the background - visible behind the shadow. - - To make the background more interesting, we animate some of the objects we - added to it. - - \section1 Animating Background Objects - - We use NumberAnimation to move the waves horizontally across the screen in - opposite directions and SequentialAnimation with NumberAnimation to move - them up and down. - - We apply the number animation to the \c x property of \c wave as a property - value source to animate the x value from its current value to the - \c -(wave.width), over 16 seconds. We set the \c loops property to - \c {Animation.Infinite} to repeat the animation indefinitely: - - \quotefromfile demos/maroon/maroon.qml - \skipto wave.width - \printuntil } - - We apply the sequential animation to the \c y property of the image as a - property value source to animate the y value. We use one number animation - to animate the image from the y position of two below the value of y to two - above it, over 1600 milliseconds. We use another number animation to - subsequently animate the image in the opposite direction, again over 1600 - milliseconds. The animation is repeated indefinitely: - - \skipto SequentialAnimation - \printuntil } - \printuntil } - \printuntil } - - We use the easing curve of the type \c {Easing.InOutQuad} for a quintic - (t^5) function to accelerate the motion until halfway and then decelerate - it. - - We use sequential animation and number animation to animate \c wave2 - similarly to \c wave, but in the opposite direction: - - \skipto SequentialAnimation - \printuntil } - \printuntil } - \printuntil } - - We use sequential animation to rotate the rays of sunlight in degrees - clockwise around an origin point that we set to \c {Item.Top} in the - \c transformOrigin property. The animation is repeated indefinitely: - - \skipto transformOrigin - \printuntil to: -10 - \printuntil } - - We use one number animation to rotate the image from \c -10 degrees to - \c 10 degrees over 8 seconds and another to subsequently rotate it from - \c 10 degrees to \c -10 degrees over the same duration. - - We use the easing curve of the type \c {Easing.InOutSine} for a sinusoidal - (sin(t)) function to accelerate the motion until halfway and then decelerate - it. - - We use sequential animation and number animation to animate another - sunlight.png image similarly, but in the opposite direction: - - \skipto transformOrigin - \printuntil to: 10 - \printuntil } - - For examples of using SequentialAnimation and NumberAnimation on the \c x - and \c y properties and the \c width and \c height properties, see - NewGameScreen.qml. - - \section1 Emitting Particles - - In addition to animation, we use particles to generate motion on the game - screens. We use the ParticleSystem QML type in maroon.qml to make bubbles - appear at the bottom of the new game screen and game canvas and slowly float - towards the top on varying trajectories. - - To use the ParticleSystem type, we must import \l{Qt Quick Particles QML Types}: - - \quotefromfile demos/maroon/maroon.qml - \skipto Particles - \printuntil 0 - - To have the particles appear on the game background, we place the - ParticleSystem type within the \l{Image} type that displays the game - background: - - \skipto Image - \printuntil anchors.fill - - In the ParticleSystem, we use an \l{Emitter} type to emit particles from the - location of the emitter at the rate of two per second with the life span of - 15 seconds: - - \skipto Emitter - \printuntil sizeVariation - \printuntil } - - The \c acceleration property uses the PointDirection type to - specify random variation of the x and y coordinates, so that the bubbles - appear inside a rectangular area around the emitter that is anchored to the - bottom of the image. - - The \c size property sets the base size of the particles at the beginning of - their life to 24 pixels and the \c sizeVariation property randomly increases - or decreases the particle size by up to 16 pixels, so that we get bubbles in - different sizes. - - As emitters have no visualization, we use the ImageParticle type to render - the catch.png image at the particle location: - - \quotefromfile demos/maroon/maroon.qml - \skipto ImageParticle - \printuntil } - - A \l{Wander} type applies a random trajectory to the particles, so that the - bubbles follow random routes from the bottom to the top. - - \printuntil } - - For another example of using the ParticleSystem type, see the - GameOverScreen.qml file, where an ImageParticle type is used to make clouds - move across the sky. - - \section1 Using Timers - - \image qtquick-demo-maroon-med-4.jpg - - In maroon.qml, we use the \l{Timer} type with a \l{Repeater} type to display - a countdown sequence before using another timer to start a new game. Both - timers are started simultaneously in the \c "gameOn" state, that is when the - players tap the New Game button and \c passedSplash is \c true. This is - explained in more detail in \l{Managing Game States}. - - We use the \c countdownTimer to display the countdown sequence: - - \skipto Timer - \printuntil } - - The \c onTriggered signal handler is called when the timer is triggered to - increment the value of the \c countdown custom property. - - We set the \c repeat property to \c true to specify that the timer is - triggered at the interval of 1 second as long as the value of \c countdown - is less than 5. - - The \c countdown property is defined in the root item with an initial value - of \c 10, so that \c countdownTimer is not running by default: - - \skipto countdown: - \printuntil 10 - - Each time the timer is triggered, an image from the countdown sequence is - displayed. We use a \l{Repeater} type to instantiate the \l{Image} delegate - in the context of the repeater's parent, \c canvasArea item, seeded with - data from the \c model: - - \quotefromfile demos/maroon/maroon.qml - \skipto Repeater - \printuntil scale - \printuntil } - \printuntil } - \printuntil } - \printuntil } - - We scale the images from \c 0.0 to \c 1.0 and use the \c visible property to - hide the images for the previous steps as the countdown progresses. We also - raise the opacity of the image that matches the current countdown step, - keeping the others nearly transparent. - - By animating the changes in the \c opacity and \c scale properties using a - \l Behavior type, we achieve a countdown sequence where numbers zoom in - towards the players. - - \section1 Constructing the Game Board - - To construct the game board, we use the GameCanvas custom type that is - defined in GameCanvas.qml. - - In maroon.qml, we use the GameCanvas type to display the game canvas - at the position of 32 on the x axis and 20 pixels from the bottom of - its parent item, \c canvasArea: - - \quotefromfile demos/maroon/maroon.qml - \skipto GameCanvas - \printuntil } - - We set the \c focus property to \c true to give \c canvas active focus on - startup. - - In GameCanvas.qml, we use an \l Item type and define custom properties for - it to create a grid of equally sized squares divided to 4 columns on 6 rows: - - \quotefromfile demos/maroon/content/GameCanvas.qml - \skipto Item - \printuntil canvas - - We use the custom properties to set the \c width and \c height of the - \c grid item as the amount of columns and rows multiplied by square size: - - \skipto width - \printuntil height - - We use an \l{Image} type with a MouseArea type to display a help button - that the players can tap to view an image that contains instructions for - playing the game: - - \skipuntil endGame - \skipto Image - \printuntil bottomMargin - \printuntil } - - We declare the \c goAway() private function to disable the mouse area and - make the image fully transparent and a \c comeBack() function to enable the - mouse area and make the button fully opaque. We use a \l {Behavior} type on - the \c opacity property to apply the default number animation when the value - of \c opacity changes. - - When the players tap the help button, the \c onClicked signal handler is - called to hide the help button by setting the \c {helpButton.visible} - property to \c false and to show the help image by setting the - \c {helpImage.visible} property to \c false. - - \image qtquick-demo-maroon-med-6.jpg - - We use anchoring to position the help button at the bottom center of the - game canvas. - - We use another \l{Image} type to display the help image: - - \printuntil } - \printuntil } - - To hide the help image when the players tap it, the \c onClicked signal - handler within the MouseArea type is called to set the \c{helpImage.visible} - property to \c true. - - To ensure that the images are placed on top when they are visible, we set - a high value for their \c z property. - - The following sections describe how to use timers to add animated objects to - the game board and how to create a menu dialog from which the players can - add more objects to it. - - \section1 Animating Objects on the Game Board - - We use sprite animation to animate objects on the game board. The Qt Quick - \l{Sprite Animations}{sprite engine} is a stochastic state machine combined - with the ability to chop up images containing multiple frames of an - animation. - - \section2 Spawning Fish - - We use a \l{Timer} element with the \c tick() function in GameCanvas.qml to - spawn mobs of fish in waves at an increasing rate, starting at 16 - milliseconds: - - \quotefromfile demos/maroon/content/GameCanvas.qml - \skipto Timer - \printuntil } - - We use the MobBase custom type that is defined in MobBase.qml to - animate mobs of fish that swim inside bubbles. We use an \l{Item} type with - custom properties and private functions to create the fish and the bubbles - and to define the actions that can be applied to them: - - \quotefromfile demos/maroon/content/mobs/MobBase.qml - \skipto Item - \printuntil } - \dots - - We use a SpriteSequence type to animate the fish: - - \skipto SpriteSequence - \printuntil goalSprite - - The SpriteSequence type renders and controls a list of animations - defined by \l{Sprite} types: - - \skipto Sprite { - \printuntil name: "right" - \printuntil } - \printuntil } - - In the \c fishSprite sprite sequence, each sprite defines one frame within - the mob-idle.png file, which shows a fish facing right, front, and left: - - \image ../../content/gfx/mob-idle.png - - We use the \c frameWidth, \c frameHeight, and \c frameX properties to - determine that the first 64x64-pixel square of the image is framed in the - \c "left" sprite, the second in the \c "front" sprite, and the third in the - \c "right" sprite. For each sprite, the \c frameCount property is set to - \c 1 to specify that the sprite contains one frame. - - We use the \c frameDuration and \c frameDurationVariation properties to - specify that the duration of an animation can vary from \c 400 to \c 1200 - milliseconds. - - The \c to property specifies that the sprites have weighted transitions to - other sprites. The \c "left" and \c "right" sprites always transfer to the - \c "front" sprite. When the \c "front" animation finishes, the sprite engine - chooses \c "left" or \c "right" randomly, but at roughly equal proportions, - because they both have the weight \c 1. - - When the fish are set free, we want them to swim away in the direction they - are facing until they get off the screen. If they were facing front, we use - the \c jumpTo method with the JavaScript \c {Math.random()} method in the - \c die() private function to randomly jump to the \c "left" or \c "right" - sprite: - - \quotefromfile demos/maroon/content/mobs/MobBase.qml - \skipto die() - \printuntil } - - We then use the \c start() function to run a NumberAnimation that applies a - number animation to the x value from its current value to \c -360 or \c 360, - depending on whether the \c goingLeft custom property is \c true, in 300 - milliseconds: - - \skipto NumberAnimation - \printuntil } - - \section2 Bursting Bubbles - - We use another SpriteSequence to animate the bubbles so that they - become smaller and finally burst when they are attacked by a shooter or - a melee. For this effect, we set the value of the \c scale property to - decrease by \c 0.2 each time the custom \c hp property changes: - - \skipto SpriteSequence - \printuntil goalSprite - - We use a \l{Behavior} type to apply a NumberAnimation when the value of - \c scale changes. We use the \c{Easing.OutBack} easing type for a back - (overshooting cubic function: (s+1)*t^3 - s*t^2) easing out curve that - decelerates the motion to zero velocity in 150 milliseconds: - - \skipto Behavior - \printuntil } - \printuntil } - - The SpriteSequence consist of two sprites that display different images. The - first sprite, \c "big", uses the catch.png image to display an empty bubble: - - \skipto Sprite - \printuntil } - \printuntil } - - We set the \c to property to \c "burst" with the weight \c 0 to make the - second sprite, \c "burst", a valid goal for the \c jumpTo method that we use - in the \c die() private function to jump directly to the \c "burst" sprite - without playing the first sprite. - - In the \c "burst" sprite, we set the \c frameCount property to \c 3 and the - \c frameX property to \c 64 to specify that the animation starts at pixel - location 64 and loads each frame for the duration of 200 milliseconds. - - \skipto Sprite - \printuntil } - - Within the SpriteSequence, we use SequentialAnimation with NumberAnimation - to animate the transitions between the frames. To create a pulsating effect - on the bubbles, we apply a sequential animation on the \c width property - with two number animations to first increase the bubble width from - \c{* 1} to \c{* 1.1} over 800 milliseconds and then bring it back over 1 - second: - - \skipto SequentialAnimation - \printuntil } - \printuntil } - \printuntil } - - Similarly, we increase the bubble height from \c{* 1} to \c{* 1.15} over - 1200 milliseconds and then bring it back over 1 second: - - \skipto SequentialAnimation - \printuntil } - \printuntil } - \printuntil } - - We use yet another SpriteSequence to display the effect of squid ink on the - bubbles. For more examples of using sprite sequences, see the QML files in - the \c towers directory. - - \section1 Adding Dialogs - - \image qtquick-demo-maroon-med-5.jpg - - In GameCanvas.qml, we use an \l{Image} type with some custom properties to - create a menu where the players can buy tower objects: - - \quotefromfile demos/maroon/content/GameCanvas.qml - \skipto Image - \printuntil towerExists - - We set the \c visible property to \c false to hide the menu by default. The - \c z property is set to 1500 to ensure that the menu is displayed in front - of all other items when it is visible. - - We use a MouseArea type to open or close the menu when players tap on the - canvas: - - \quotefromfile demos/maroon/content/GameCanvas.qml - \skipto MouseArea - \printuntil } - \printuntil } - - We set the \c anchors.fill property to \c parent to allow the players to tap - anywhere on the game canvas. We use a condition in the \c onClicked - signal handler to call the \c {finish()} function if the menu is visible - and the \c {open()} function otherwise. - - The \c {finish()} function hides the menu by setting the \c shown custom - property to \c false: - - \skipto finish - \printuntil } - - The \c {open()} function displays the menu at the x and y position of the - mouse pointer: - - \printuntil } - - If \c gameRunning is \c true, we call the JavaScript \c row() function to - calculate the value of the \c targetRow custom property and the \c col() - function to calculate the value of the \c targetCol custom property. If - the value of \c targetRow equals \c 0, the y position is set to one square - above the mouse pointer. Otherwise, it is set to one square below the mouse - pointer. - - We use the \c towerIdx() function to set the value of the \c towerExists - custom property. - - We set the \c shown custom property to \c true to show the menu and call the - \c {helpButton.goAway()} function to hide the help button when the menu - opens. - - We use states and transitions to display the menu when the \c shown - property is \c true and the \c gameOver property is \c false: - - \printuntil OutElastic - \printuntil } - - To set the visibility of the menu to \c "visible" without animating the - property change, we use a PropertyAction type. We do want to animate the - changes in opacity and scale, though, so we use number animation to - animate the value of the \c scale property from \c 0.9 to \c 1 and the - value of \c opacity property from \c 0.7 to \c 1, over 500 milliseconds. - We use the \c {Easing.outElastic} easing type for an elastic (exponentially - decaying sine wave) function easing curve that decelerates from zero - velocity. - - To construct the menu, we use a BuildButton custom type that is defined in - BuildButton.qml. In GameCanvas.qml, we create one build button for each - tower object that the players can buy and position them in a \l{Row} layout - in front of the menu background image, dialog.png: - - \printuntil dialog-factory.png - \printuntil } - \printuntil } - \printuntil } - - For each build button, we set the values of \c towerType and \c index custom - properties that we define in BuildButton.qml. - - We use the \c canBuild custom property to prevent players from adding tower - objects in locations where tower objects already exist. - - We use the \c source property to display the image for the tower type. - - The \c onClicked signal handler is called to execute the \c finish() - function that closes the menu when the players tap an enabled build button. - - Build buttons are enabled when the players have enough coins to buy the - tower objects. We use an \l {Image} type in BuildButton.qml to display - images on the buttons: - - \quotefromfile demos/maroon/content/BuildButton.qml - \skipto Image - \printuntil } - - We use the \c opacity property to make the buttons appear enabled. If - \c canBuild is \c true and the value of the \c gameCanvas.coins property - is larger than or equal to the cost of a tower object, the images are fully - opaque, otherwise their opacity is set to \c 0.4. - - We use a \l{Text} type to display the cost of each tower item, as specified - by the \c towerData variable, depending on \c towerType: - - \skipto Text - \printuntil } - - To display a pointer on the screen at the position where the tower object - will be added, we use the \l {Image} type. We use the \c visible property - to determine whether the dialog-pointer.png image should be positioned below - or above the menu. When the value of the \c col property equals the \c index - and the value or the \c row property is not \c 0, we anchor the image to the - bottom of its parent, BuildButton. - - When the value or the \c row property is \c 0, we anchor the image to the - top of BuildButton to position the pointer above the menu and use the - \c rotation property to rotate it by 180 degrees, so that it points upwards: - - \skipto Image - \printuntil } - \printuntil } - - \section1 Keeping Track of Game Statistics - - To keep track of the game statistics, we use the InfoBar custom type (that - is defined in InfoBar.qml) in maroon.qml: - - \quotefromfile demos/maroon/maroon.qml - \skipto InfoBar - \printuntil } - - We use the \c {anchors.bottom} and \c {anchors.bottomMargin} properties to - position the info bar at 6 points from the top of the game canvas. We bind - the \c width property of the info bar to that of its parent. - - In InfoBar.qml, we use an \l{Item} type to create the info bar. Within it, - we use a \l{Row} layout type to display the number of lives the players have - left, the number of fish that have been saved, and the amount of coins that - are available for use. - - We use the \c anchors property to position the rows in relationship to their - parent and to each other. In the first \l{Row} object, we use the - \c {anchors.left} and \c {anchors.leftMargin} properties to position the - heart icons at 10 points from the left border of the parent item: - - \quotefromfile demos/maroon/content/InfoBar.qml - \skipto Item - \printuntil } - \printuntil } - \printuntil } - - We use a \l{Repeater} type with a \c model and a \c delegate to display as - many hearts as the players have lives left. We use the \c spacing property - to leave 5 pixels between the displayed icons. - - In the second \l{Row} object, we use the \c {anchors.right} and - \c {anchors.rightMargin} properties to position the number of fish saved at - 20 points left of the third \l{Row} object that displays the number of coins - available (and has the id \c points): - - \skipto Row - \printuntil /^\}/ - - In these objects, we set spacing to 5 pixels to separate the icons from the - numbers that we display by using a \l{Text} type. - - In GameCanvas.qml, we define custom properties to hold the game statistics: - - \quotefromfile demos/maroon/content/GameCanvas.qml - \skipto score - \printuntil lives - - We declare the \c freshState() function to set the initial game statistics - when a new game starts: - - \skipto freshState() - \printuntil } - - We use the \c {Logic.gameState.score} variable in the \c die() function - that we declare in MobBase.qml to increase the score by one when the players - set a fish free: - - \quotefromfile demos/maroon/content/mobs/MobBase.qml - \skipto score - \printuntil ; - - \section1 Managing Game States - - In maroon.qml, we use a \l{State} type and JavaScript to switch between - screens according to the game state. The logic.js file contains definitions - for the functions. To use the functions in a QML file, we import logic.js as - the \c Logic namespace in that file: - - \quotefromfile demos/maroon/maroon.qml - \skipto logic.js - \printuntil Logic - - The base state displays the new game screen when the application starts. - In addition, we call the Component.onCompleted signal handler to initialize - a new game: - - \skipto newGameState - \printuntil ; - - In NewGameScreen.qml we use the \c onClicked signal handler to emit the - \c startButtonClicked() signal when the players tap the New Game button: - - \quotefromfile demos/maroon/content/NewGameScreen.qml - \skipto to: 150 - \skipto Image - \printuntil } - - In maroon.qml, we use the \c onStartButtonClicked signal handler to set the - \c passedSplash property of the \c root item to \c true: - - \quotefromfile demos/maroon/maroon.qml - \skipto NewGameScreen - \printuntil } - - We then use the \c passedSplash property in the \c when property of the - \c gameOn state to trigger the \c gameStarter timer: - - \skipto State { - \printuntil gameStarter - \printuntil } - - We also switch to the \c "gameOn" state and move to the y position - \c {-(height - 960)} to display the game canvas. - - In the \c gameStarter \l{Timer} object we use the \c onTriggered signal - handler to call the \c startGame() function that starts a new game: - - \quotefromfile demos/maroon/maroon.qml - \skipto property int - \skipto Timer - \printuntil } - - The game continues until \c gameState.gameOver is set to \c true and - \c gameState.gameRunning is set to \c false by calling the \c endGame() - function when the value of the \c gameState.lives property becomes less - than or equal to \c 0. - - In GameOverScreen.qml, we use a MouseArea type and an \c onClicked signal - handler within an \l{Image} type to return to the game canvas when the - players tap the New Game button: - - \quotefromfile demos/maroon/content/GameOverScreen.qml - \skipto opacity: 0.5 - \skipto Image - \printuntil } - \printuntil } - - The \c onClicked signal handler triggers a state change in maroon.qml to - display the game canvas: - - \quotefromfile demos/maroon/maroon.qml - \skipto target: gameStarter - \skipto State - \printuntil } - \printuntil } - - \section1 Playing Sound Effects - - The app can play sound effects if the \l{Qt Multimedia} module is installed. - In the SoundEffect.qml file, we proxy a SoundEffect type: - - \quotefromfile demos/maroon/content/SoundEffect.qml - \skipto Item - \printuntil } - \printuntil } - - We add the \c qtHaveModule() qmake command to the app .pro file, maroon.pro, - to check whether the \l{Qt Multimedia} module is present: - - \quotefromfile demos/maroon/maroon.pro - \skipto QT - \printuntil multimedia - - In each QML file that defines a custom type used on the game canvas, we - use a SoundEffect type to specify the audio file to play for that type - of objects. For example, in Bomb.qml, we specify the sound that a bomb - makes when it explodes: - - \quotefromfile demos/maroon/content/towers/Bomb.qml - \skipto SoundEffect - \printuntil } - - To play the sound effect when a bomb explodes, we call the \c sound.play() - function that we declare as a member of the private \c fire() function - within the TowerBase custom type: - - \quotefromfile demos/maroon/content/towers/Bomb.qml - \skipto fire() - \printuntil } - - For more examples of playing sound effects, see the QML files in the - \c towers directory and MobBase.qml. - - \section1 Adding Keyboard Shortcuts - - This is a touch example, so you should not really need to handle key - presses. However, we do not want you to have to spend more time playing the - game than you want to while testing it, so we use the \c {Keys.onPressed} - signal handler to specify keyboard shortcuts. You can press Shift+Up to - increment the values of the \c coins property to add coins, Shift+Left to - increment the value of \c lives, Shift+Down to increment the value of the - \c waveProgress property to spawn mobs of fish faster, and Shift+Right to - call the \c endGame() function to quit the game: - - \quotefromfile demos/maroon/content/GameCanvas.qml - \skipto Keys - \printuntil } - - \section1 Packaging Resources for Deployment - - To be able to run the app on mobile devices, we package all QML, JavaScript, - image, and sound files into a Qt resource file (.qrc). For more information, - see \l{The Qt Resource System}. - - \sa {QML Applications} -*/ diff --git a/examples/quick/demos/maroon/main.cpp b/examples/quick/demos/maroon/main.cpp deleted file mode 100644 index 7e69e3359e..0000000000 --- a/examples/quick/demos/maroon/main.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(demos/maroon/maroon) diff --git a/examples/quick/demos/maroon/maroon.pro b/examples/quick/demos/maroon/maroon.pro deleted file mode 100644 index ada16d047a..0000000000 --- a/examples/quick/demos/maroon/maroon.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = app - -QT += qml quick -qtHaveModule(multimedia): QT += multimedia -SOURCES += main.cpp -RESOURCES += maroon.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/maroon -INSTALLS += target diff --git a/examples/quick/demos/maroon/maroon.qml b/examples/quick/demos/maroon/maroon.qml deleted file mode 100644 index 2582fd7e74..0000000000 --- a/examples/quick/demos/maroon/maroon.qml +++ /dev/null @@ -1,235 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 -import "content" -import "content/logic.js" as Logic - -Item { - id: root - width: 320 - height: 480 - property var gameState - property bool passedSplash: false - - Image { - source:"content/gfx/background.png" - anchors.bottom: view.bottom - - ParticleSystem { - id: particles - anchors.fill: parent - - ImageParticle { - id: bubble - anchors.fill: parent - source: "content/gfx/catch.png" - opacity: 0.25 - } - - Wander { - xVariance: 25; - pace: 25; - } - - Emitter { - width: parent.width - height: 150 - anchors.bottom: parent.bottom - anchors.bottomMargin: 3 - startTime: 15000 - - emitRate: 2 - lifeSpan: 15000 - - acceleration: PointDirection{ y: -6; xVariation: 2; yVariation: 2 } - - size: 24 - sizeVariation: 16 - } - } - } - - Column { - id: view - y: -(height - 480) - width: 320 - - GameOverScreen { gameCanvas: canvas } - - Item { - id: canvasArea - width: 320 - height: 480 - - Row { - height: childrenRect.height - Image { - id: wave - y: 30 - source:"content/gfx/wave.png" - } - Image { - y: 30 - source:"content/gfx/wave.png" - } - NumberAnimation on x { from: 0; to: -(wave.width); duration: 16000; loops: Animation.Infinite } - SequentialAnimation on y { - loops: Animation.Infinite - NumberAnimation { from: y - 2; to: y + 2; duration: 1600; easing.type: Easing.InOutQuad } - NumberAnimation { from: y + 2; to: y - 2; duration: 1600; easing.type: Easing.InOutQuad } - } - } - - Row { - opacity: 0.5 - Image { - id: wave2 - y: 25 - source: "content/gfx/wave.png" - } - Image { - y: 25 - source: "content/gfx/wave.png" - } - NumberAnimation on x { from: -(wave2.width); to: 0; duration: 32000; loops: Animation.Infinite } - SequentialAnimation on y { - loops: Animation.Infinite - NumberAnimation { from: y + 2; to: y - 2; duration: 1600; easing.type: Easing.InOutQuad } - NumberAnimation { from: y - 2; to: y + 2; duration: 1600; easing.type: Easing.InOutQuad } - } - } - - Image { - source: "content/gfx/sunlight.png" - opacity: 0.02 - y: 0 - anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Top - SequentialAnimation on rotation { - loops: Animation.Infinite - NumberAnimation { from: -10; to: 10; duration: 8000; easing.type: Easing.InOutSine } - NumberAnimation { from: 10; to: -10; duration: 8000; easing.type: Easing.InOutSine } - } - } - - Image { - source: "content/gfx/sunlight.png" - opacity: 0.04 - y: 20 - anchors.horizontalCenter: parent.horizontalCenter - transformOrigin: Item.Top - SequentialAnimation on rotation { - loops: Animation.Infinite - NumberAnimation { from: 10; to: -10; duration: 8000; easing.type: Easing.InOutSine } - NumberAnimation { from: -10; to: 10; duration: 8000; easing.type: Easing.InOutSine } - } - } - - Image { - source: "content/gfx/grid.png" - opacity: 0.5 - } - - GameCanvas { - id: canvas - anchors.bottom: parent.bottom - anchors.bottomMargin: 20 - x: 32 - focus: true - } - - InfoBar { anchors.bottom: canvas.top; anchors.bottomMargin: 6; width: parent.width } - - //3..2..1..go - Timer { - id: countdownTimer - interval: 1000 - running: root.countdown < 5 - repeat: true - onTriggered: root.countdown++ - } - Repeater { - model: ["content/gfx/text-blank.png", "content/gfx/text-3.png", "content/gfx/text-2.png", "content/gfx/text-1.png", "content/gfx/text-go.png"] - delegate: Image { - visible: root.countdown <= index - opacity: root.countdown == index ? 0.5 : 0.1 - scale: root.countdown >= index ? 1.0 : 0.0 - source: modelData - Behavior on opacity { NumberAnimation {} } - Behavior on scale { NumberAnimation {} } - } - } - } - - NewGameScreen { - onStartButtonClicked: root.passedSplash = true - } - } - - property int countdown: 10 - Timer { - id: gameStarter - interval: 4000 - running: false - repeat: false - onTriggered: Logic.startGame(canvas); - } - - states: [ - State { - name: "gameOn"; when: gameState.gameOver == false && passedSplash - PropertyChanges { target: view; y: -(height - 960) } - StateChangeScript { script: root.countdown = 0; } - PropertyChanges { target: gameStarter; running: true } - }, - State { - name: "gameOver"; when: gameState.gameOver == true - PropertyChanges { target: view; y: 0 } - } - ] - - transitions: Transition { - NumberAnimation { properties: "x,y"; duration: 1200; easing.type: Easing.OutQuad } - } - - Component.onCompleted: gameState = Logic.newGameState(canvas); -} diff --git a/examples/quick/demos/maroon/maroon.qmlproject b/examples/quick/demos/maroon/maroon.qmlproject deleted file mode 100644 index 752666114f..0000000000 --- a/examples/quick/demos/maroon/maroon.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "maroon.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/demos/maroon/maroon.qrc b/examples/quick/demos/maroon/maroon.qrc deleted file mode 100644 index 52c2a4e513..0000000000 --- a/examples/quick/demos/maroon/maroon.qrc +++ /dev/null @@ -1,71 +0,0 @@ -<RCC> - <qresource prefix="/demos/maroon"> - <file>maroon.qml</file> - <file>content/BuildButton.qml</file> - <file>content/GameCanvas.qml</file> - <file>content/GameOverScreen.qml</file> - <file>content/InfoBar.qml</file> - <file>content/logic.js</file> - <file>content/NewGameScreen.qml</file> - <file>content/SoundEffect.qml</file> - <file>content/audio/bomb-action.wav</file> - <file>content/audio/catch-action.wav</file> - <file>content/audio/catch.wav</file> - <file>content/audio/currency.wav</file> - <file>content/audio/factory-action.wav</file> - <file>content/audio/melee-action.wav</file> - <file>content/audio/projectile-action.wav</file> - <file>content/audio/shooter-action.wav</file> - <file>content/gfx/background.png</file> - <file>content/gfx/bomb-action.png</file> - <file>content/gfx/bomb-idle.png</file> - <file>content/gfx/bomb.png</file> - <file>content/gfx/button-help.png</file> - <file>content/gfx/button-play.png</file> - <file>content/gfx/catch-action.png</file> - <file>content/gfx/catch.png</file> - <file>content/gfx/cloud.png</file> - <file>content/gfx/currency.png</file> - <file>content/gfx/dialog-bomb.png</file> - <file>content/gfx/dialog-factory.png</file> - <file>content/gfx/dialog-melee.png</file> - <file>content/gfx/dialog-pointer.png</file> - <file>content/gfx/dialog-shooter.png</file> - <file>content/gfx/dialog.png</file> - <file>content/gfx/factory-action.png</file> - <file>content/gfx/factory-idle.png</file> - <file>content/gfx/factory.png</file> - <file>content/gfx/grid.png</file> - <file>content/gfx/help.png</file> - <file>content/gfx/lifes.png</file> - <file>content/gfx/logo-bubble.png</file> - <file>content/gfx/logo-fish.png</file> - <file>content/gfx/logo.png</file> - <file>content/gfx/melee-action.png</file> - <file>content/gfx/melee-idle.png</file> - <file>content/gfx/melee.png</file> - <file>content/gfx/mob-idle.png</file> - <file>content/gfx/mob.png</file> - <file>content/gfx/points.png</file> - <file>content/gfx/projectile-action.png</file> - <file>content/gfx/projectile.png</file> - <file>content/gfx/scores.png</file> - <file>content/gfx/shooter-action.png</file> - <file>content/gfx/shooter-idle.png</file> - <file>content/gfx/shooter.png</file> - <file>content/gfx/sunlight.png</file> - <file>content/gfx/text-1.png</file> - <file>content/gfx/text-2.png</file> - <file>content/gfx/text-3.png</file> - <file>content/gfx/text-blank.png</file> - <file>content/gfx/text-gameover.png</file> - <file>content/gfx/text-go.png</file> - <file>content/gfx/wave.png</file> - <file>content/mobs/MobBase.qml</file> - <file>content/towers/Bomb.qml</file> - <file>content/towers/Factory.qml</file> - <file>content/towers/Melee.qml</file> - <file>content/towers/Ranged.qml</file> - <file>content/towers/TowerBase.qml</file> - </qresource> -</RCC> diff --git a/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png b/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png Binary files differdeleted file mode 100644 index a0cd823999..0000000000 --- a/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png +++ /dev/null diff --git a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc b/examples/quick/demos/photosurface/doc/src/photosurface.qdoc deleted file mode 100644 index a032d730eb..0000000000 --- a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Qt Quick Demo - Photo Surface - \ingroup qtquickdemos - \example demos/photosurface - \brief A QML app for touch devices that uses a Repeater with a - FolderListModel to access content in a folder, and a PinchArea that contains - a MouseArea to handle pinch gestures on the fetched content. - \image qtquick-demo-photosurface-small.png - - \e{Photo Surface} demonstrates how to use a \l{Repeater} with a - FolderListModel and a FileDialog to access images from a folder selected - by a user and how to handle dragging, rotation and pinch zooming within the - same item using a \l PinchArea that contains a \l MouseArea. - - All the app code is contained in one QML file, photosurface.qml. Inline - JavaScript code is used to place, rotate, and scale images on the photo - surface. - - \include examples-run.qdocinc - - \section1 Creating the Main Window - - To create the main window for the Photo Surface app, we use the \l{Window} - QML type as the root item. It automatically sets up the window for use with - \l{Qt Quick} graphical types: - - \quotefromfile demos/photosurface/photosurface.qml - \skipto Window { - \printuntil currentFrame - - To use the \l{Window} type, we must import it: - - \code - import QtQuick.Window 2.1 - \endcode - - \section1 Accessing Folder Contents - - We use a \l{Repeater} QML type together with the FolderListModel to display - GIF, JPG, and PNG images located in a folder: - - \quotefromfile demos/photosurface/photosurface.qml - \skipto Repeater - \printuntil } - - To use the FolderListModel type, we must import it: - - \code - import Qt.labs.folderlistmodel 1.0 - \endcode - - We use a FileDialog to enable users to select the folder that contains - the images: - - \quotefromfile demos/photosurface/photosurface.qml - \skipto FileDialog - \printuntil } - - To use the FileDialog type, we must import \l{Qt Quick Dialogs}: - - \code - import QtQuick.Dialogs 1.0 - \endcode - - We use the \c {fileDialog.open()} function to open the file dialog when the - app starts: - - \code - Component.onCompleted: fileDialog.open() - \endcode - - Users can also click the file dialog icon to open the file dialog. We use - an \l{Image} QML type to display the icon. Inside the \l{Image} type, we - use a MouseArea with the \c onClicked signal handler to call the - \c {fileDialog.open()} function: - - \quotefromfile demos/photosurface/photosurface.qml - \skipuntil Image { - \skipto Image { - \printuntil } - \printuntil } - - \section1 Displaying Images on the Photo Surface - - We use a \l{Rectangle} as a delegate for a \l{Repeater} to provide a frame - for each image that the FolderListModel finds in the selected folder. We use - JavaScript \c Math() methods to place the frames randomly on the photo - surface and to rotate them at random angles, as well as to scale the images: - - \quotefromfile demos/photosurface/photosurface.qml - \skipto Rectangle - \printuntil Component.onCompleted - \printuntil } - - \section1 Handling Pinch Gestures - - We use a PinchArea that contains a MouseArea in the photo frames to handle - dragging, rotation and pinch zooming of the frame: - - \skipto PinchArea - \printuntil onPinchStarted - - We use the \c pinch group property to control how the photo frames react to - pinch gestures. The \c pinch.target sets \c photoFrame as the item to - manipulate. The rotation properties specify that the frames can be rotated - at all angles and the scale properties specify that they can be scaled - between \c 0.1 and \c 10. - - In the MouseArea's \c onPressed signal handler, we raise the selected photo - frame to the top by increasing the value of its \c z property. The root item - stores the z value of the top-most frame. The border color of the photo - frame is controlled in the \c onEntered signal handler to highlight the - selected image: - - \skipto MouseArea - \printuntil onEntered - - To enable you to test the example on the desktop, we use the MouseArea's - \c onWheel signal handler to simulate pinch gestures by using a mouse: - - \printuntil photoFrame.scale - \printuntil } - \printuntil } - - The \c onWheel signal handler is called in response to mouse wheel gestures. - Use the vertical wheel to zoom and Ctrl and the vertical wheel to rotate - frames. If the mouse has a horizontal wheel, use it to rotate frames. - - \sa {QML Applications} -*/ diff --git a/examples/quick/demos/photosurface/main.cpp b/examples/quick/demos/photosurface/main.cpp deleted file mode 100644 index b9d093df40..0000000000 --- a/examples/quick/demos/photosurface/main.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifdef QT_WIDGETS_LIB -#include <QtWidgets/QApplication> -#else -#include <QtGui/QGuiApplication> -#endif -#include <QtQml/QQmlApplicationEngine> -#include <QtQml/QQmlContext> -#include <QtQuick/QQuickWindow> -#include <QtGui/QImageReader> -#include <QtCore/QCommandLineParser> -#include <QtCore/QCommandLineOption> -#include <QtCore/QDebug> -#include <QtCore/QDir> -#include <QtCore/QMimeDatabase> -#include <QtCore/QStandardPaths> -#include <QtCore/QUrl> - -static QStringList imageNameFilters() -{ - QStringList result; - QMimeDatabase mimeDatabase; - const auto supportedMimeTypes = QImageReader::supportedMimeTypes(); - for (const QByteArray &m : supportedMimeTypes) { - const auto suffixes = mimeDatabase.mimeTypeForName(m).suffixes(); - for (const QString &suffix : suffixes) - result.append(QLatin1String("*.") + suffix); - } - return result; -} - -int main(int argc, char* argv[]) -{ - // The reason to use QApplication is that QWidget-based dialogs - // are the native dialogs on Qt-based platforms like KDE, - // but they cannot be instantiated if this is a QGuiApplication. -#ifdef QT_WIDGETS_LIB - QApplication app(argc, argv); -#else - QGuiApplication app(argc, argv); -#endif - QQuickWindow::setDefaultAlphaBuffer(true); - - QCoreApplication::setApplicationName(QStringLiteral("Photosurface")); - QCoreApplication::setOrganizationName(QStringLiteral("QtProject")); - QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - QCommandLineParser parser; - parser.setApplicationDescription(QStringLiteral("Qt Quick Demo - Photo Surface")); - parser.addHelpOption(); - parser.addVersionOption(); - parser.addPositionalArgument(QStringLiteral("directory"), - QStringLiteral("The image directory or URL to show.")); - parser.process(app); - - QUrl initialUrl; - if (!parser.positionalArguments().isEmpty()) { - initialUrl = QUrl::fromUserInput(parser.positionalArguments().first(), - QDir::currentPath(), QUrl::AssumeLocalFile); - if (!initialUrl.isValid()) { - qWarning().nospace() << "Invalid argument: \"" - << parser.positionalArguments().first() << "\": " << initialUrl.errorString(); - return 1; - } - } - - const QStringList nameFilters = imageNameFilters(); - - QQmlApplicationEngine engine; - QQmlContext *context = engine.rootContext(); - - QUrl picturesLocationUrl = QUrl::fromLocalFile(QDir::homePath()); - const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); - if (!picturesLocations.isEmpty()) { - picturesLocationUrl = QUrl::fromLocalFile(picturesLocations.first()); - if (initialUrl.isEmpty() - && !QDir(picturesLocations.first()).entryInfoList(nameFilters, QDir::Files).isEmpty()) { - initialUrl = picturesLocationUrl; - } - } - - context->setContextProperty(QStringLiteral("contextPicturesLocation"), picturesLocationUrl); - context->setContextProperty(QStringLiteral("contextInitialUrl"), initialUrl); - context->setContextProperty(QStringLiteral("contextImageNameFilters"), nameFilters); - - engine.load(QUrl("qrc:///photosurface.qml")); - if (engine.rootObjects().isEmpty()) - return -1; - - return app.exec(); -} diff --git a/examples/quick/demos/photosurface/photosurface.pro b/examples/quick/demos/photosurface/photosurface.pro deleted file mode 100644 index 5e5b0f0815..0000000000 --- a/examples/quick/demos/photosurface/photosurface.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE = app - -QT += qml quick -qtHaveModule(widgets): QT += widgets -SOURCES += main.cpp -RESOURCES += photosurface.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/photosurface -INSTALLS += target -ICON = resources/icon.png -macx: ICON = resources/photosurface.icns -win32: RC_FILE = resources/photosurface.rc - diff --git a/examples/quick/demos/photosurface/photosurface.qml b/examples/quick/demos/photosurface/photosurface.qml deleted file mode 100644 index d8a424e8f8..0000000000 --- a/examples/quick/demos/photosurface/photosurface.qml +++ /dev/null @@ -1,276 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Dialogs 1.0 -import QtQuick.Window 2.1 -import Qt.labs.folderlistmodel 1.0 - -Window { - id: root - visible: true - width: 1024; height: 600 - color: "black" - property int highestZ: 0 - property real defaultSize: 200 - property var currentFrame: undefined - property real surfaceViewportRatio: 1.5 - - FileDialog { - id: fileDialog - title: "Choose a folder with some images" - selectFolder: true - folder: picturesLocation - onAccepted: folderModel.folder = fileUrl + "/" - } - - Flickable { - id: flick - anchors.fill: parent - contentWidth: width * surfaceViewportRatio - contentHeight: height * surfaceViewportRatio - Repeater { - model: FolderListModel { - id: folderModel - objectName: "folderModel" - showDirs: false - nameFilters: imageNameFilters - } - Rectangle { - id: photoFrame - width: image.width * (1 + 0.10 * image.height / image.width) - height: image.height * 1.10 - scale: defaultSize / Math.max(image.sourceSize.width, image.sourceSize.height) - Behavior on scale { NumberAnimation { duration: 200 } } - Behavior on x { NumberAnimation { duration: 200 } } - Behavior on y { NumberAnimation { duration: 200 } } - border.color: "black" - border.width: 2 - smooth: true - antialiasing: true - Component.onCompleted: { - x = Math.random() * root.width - width / 2 - y = Math.random() * root.height - height / 2 - rotation = Math.random() * 13 - 6 - } - Image { - id: image - anchors.centerIn: parent - fillMode: Image.PreserveAspectFit - source: folderModel.folder + fileName - antialiasing: true - } - PinchArea { - anchors.fill: parent - pinch.target: photoFrame - pinch.minimumRotation: -360 - pinch.maximumRotation: 360 - pinch.minimumScale: 0.1 - pinch.maximumScale: 10 - pinch.dragAxis: Pinch.XAndYAxis - onPinchStarted: setFrameColor(); - property real zRestore: 0 - onSmartZoom: { - if (pinch.scale > 0) { - photoFrame.rotation = 0; - photoFrame.scale = Math.min(root.width, root.height) / Math.max(image.sourceSize.width, image.sourceSize.height) * 0.85 - photoFrame.x = flick.contentX + (flick.width - photoFrame.width) / 2 - photoFrame.y = flick.contentY + (flick.height - photoFrame.height) / 2 - zRestore = photoFrame.z - photoFrame.z = ++root.highestZ; - } else { - photoFrame.rotation = pinch.previousAngle - photoFrame.scale = pinch.previousScale - photoFrame.x = pinch.previousCenter.x - photoFrame.width / 2 - photoFrame.y = pinch.previousCenter.y - photoFrame.height / 2 - photoFrame.z = zRestore - --root.highestZ - } - } - - MouseArea { - id: dragArea - hoverEnabled: true - anchors.fill: parent - drag.target: photoFrame - scrollGestureEnabled: false // 2-finger-flick gesture should pass through to the Flickable - onPressed: { - photoFrame.z = ++root.highestZ; - parent.setFrameColor(); - } - onEntered: parent.setFrameColor(); - onWheel: { - if (wheel.modifiers & Qt.ControlModifier) { - photoFrame.rotation += wheel.angleDelta.y / 120 * 5; - if (Math.abs(photoFrame.rotation) < 4) - photoFrame.rotation = 0; - } else { - photoFrame.rotation += wheel.angleDelta.x / 120; - if (Math.abs(photoFrame.rotation) < 0.6) - photoFrame.rotation = 0; - var scaleBefore = photoFrame.scale; - photoFrame.scale += photoFrame.scale * wheel.angleDelta.y / 120 / 10; - } - } - } - function setFrameColor() { - if (currentFrame) - currentFrame.border.color = "black"; - currentFrame = photoFrame; - currentFrame.border.color = "red"; - } - } - } - } - } - - Rectangle { - id: verticalScrollDecorator - anchors.right: parent.right - anchors.margins: 2 - color: "cyan" - border.color: "black" - border.width: 1 - width: 5 - radius: 2 - antialiasing: true - height: flick.height * (flick.height / flick.contentHeight) - (width - anchors.margins) * 2 - y: flick.contentY * (flick.height / flick.contentHeight) - NumberAnimation on opacity { id: vfade; to: 0; duration: 500 } - onYChanged: { opacity = 1.0; scrollFadeTimer.restart() } - } - - Rectangle { - id: horizontalScrollDecorator - anchors.bottom: parent.bottom - anchors.margins: 2 - color: "cyan" - border.color: "black" - border.width: 1 - height: 5 - radius: 2 - antialiasing: true - width: flick.width * (flick.width / flick.contentWidth) - (height - anchors.margins) * 2 - x: flick.contentX * (flick.width / flick.contentWidth) - NumberAnimation on opacity { id: hfade; to: 0; duration: 500 } - onXChanged: { opacity = 1.0; scrollFadeTimer.restart() } - } - - Timer { id: scrollFadeTimer; interval: 1000; onTriggered: { hfade.start(); vfade.start() } } - - Image { - anchors.top: parent.top - anchors.left: parent.left - anchors.margins: 10 - source: "resources/folder.png" - MouseArea { - anchors.fill: parent - anchors.margins: -10 - onClicked: fileDialog.open() - hoverEnabled: true - onPositionChanged: { - tooltip.visible = false - hoverTimer.start() - } - onExited: { - tooltip.visible = false - hoverTimer.stop() - } - Timer { - id: hoverTimer - interval: 1000 - onTriggered: { - tooltip.x = parent.mouseX - tooltip.y = parent.mouseY - tooltip.visible = true - } - } - Rectangle { - id: tooltip - border.color: "black" - color: "beige" - width: tooltipText.implicitWidth + 8 - height: tooltipText.implicitHeight + 8 - visible: false - Text { - id: tooltipText - anchors.centerIn: parent - text: "Open an image directory (" + openShortcut.sequenceString + ")" - } - } - } - Shortcut { - id: openShortcut - sequence: StandardKey.Open - onActivated: fileDialog.open() - } - } - - Text { - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 10 - color: "darkgrey" - wrapMode: Text.WordWrap - font.pointSize: 8 - text: "On a touchscreen: use two fingers to zoom and rotate, one finger to drag\n" + - "With a mouse: drag normally, use the vertical wheel to zoom, horizontal wheel to rotate, or hold Ctrl while using the vertical wheel to rotate" - } - - Shortcut { sequence: StandardKey.Quit; onActivated: Qt.quit() } - - Component.onCompleted: { - if (typeof contextInitialUrl !== 'undefined') { - // Launched from C++ with context properties set. - imageNameFilters = contextImageNameFilters; - picturesLocation = contextPicturesLocation; - if (contextInitialUrl == "") - fileDialog.open(); - else - folderModel.folder = contextInitialUrl + "/"; - } else { - // Launched via QML viewer without context properties set. - fileDialog.open(); - } - } - - property var imageNameFilters : ["*.png", "*.jpg", "*.gif"]; - property string picturesLocation : ""; -} diff --git a/examples/quick/demos/photosurface/photosurface.qmlproject b/examples/quick/demos/photosurface/photosurface.qmlproject deleted file mode 100644 index ae2065f59c..0000000000 --- a/examples/quick/demos/photosurface/photosurface.qmlproject +++ /dev/null @@ -1,20 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "photosurface.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - Files { - filter: "*.ts" - directory: "i18n" - } -} diff --git a/examples/quick/demos/photosurface/photosurface.qrc b/examples/quick/demos/photosurface/photosurface.qrc deleted file mode 100644 index f8fafbb1ff..0000000000 --- a/examples/quick/demos/photosurface/photosurface.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>photosurface.qml</file> - <file>resources/folder.png</file> - </qresource> -</RCC> diff --git a/examples/quick/demos/photosurface/resources/folder.png b/examples/quick/demos/photosurface/resources/folder.png Binary files differdeleted file mode 100644 index 2aec3b6ebf..0000000000 --- a/examples/quick/demos/photosurface/resources/folder.png +++ /dev/null diff --git a/examples/quick/demos/photosurface/resources/icon.png b/examples/quick/demos/photosurface/resources/icon.png Binary files differdeleted file mode 100644 index f8ff553fcb..0000000000 --- a/examples/quick/demos/photosurface/resources/icon.png +++ /dev/null diff --git a/examples/quick/demos/photosurface/resources/photosurface.icns b/examples/quick/demos/photosurface/resources/photosurface.icns Binary files differdeleted file mode 100644 index c69ec41c4e..0000000000 --- a/examples/quick/demos/photosurface/resources/photosurface.icns +++ /dev/null diff --git a/examples/quick/demos/photosurface/resources/photosurface.ico b/examples/quick/demos/photosurface/resources/photosurface.ico Binary files differdeleted file mode 100644 index 03bb7ee367..0000000000 --- a/examples/quick/demos/photosurface/resources/photosurface.ico +++ /dev/null diff --git a/examples/quick/demos/photosurface/resources/photosurface.rc b/examples/quick/demos/photosurface/resources/photosurface.rc deleted file mode 100644 index 3267bd033f..0000000000 --- a/examples/quick/demos/photosurface/resources/photosurface.rc +++ /dev/null @@ -1,32 +0,0 @@ -#include "winver.h" - -IDI_ICON1 ICON DISCARDABLE "photosurface.ico" - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,0 - PRODUCTVERSION 1,0,0,0 - FILEFLAGS 0x0L - FILEFLAGSMASK 0x3fL - FILEOS 0x00040004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "CompanyName", "The Qt Company Ltd" - VALUE "FileDescription", "Photo Surface Demo" - VALUE "FileVersion", "1.0.0.0" - VALUE "LegalCopyright", "Copyright (C) 2015 The Qt Company Ltd." - VALUE "InternalName", "photosurface" - VALUE "OriginalFilename", "photosurface.exe" - VALUE "ProductName", "Photo Surface Demo" - VALUE "ProductVersion", "1.0.0.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml deleted file mode 100644 index ea72302d74..0000000000 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.XmlListModel 2.0 -import QtQml.Models 2.1 - -Component { - id: albumDelegate - Package { - - Item { - Package.name: 'browser' - GridView { - id: photosGridView; model: visualModel.parts.grid; width: mainWindow.width; height: mainWindow.height - 21 - x: 0; y: 21; cellWidth: 160; cellHeight: 153; interactive: false - onCurrentIndexChanged: photosListView.positionViewAtIndex(currentIndex, ListView.Contain) - } - } - - Item { - Package.name: 'fullscreen' - ListView { - id: photosListView; model: visualModel.parts.list; orientation: Qt.Horizontal - width: mainWindow.width; height: mainWindow.height; interactive: false - onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain) - highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem - } - } - - Item { - Package.name: 'album' - id: albumWrapper; width: 210; height: 220 - - DelegateModel { - id: visualModel; delegate: PhotoDelegate { } - model: RssModel { id: rssModel; tags: tag } - } - - BusyIndicator { - id: busyIndicator - anchors { centerIn: parent; verticalCenterOffset: -20 } - on: rssModel.status != XmlListModel.Ready - } - - PathView { - id: photosPathView; model: visualModel.parts.stack; pathItemCount: 5 - visible: !busyIndicator.visible - anchors.centerIn: parent; anchors.verticalCenterOffset: -30 - path: Path { - PathAttribute { name: 'z'; value: 9999.0 } - PathLine { x: 1; y: 1 } - PathAttribute { name: 'z'; value: 0.0 } - } - } - - MouseArea { - anchors.fill: parent - onClicked: mainWindow.editMode ? photosModel.remove(index) : albumWrapper.state = 'inGrid' - } - - Tag { - anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 } - frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode - onTagChanged: rssModel.tags = tag - onBackClicked: if (mainWindow.editMode) photosModel.remove(index); - } - - states: [ - State { - name: 'inGrid' - PropertyChanges { target: photosGridView; interactive: true } - PropertyChanges { target: albumsShade; opacity: 1 } - PropertyChanges { target: backButton; onClicked: albumWrapper.state = ''; y: 6 } - }, - State { - name: 'fullscreen'; extend: 'inGrid' - PropertyChanges { target: photosGridView; interactive: false } - PropertyChanges { target: photosListView; interactive: true } - PropertyChanges { target: photosShade; opacity: 1 } - PropertyChanges { target: backButton; y: -backButton.height - 8 } - } - ] - - GridView.onAdd: NumberAnimation { - target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad - } - GridView.onRemove: SequentialAnimation { - PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true } - NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad } - PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false } - } - - transitions: [ - Transition { - from: '*'; to: 'inGrid' - SequentialAnimation { - NumberAnimation { properties: 'opacity'; duration: 250 } - PauseAnimation { duration: 350 } - NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad } - } - }, - Transition { - from: 'inGrid'; to: '*' - NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 } - } - ] - } - } -} diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml deleted file mode 100644 index 2dcfc6158e..0000000000 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml +++ /dev/null @@ -1,198 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "script/script.js" as Script - -Package { - Item { id: stackItem; Package.name: 'stack'; width: 160; height: 153; z: stackItem.PathView.z } - Item { id: listItem; Package.name: 'list'; width: mainWindow.width + 40; height: 153 } - Item { id: gridItem; Package.name: 'grid'; width: 160; height: 153 } - - Item { - width: 160; height: 153 - - Item { - id: photoWrapper - - property double randomAngle: Math.random() * (2 * 6 + 1) - 6 - property double randomAngle2: Math.random() * (2 * 6 + 1) - 6 - - x: 0; y: 0; width: 140; height: 133 - z: stackItem.PathView.z; rotation: photoWrapper.randomAngle - - BorderImage { - anchors { - fill: originalImage.status == Image.Ready ? border : placeHolder - leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 - } - source: 'images/box-shadow.png' - border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 - } - Rectangle { - id: placeHolder - - property int w: Script.getWidth(content) - property int h: Script.getHeight(content) - property double s: Script.calculateScale(w, h, photoWrapper.width) - - color: 'white'; anchors.centerIn: parent; antialiasing: true - width: w * s; height: h * s; visible: originalImage.status != Image.Ready - Rectangle { - color: "#878787"; antialiasing: true - anchors { fill: parent; topMargin: 3; bottomMargin: 3; leftMargin: 3; rightMargin: 3 } - } - } - Rectangle { - id: border; color: 'white'; anchors.centerIn: parent; antialiasing: true - width: originalImage.paintedWidth + 6; height: originalImage.paintedHeight + 6 - visible: !placeHolder.visible - } - BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready } - Image { - id: originalImage; antialiasing: true; - source: "http://" + Script.getImagePath(content); cache: false - fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height - } - Image { - id: hqImage; antialiasing: true; source: ""; visible: false; cache: false - fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height - } - Binding { - target: mainWindow; property: "downloadProgress"; value: hqImage.progress - when: listItem.ListView.isCurrentItem - } - Binding { - target: mainWindow; property: "imageLoading" - value: (hqImage.status == Image.Loading) ? 1 : 0; when: listItem.ListView.isCurrentItem - } - MouseArea { - width: originalImage.paintedWidth; height: originalImage.paintedHeight; anchors.centerIn: originalImage - onClicked: { - if (albumWrapper.state == 'inGrid') { - gridItem.GridView.view.currentIndex = index; - albumWrapper.state = 'fullscreen' - } else { - gridItem.GridView.view.currentIndex = index; - albumWrapper.state = 'inGrid' - } - } - } - - states: [ - State { - name: 'stacked'; when: albumWrapper.state == '' - ParentChange { target: photoWrapper; parent: stackItem; x: 10; y: 10 } - PropertyChanges { target: photoWrapper; opacity: stackItem.PathView.onPath ? 1.0 : 0.0 } - }, - State { - name: 'inGrid'; when: albumWrapper.state == 'inGrid' - ParentChange { target: photoWrapper; parent: gridItem; x: 10; y: 10; rotation: photoWrapper.randomAngle2 } - }, - State { - name: 'fullscreen'; when: albumWrapper.state == 'fullscreen' - ParentChange { - target: photoWrapper; parent: listItem; x: 0; y: 0; rotation: 0 - width: mainWindow.width; height: mainWindow.height - } - PropertyChanges { target: border; opacity: 0 } - PropertyChanges { target: hqImage; source: listItem.ListView.isCurrentItem ? hq : ""; visible: true } - } - ] - - transitions: [ - Transition { - from: 'stacked'; to: 'inGrid' - SequentialAnimation { - PauseAnimation { duration: 10 * index } - ParentAnimation { - target: photoWrapper; via: foreground - NumberAnimation { - target: photoWrapper; properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' - } - } - } - }, - Transition { - from: 'inGrid'; to: 'stacked' - ParentAnimation { - target: photoWrapper; via: foreground - NumberAnimation { properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' } - } - }, - Transition { - from: 'inGrid'; to: 'fullscreen' - SequentialAnimation { - PauseAnimation { duration: gridItem.GridView.isCurrentItem ? 0 : 600 } - ParentAnimation { - target: photoWrapper; via: foreground - NumberAnimation { - targets: [ photoWrapper, border ] - properties: 'x,y,width,height,opacity,rotation' - duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart' - } - } - } - }, - Transition { - from: 'fullscreen'; to: 'inGrid' - ParentAnimation { - target: photoWrapper; via: foreground - NumberAnimation { - targets: [ photoWrapper, border ] - properties: 'x,y,width,height,rotation,opacity' - duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart' - } - } - } - ] - } - } -} diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/images/box-shadow.png b/examples/quick/demos/photoviewer/PhotoViewerCore/images/box-shadow.png Binary files differdeleted file mode 100644 index 23c011d0ff..0000000000 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/images/box-shadow.png +++ /dev/null diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/images/busy.png b/examples/quick/demos/photoviewer/PhotoViewerCore/images/busy.png Binary files differdeleted file mode 100644 index fc65122d26..0000000000 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/images/busy.png +++ /dev/null diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/images/cardboard.png b/examples/quick/demos/photoviewer/PhotoViewerCore/images/cardboard.png Binary files differdeleted file mode 100644 index a8a9c6079d..0000000000 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/images/cardboard.png +++ /dev/null diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/script/script.js b/examples/quick/demos/photoviewer/PhotoViewerCore/script/script.js deleted file mode 100644 index e8ef93a847..0000000000 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/script/script.js +++ /dev/null @@ -1,27 +0,0 @@ -.pragma library - -function getWidth(string) { - return (string.match(/width=\"([0-9]+)\"/))[1] -} - -function getHeight(string) { - return (string.match(/height=\"([0-9]+)\"/))[1] -} - -function getImagePath(string) { - var pattern = /src=\"http:\/\/(\S+)\"/ - return (string.match(pattern))[1] -} - -function calculateScale(width, height, cellSize) { - var widthScale = (cellSize * 1.0) / width - var heightScale = (cellSize * 1.0) / height - var scale = 0 - - if (widthScale <= heightScale) { - scale = widthScale; - } else if (heightScale < widthScale) { - scale = heightScale; - } - return scale; -} diff --git a/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png b/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png Binary files differdeleted file mode 100644 index d872310a3e..0000000000 --- a/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png +++ /dev/null diff --git a/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc b/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc deleted file mode 100644 index 9c0f8b337e..0000000000 --- a/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc +++ /dev/null @@ -1,326 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Qt Quick Demo - Photo Viewer - \ingroup qtquickdemos - \example demos/photoviewer - \brief A QML photo viewer that that uses XmlListModel and XmlRole to - download Flickr feeds, and Package to display the photos in different views. - - \image qtquick-demo-photoviewer-small.png - - \e{Photo Viewer} demonstrates the following \l{Qt Quick} features: - - \list - \li Using custom types to create screens and screen controls. - \li Using Qt Quick Controls to create an application window. - \li Using the \l Package type with a \l DelegateModel to provide - delegates with a shared context to multiple views. - \li Using XML list models to download Flickr feeds. - \li Using the \l Flipable type to create labels with different text on - the front and back. - \li Using the PathView, \l Path, PathAttribute, and PathLine types to - lay out photos on a path. - \li Providing feedback to users while data is loading. - \li Localizing applications. - \endlist - - \include examples-run.qdocinc - - \section1 Using Custom Types - - In the Photo Viewer app, we use the following custom types that are each - defined in a separate .qml file: - - \list - \li \c AlbumDelegate.qml - \li \c BusyIndicator.qml - \li \c Button.qml - \li \c EditableButton.qml - \li \c PhotoDelegate.qml - \li \c ProgressBar.qml - \li \c RssModel.qml - \li \c Tag.qml - \endlist - - To use the custom types, we add an import statement to the main QML file, - main.qml, that imports the folder called \c PhotoViewerCore where the types - are located: - - \quotefromfile demos/photoviewer/main.qml - \skipto PhotoViewerCore - \printuntil " - - \section1 Creating the Main Window - - In main.qml, we use the ApplicationWindow Qt Quick Control to create the app - main window: - - \printuntil visible - - We use a ListModel type with \l ListElement types to display photo albums: - - \skipto ListModel - \printuntil Prague - \printuntil } - - List elements are defined like other QML types except that they contain a - collection of \e role definitions instead of properties. Roles both define - how the data is accessed and include the data itself. For each list element, - we use the \c tag role to specify the photos to download. - - A DelegateModel type is used together with the \l Package type to provide - delegates to multiple views. The \c model property holds the model providing - data for the delegate model and the \c delegate property specifies the - template defining each item instantiated by a view: - - \printuntil DelegateModel - - We use a GridView type to lay out the albums as a grid: - - \printuntil } - - The \c model property references the package name \c album that we specify - in AlbumDelegate.qml. We use the \l Package type to allow the photos to move - between different views. The \l Package contains the named items \c browser, - \c fullscreen, and \c album: - - \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml - \skipto Package - \printuntil albumWrapper - - The named items are used as the delegates by the views that reference the - special DelegateModel::parts property to select the model that provides - the chosen delegate. - - We use a ListView type to lay out albums in other views: - - \quotefromfile demos/photoviewer/main.qml - \skipto ListView - \printuntil } - \skipto ListView - \printuntil } - - \section1 Displaying Photos - - We use the PhotoDelegate custom type that is specified in PhotoDelegate.qml - to display photos. We use a \l Package type to lay out the photos either in - a stack, list, or a grid: - - \quotefromfile demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml - \skipto Package - \printuntil gridItem - - The photos are rotated at random angles by using the \c Math.random() - JavaScript method: - - \printuntil stackItem - - We use a BorderImage type to create borders for the images: - - \printuntil border.left - \printuntil } - - \section1 Downloading Flickr Feeds - - In AlbumDelegate.qml, we use the DelegateModel to provide the - PhotoDelegate delegate to the RssModel model: - - \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml - \skipto DelegateModel - \printuntil RssModel - \printuntil } - - In RssModel.qml, we use an XmlListModel type as a data source for - \l Package objects to download photos from the selected feeds: - - \quotefromfile demos/photoviewer/PhotoViewerCore/RssModel.qml - \skipto XmlListModel - \printuntil encodeTags - - We use the \c tags custom property to specify which photos to download. The - \c encodeTags custom function uses the \c encodeURIComponent JavaScript - method to ensure that the requests to the server are correctly formatted. - - We use the \c source property to fetch photos that have the specified tags - attached from public Flickr feeds: - - \printuntil namespaceDeclarations - - The \c query property specifies that the XmlListModel generates a model item - for each feed entry. - - The \c namespaceDeclarations property specifies that the requested document - uses the namespace \c{http://www.w3.org/2005/Atom}, which is declared as the - default namespace. - - We use the XmlRole type to specify the model item attributes. Each model - item has the \c title, \c content, and \c hq attributes that match the - values of the corresponding feed entry: - - \printuntil hq - - \section1 Creating Flipable Labels - - When users select the \b Edit button, the album labels are flipped from - their front side to their back side and the text on them changes from album - name to \b Remove. - - In AlbumDelegate.qml, we use the Tag custom type to specify the text to - display on the front and back sides of album labels: - - \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml - \skipto Tag - \printuntil onBackClicked - \printuntil } - - The \c onTagChanged signal handler is used to change the tag based on - which the model is populated. The \c onBackClicked signal handler is used to - remove the album. - - In Tag.qml, we use a \l Flipable type with custom properties and signals to - create the labels: - - \quotefromfile demos/photoviewer/PhotoViewerCore/Tag.qml - \skipto Flipable - \printuntil tagChanged - - The \c front property holds the EditableButton custom type that enables - users to edit the label text: - - \printuntil onLabelChanged - \printuntil } - - The \c back property holds the \c Button custom type that is used to remove - the album: - - \printuntil onClicked - \printuntil } - - \section1 Laying out Photos on a Path - - In AlbumDelegate.qml, we use a PathView type to lay out the photos provided - by the \c visualModel.parts.stack model on a path that has the form of a - stack: - - \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml - \skipto PathView - \printuntil 0.0 - \printuntil } - \printuntil } - - The \c path property holds the \l Path type that defines the path used by - the PathView. The PathAttribute types are used to set a range of - \c 0 to \c 9999 for the \c z attribute. This way, the path creates a stack - of album photos. Because each PhotoDelegate is slightly rotated at a random - angle, this results in a realistic-looking stack of photos. - - \section1 Providing Feedback to Users - - We use a busy indicator and a progress bar to indicate activity while - Flickr feeds and photos are being loaded. - - In AlbumDelegate.qml, we use the \c BusyIndicator custom type and the - \c on custom property to display a rotating image while the Flickr feed is - being loaded: - - \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml - \skipto BusyIndicator - \printuntil rssModel - \printuntil } - - In PhotoDelegate.qml, we use them to indicate activity while a photo is - being loaded: - - \quotefromfile demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml - \skipto BusyIndicator - \printuntil } - - We define the \c BusyIndicator type in \c BusyIndicator.qml. We use an - \l Image type to display an image and apply a NumberAnimation to its - \c rotation property to rotate the image in an infinite loop: - - \quotefromfile demos/photoviewer/PhotoViewerCore/BusyIndicator.qml - \skipto Image - \printuntil } - \printuntil } - - In your apps, you can also use the BusyIndicator type from the - \l {Qt Quick Controls} module. - - In main.qml, we use the \c ProgressBar custom type to indicate progress - while a high quality version of a photo is being opened on full screen: - - \quotefromfile demos/photoviewer/main.qml - \skipto ProgressBar - \printuntil } - - We define the \c ProgressBar type in \c ProgressBar.qml. We use a - \l Rectangle type to create the progress bar and apply a NumberAnimation to - its \c opacity property to change the color of the bar from black to white - as data loading proceeds: - - \quotefromfile demos/photoviewer/PhotoViewerCore/ProgressBar.qml - \skipto Item - \printuntil /^\}/ - - In your apps, you can also use the ProgressBar type from the - \l {Qt Quick Controls} module. - - \section1 Localizing Applications - - The example application is translated into German and French. The translated - strings are loaded at runtime according to the current locale. - - We use a \l Column type in main.qml to position buttons for adding and - editing albums and exiting the application: - - \quotefromfile demos/photoviewer/main.qml - \skipto Column - \printuntil quit() - \printuntil } - \printuntil } - - We use the \l[QML]{Qt::}{qsTr()} command to mark the button labels translatable. - - We use the \c lupdate() tool to generate the translation source files and - the \c lrelease() tool to convert the translated strings to the QM files used - by the application at runtime. These files are stored in the \c i18n - directory. - - To make the application aware of the translations, we add code to the - \c main() function in the main.cpp file. The code creates a \l QTranslator - object, loads a translation according to the current locale at runtime, and - installs the translator object into the application: - - \quotefromfile demos/photoviewer/main.cpp - \skipto main - \printuntil app.installTranslator - - \sa {QML Applications} -*/ diff --git a/examples/quick/demos/photoviewer/i18n/qml_de.qm b/examples/quick/demos/photoviewer/i18n/qml_de.qm Binary files differdeleted file mode 100644 index 8186e7309f..0000000000 --- a/examples/quick/demos/photoviewer/i18n/qml_de.qm +++ /dev/null diff --git a/examples/quick/demos/photoviewer/i18n/qml_de.ts b/examples/quick/demos/photoviewer/i18n/qml_de.ts deleted file mode 100644 index 92ab50a136..0000000000 --- a/examples/quick/demos/photoviewer/i18n/qml_de.ts +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="de_DE"> -<context> - <name>AlbumDelegate</name> - <message> - <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="102"/> - <source>Remove</source> - <translation>Entfernen</translation> - </message> -</context> -<context> - <name>main</name> - <message> - <location filename="../main.qml" line="75"/> - <source>Add</source> - <translation>Zufügen</translation> - </message> - <message> - <location filename="../main.qml" line="84"/> - <source>Edit</source> - <translation>Bearbeiten</translation> - </message> - <message> - <location filename="../main.qml" line="89"/> - <source>Quit</source> - <translation>Verlassen</translation> - </message> - <message> - <location filename="../main.qml" line="102"/> - <source>Back</source> - <translation>Zurück</translation> - </message> -</context> -</TS> diff --git a/examples/quick/demos/photoviewer/i18n/qml_fr.qm b/examples/quick/demos/photoviewer/i18n/qml_fr.qm Binary files differdeleted file mode 100644 index e4257d4073..0000000000 --- a/examples/quick/demos/photoviewer/i18n/qml_fr.qm +++ /dev/null diff --git a/examples/quick/demos/photoviewer/i18n/qml_fr.ts b/examples/quick/demos/photoviewer/i18n/qml_fr.ts deleted file mode 100644 index 1edb5e0fe4..0000000000 --- a/examples/quick/demos/photoviewer/i18n/qml_fr.ts +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="fr_FR"> -<context> - <name>AlbumDelegate</name> - <message> - <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="102"/> - <source>Remove</source> - <translation>Supprimer</translation> - </message> -</context> -<context> - <name>main</name> - <message> - <location filename="../main.qml" line="75"/> - <source>Add</source> - <translation>Ajouter</translation> - </message> - <message> - <location filename="../main.qml" line="84"/> - <source>Edit</source> - <translation>Éditer</translation> - </message> - <message> - <location filename="../main.qml" line="89"/> - <source>Quit</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../main.qml" line="102"/> - <source>Back</source> - <translation>Retour</translation> - </message> -</context> -</TS> diff --git a/examples/quick/demos/photoviewer/main.qml b/examples/quick/demos/photoviewer/main.qml deleted file mode 100644 index 2e2b8e4ee2..0000000000 --- a/examples/quick/demos/photoviewer/main.qml +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQml.Models 2.1 -import "PhotoViewerCore" - -ApplicationWindow { - id: mainWindow - - visible: true - - Rectangle { - focus: true - - Keys.onBackPressed: { - event.accepted = true - backButton.clicked() - } - } - - property real downloadProgress: 0 - property bool imageLoading: false - property bool editMode: false - - width: 800; height: 480; color: "#d5d6d8" - - ListModel { - id: photosModel - ListElement { tag: "Flowers" } - ListElement { tag: "Wildlife" } - ListElement { tag: "Prague" } - } - - DelegateModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} } - - GridView { - id: albumView; width: parent.width; height: parent.height; cellWidth: 210; cellHeight: 220 - model: albumVisualModel.parts.album; visible: albumsShade.opacity != 1.0 - } - - Column { - spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 } - Button { - id: newButton; label: qsTr("Add"); rotation: 3 - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - mainWindow.editMode = false - photosModel.append( { tag: "" } ) - albumView.positionViewAtIndex(albumView.count - 1, GridView.Contain) - } - } - Button { - id: deleteButton; label: qsTr("Edit"); rotation: -2; - onClicked: mainWindow.editMode = !mainWindow.editMode - anchors.horizontalCenter: parent.horizontalCenter - } - Button { - id: quitButton; label: qsTr("Quit"); rotation: -2; - onClicked: Qt.quit() - anchors.horizontalCenter: parent.horizontalCenter - } - } - - Rectangle { - id: albumsShade; color: mainWindow.color - width: parent.width; height: parent.height; opacity: 0.0 - } - - ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false } - - Button { - id: backButton - label: qsTr("Back") - rotation: 3 - x: parent.width - backButton.width - 6 - y: -backButton.height - 8 - visible: Qt.platform.os !== "android" - } - - Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 } - - ListView { anchors.fill: parent; model: albumVisualModel.parts.fullscreen; interactive: false } - - Item { id: foreground; anchors.fill: parent } - - ProgressBar { - progress: mainWindow.downloadProgress; width: parent.width; height: 4 - anchors.bottom: parent.bottom; opacity: mainWindow.imageLoading; visible: opacity != 0.0 - } -} diff --git a/examples/quick/demos/photoviewer/photoviewer.pro b/examples/quick/demos/photoviewer/photoviewer.pro deleted file mode 100644 index 68e43e13f9..0000000000 --- a/examples/quick/demos/photoviewer/photoviewer.pro +++ /dev/null @@ -1,19 +0,0 @@ -TEMPLATE = app - -QT += qml quick xmlpatterns - -SOURCES += main.cpp - -lupdate_only{ -SOURCES = *.qml \ - PhotoViewerCore/*.qml \ - PhotoViewerCore/script/*.js -} - -TRANSLATIONS += i18n/qml_fr.ts \ - i18n/qml_de.ts - -RESOURCES += qml.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/photoviewer -INSTALLS += target diff --git a/examples/quick/demos/photoviewer/qml.qrc b/examples/quick/demos/photoviewer/qml.qrc deleted file mode 100644 index 8abefc6212..0000000000 --- a/examples/quick/demos/photoviewer/qml.qrc +++ /dev/null @@ -1,19 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>PhotoViewerCore/AlbumDelegate.qml</file> - <file>PhotoViewerCore/BusyIndicator.qml</file> - <file>PhotoViewerCore/Button.qml</file> - <file>PhotoViewerCore/EditableButton.qml</file> - <file>PhotoViewerCore/PhotoDelegate.qml</file> - <file>PhotoViewerCore/ProgressBar.qml</file> - <file>PhotoViewerCore/RssModel.qml</file> - <file>PhotoViewerCore/Tag.qml</file> - <file>PhotoViewerCore/images/box-shadow.png</file> - <file>PhotoViewerCore/images/busy.png</file> - <file>PhotoViewerCore/images/cardboard.png</file> - <file>PhotoViewerCore/script/script.js</file> - <file>i18n/qml_fr.qm</file> - <file>i18n/qml_de.qm</file> - </qresource> -</RCC> diff --git a/examples/quick/demos/rssnews/content/BusyIndicator.qml b/examples/quick/demos/rssnews/content/BusyIndicator.qml deleted file mode 100644 index f82fc3b67d..0000000000 --- a/examples/quick/demos/rssnews/content/BusyIndicator.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 - -Image { - id: container - - source: "images/busy.png"; - - NumberAnimation on rotation { - running: container.visible - from: 0; to: 360; - loops: Animation.Infinite; - duration: 1200 - } -} diff --git a/examples/quick/demos/rssnews/content/CategoryDelegate.qml b/examples/quick/demos/rssnews/content/CategoryDelegate.qml deleted file mode 100644 index 0df1ce55d5..0000000000 --- a/examples/quick/demos/rssnews/content/CategoryDelegate.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 - -Rectangle { - id: delegate - - property bool selected: ListView.isCurrentItem - property real itemSize - width: itemSize - height: itemSize - - Image { - anchors.centerIn: parent - source: image - } - - Text { - id: titleText - - anchors { - left: parent.left; leftMargin: 20 - right: parent.right; rightMargin: 20 - top: parent.top; topMargin: 20 - } - - font { pixelSize: 18; bold: true } - text: name - color: selected ? "#ffffff" : "#ebebdd" - scale: selected ? 1.15 : 1.0 - Behavior on color { ColorAnimation { duration: 150 } } - Behavior on scale { PropertyAnimation { duration: 300 } } - } - - BusyIndicator { - scale: 0.8 - visible: delegate.ListView.isCurrentItem && window.loading - anchors.centerIn: parent - } - - MouseArea { - anchors.fill: delegate - onClicked: { - delegate.ListView.view.currentIndex = index - if (window.currentFeed == feed) - feedModel.reload() - else - window.currentFeed = feed - } - } -} diff --git a/examples/quick/demos/rssnews/content/NewsDelegate.qml b/examples/quick/demos/rssnews/content/NewsDelegate.qml deleted file mode 100644 index 3d71d9d516..0000000000 --- a/examples/quick/demos/rssnews/content/NewsDelegate.qml +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 - -Column { - id: delegate - width: delegate.ListView.view.width - spacing: 8 - - // Returns a string representing how long ago an event occurred - function timeSinceEvent(pubDate) { - var result = pubDate; - - // We need to modify the pubDate read from the RSS feed - // so the JavaScript Date object can interpret it - var d = pubDate.replace(',','').split(' '); - if (d.length != 6) - return result; - - var date = new Date([d[0], d[2], d[1], d[3], d[4], 'GMT' + d[5]].join(' ')); - - if (!isNaN(date.getDate())) { - var age = new Date() - date; - var minutes = Math.floor(Number(age) / 60000); - if (minutes < 1440) { - if (minutes < 2) - result = qsTr("Just now"); - else if (minutes < 60) - result = '' + minutes + ' ' + qsTr("minutes ago") - else if (minutes < 120) - result = qsTr("1 hour ago"); - else - result = '' + Math.floor(minutes/60) + ' ' + qsTr("hours ago"); - } - else { - result = date.toDateString(); - } - } - return result; - } - - Item { height: 8; width: delegate.width } - - Row { - width: parent.width - spacing: 8 - - Column { - Item { - width: 4 - height: titleText.font.pixelSize / 4 - } - - Image { - id: titleImage - source: image - } - } - - Text { - id: titleText - - text: title - width: delegate.width - titleImage.width - wrapMode: Text.WordWrap - font.pixelSize: 26 - font.bold: true - } - } - - Text { - width: delegate.width - font.pixelSize: 12 - textFormat: Text.RichText - font.italic: true - text: timeSinceEvent(pubDate) + " (<a href=\"" + link + "\">Link</a>)" - onLinkActivated: { - Qt.openUrlExternally(link) - } - } - - Text { - id: descriptionText - - text: description - width: parent.width - wrapMode: Text.WordWrap - font.pixelSize: 14 - textFormat: Text.StyledText - horizontalAlignment: Qt.AlignLeft - } -} diff --git a/examples/quick/demos/rssnews/content/RssFeeds.qml b/examples/quick/demos/rssnews/content/RssFeeds.qml deleted file mode 100644 index d6fb9e27d1..0000000000 --- a/examples/quick/demos/rssnews/content/RssFeeds.qml +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 - -ListModel { - ListElement { name: "Top Stories"; feed: "news.yahoo.com/rss/topstories"; image: "images/TopStories.jpg" } - ListElement { name: "World"; feed: "news.yahoo.com/rss/world"; image: "images/World.jpg" } - ListElement { name: "Europe"; feed: "news.yahoo.com/rss/europe"; image: "images/Europe.jpg" } - ListElement { name: "Asia"; feed: "news.yahoo.com/rss/asia"; image: "images/Asia.jpg" } - ListElement { name: "U.S. National"; feed: "news.yahoo.com/rss/us"; image: "images/USNational.jpg" } - ListElement { name: "Politics"; feed: "news.yahoo.com/rss/politics"; image: "images/Politics.jpg" } - ListElement { name: "Business"; feed: "news.yahoo.com/rss/business"; image: "images/Business.jpg" } - ListElement { name: "Technology"; feed: "news.yahoo.com/rss/tech"; image: "images/Technology.jpg" } - ListElement { name: "Entertainment"; feed: "news.yahoo.com/rss/entertainment"; image: "images/Entertainment.jpg" } - ListElement { name: "Health"; feed: "news.yahoo.com/rss/health"; image: "images/Health.jpg" } - ListElement { name: "Science"; feed: "news.yahoo.com/rss/science"; image: "images/Science.jpg" } - ListElement { name: "Sports"; feed: "news.yahoo.com/rss/sports"; image: "images/Sports.jpg" } -} diff --git a/examples/quick/demos/rssnews/content/ScrollBar.qml b/examples/quick/demos/rssnews/content/ScrollBar.qml deleted file mode 100644 index 46d584655b..0000000000 --- a/examples/quick/demos/rssnews/content/ScrollBar.qml +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 - -Item { - id: container - - property variant scrollArea - property int orientation: Qt.Vertical - - opacity: 0 - - function position() - { - var ny = 0; - if (container.orientation == Qt.Vertical) - ny = scrollArea.visibleArea.yPosition * container.height; - else - ny = scrollArea.visibleArea.xPosition * container.width; - - if (ny > 2) - return ny; - else - return 2; - } - - function size() - { - var nh, ny; - - if (container.orientation == Qt.Vertical) - nh = scrollArea.visibleArea.heightRatio * container.height; - else - nh = scrollArea.visibleArea.widthRatio * container.width; - - if (container.orientation == Qt.Vertical) - ny = scrollArea.visibleArea.yPosition * container.height; - else - ny = scrollArea.visibleArea.xPosition * container.width; - - if (ny > 3) { - var t; - if (container.orientation == Qt.Vertical) - t = Math.ceil(container.height - 3 - ny); - else - t = Math.ceil(container.width - 3 - ny); - if (nh > t) - return t; - else - return nh; - } else - return nh + ny; - } - - Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.3 } - - BorderImage { - source: "images/scrollbar.png" - border { left: 1; right: 1; top: 1; bottom: 1 } - x: container.orientation == Qt.Vertical ? 2 : position() - y: container.orientation == Qt.Vertical ? position() : 2 - width: container.orientation == Qt.Vertical ? container.width - 4 : size() - height: container.orientation == Qt.Vertical ? size() : container.height - 4 - } - - states: State { - name: "visible" - when: container.orientation == Qt.Vertical ? - scrollArea.movingVertically : - scrollArea.movingHorizontally - PropertyChanges { target: container; opacity: 1.0 } - } - - transitions: Transition { - from: "visible"; to: "" - NumberAnimation { properties: "opacity"; duration: 600 } - } -} diff --git a/examples/quick/demos/rssnews/content/images/Asia.jpg b/examples/quick/demos/rssnews/content/images/Asia.jpg Binary files differdeleted file mode 100644 index a609557a08..0000000000 --- a/examples/quick/demos/rssnews/content/images/Asia.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/Business.jpg b/examples/quick/demos/rssnews/content/images/Business.jpg Binary files differdeleted file mode 100644 index b2c1d92138..0000000000 --- a/examples/quick/demos/rssnews/content/images/Business.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/Entertainment.jpg b/examples/quick/demos/rssnews/content/images/Entertainment.jpg Binary files differdeleted file mode 100644 index 2c69fc04d7..0000000000 --- a/examples/quick/demos/rssnews/content/images/Entertainment.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/Europe.jpg b/examples/quick/demos/rssnews/content/images/Europe.jpg Binary files differdeleted file mode 100644 index bf524e13d0..0000000000 --- a/examples/quick/demos/rssnews/content/images/Europe.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/Health.jpg b/examples/quick/demos/rssnews/content/images/Health.jpg Binary files differdeleted file mode 100644 index 0e8c71f0c9..0000000000 --- a/examples/quick/demos/rssnews/content/images/Health.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/Politics.jpg b/examples/quick/demos/rssnews/content/images/Politics.jpg Binary files differdeleted file mode 100644 index 0b1800c97e..0000000000 --- a/examples/quick/demos/rssnews/content/images/Politics.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/Science.jpg b/examples/quick/demos/rssnews/content/images/Science.jpg Binary files differdeleted file mode 100644 index 7faccbbb97..0000000000 --- a/examples/quick/demos/rssnews/content/images/Science.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/Sports.jpg b/examples/quick/demos/rssnews/content/images/Sports.jpg Binary files differdeleted file mode 100644 index 0ab3bd3ce7..0000000000 --- a/examples/quick/demos/rssnews/content/images/Sports.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/Technology.jpg b/examples/quick/demos/rssnews/content/images/Technology.jpg Binary files differdeleted file mode 100644 index db553028fb..0000000000 --- a/examples/quick/demos/rssnews/content/images/Technology.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/TopStories.jpg b/examples/quick/demos/rssnews/content/images/TopStories.jpg Binary files differdeleted file mode 100644 index e35bd67f20..0000000000 --- a/examples/quick/demos/rssnews/content/images/TopStories.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/USNational.jpg b/examples/quick/demos/rssnews/content/images/USNational.jpg Binary files differdeleted file mode 100644 index 82c78228c1..0000000000 --- a/examples/quick/demos/rssnews/content/images/USNational.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/World.jpg b/examples/quick/demos/rssnews/content/images/World.jpg Binary files differdeleted file mode 100644 index 7a0a806fd4..0000000000 --- a/examples/quick/demos/rssnews/content/images/World.jpg +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/btn_close.png b/examples/quick/demos/rssnews/content/images/btn_close.png Binary files differdeleted file mode 100644 index 1a3dc44380..0000000000 --- a/examples/quick/demos/rssnews/content/images/btn_close.png +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/busy.png b/examples/quick/demos/rssnews/content/images/busy.png Binary files differdeleted file mode 100644 index fc65122d26..0000000000 --- a/examples/quick/demos/rssnews/content/images/busy.png +++ /dev/null diff --git a/examples/quick/demos/rssnews/content/images/scrollbar.png b/examples/quick/demos/rssnews/content/images/scrollbar.png Binary files differdeleted file mode 100644 index c2425dd0df..0000000000 --- a/examples/quick/demos/rssnews/content/images/scrollbar.png +++ /dev/null diff --git a/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png b/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png Binary files differdeleted file mode 100644 index 9d324ceb70..0000000000 --- a/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png +++ /dev/null diff --git a/examples/quick/demos/rssnews/doc/src/rssnews.qdoc b/examples/quick/demos/rssnews/doc/src/rssnews.qdoc deleted file mode 100644 index e9509eda32..0000000000 --- a/examples/quick/demos/rssnews/doc/src/rssnews.qdoc +++ /dev/null @@ -1,372 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Qt Quick Demo - RSS News - \ingroup qtquickdemos - \example demos/rssnews - \brief A QML RSS news reader that uses XmlListModel and XmlRole to download - XML data, ListModel and ListElement to create a category list, and ListView - to display the data. - - \image qtquick-demo-rssnews-small.png - - \e{RSS News} demonstrates the following \l{Qt Quick} features: - - \list - \li Using custom types to create screens and screen controls. - \li Using list models and list elements to represent data. - \li Using XML list models to download XML data. - \li Using list views to display data. - \li Using the \l Component type to create a footer for the news item - list view. - \li Using the \l Image type to create a button for closing the app. - \endlist - - \include examples-run.qdocinc - - \section1 Using Custom Types - - In the RSS News app, we use the following custom types that are each defined - in a separate .qml file: - - \list - \li \c BusyIndicator.qml - \li \c CategoryDelegate.qml - \li \c NewsDelegate.qml - \li \c RssFeeds.qml - \li \c ScrollBar.qml - \endlist - - To use the custom types, we add an import statement to the main QML file, - rssnews.qml that imports the folder called \c content where the types are - located: - - \quotefromfile demos/rssnews/rssnews.qml - \skipto content - \printuntil " - - \section1 Creating the Main Window - - In rssnews.qml, we use a \l{Rectangle} type with custom properties to create - the app main window: - - \printuntil isPortrait - - We will use the custom properties later for loading XML data and for - adjusting the screen layout depending on its orientation. - - \section1 Creating a Category List - - In rssnews.qml, we use the RssFeeds custom type that we specify in - RssFeeds.qml to create a list of feed categories: - - \skipto RssFeeds - \printuntil } - - In RssFeeds.qml, we use a ListModel type with a ListElement type to - create a category list where list elements represent feed categories: - - \quotefromfile demos/rssnews/content/RssFeeds.qml - \skipto ListModel - \printuntil /^\}/ - - List elements are defined like other QML types except that they contain a - collection of \e role definitions instead of properties. Roles both define - how the data is accessed and include the data itself. - - For each list element, we use the \c name role to specify the category name, - the \c feed role to specify the URL to load the data from, and the \c image - role to display an image for the category. - - In rssnews.qml, we use a ListView type to display the category list: - - \quotefromfile demos/rssnews/rssnews.qml - \skipto ListView - \printuntil } - \printuntil } - - To lay out the category list horizontally at the top of the window in - portrait orientation and vertically on the left side in landscape - orientation, we use the \c orientation property. Based on the orientation, - we bind either the width or the height of the list to a fixed value - (\c itemWidth). - - We use the \c anchors.top property to position the list view at the top of - the screen in both orientations. - - We use the \c model property to load XML data from the \c rssFeeds model, - and \c CategoryDelegate as the delegate to instantiate each item in the - list. - - \section1 Creating List Elements - - In CategoryDelegate.qml, we use the \l Rectangle type with custom properties - to create list elements: - - \quotefromfile demos/rssnews/content/CategoryDelegate.qml - \skipto Rectangle - \printuntil selected - - We set the \c selected property to the \c ListView.isCurrentItem attached - property to specify that \c selected is \c true if \c delegate is the - current item. - - We use the \l Image type \c source property to display the image, centered - in the delegate, specified for the list element by the \c image role in the - \c rssFeeds list model: - - \skipto Image - \printuntil } - - We use a \l Text type to add titles to list elements: - - \printuntil Behavior - \printuntil } - - We use the \c anchors property to position the title at the top of the list - element, with a 20-pixel margin. We use \c font properties to adjust font - size and text formatting. - - We use the \c color property to brighten the text and to scale it slightly - larger when the list item is the current item. By applying a \l Behavior to - the property, we animate the actions of selecting and deselecting list - items. - - We use a MouseArea type to download XML data when users tap a category list - element: - - \skipto MouseArea - \printuntil } - \printuntil } - - The \c anchors.fill property is set to \c delegate to enable users to tap - anywhere within the list element. - - We use the \c onClicked signal handler to load the XML data for the category - list. If the tapped category is already current, the \c reload() function - is called to reload the data. - - \section1 Downloading XML Data - - In rssnews.qml, we use an XmlListModel type as a data source for ListView - elements to display news items in the selected category: - - \quotefromfile demos/rssnews/rssnews.qml - \skipto XmlListModel { - \printuntil namespaceDeclarations - - We use the \c source property and the \c window.currentFeed custom property - to fetch news items for the selected category. - - The \c query property specifies that the XmlListModel generates a model item - for each \c <item> in the XML document. - - We use the XmlRole type to specify the model item attributes. Each model - item has the \c title, \c description, \c image, \c link, and \c pubDate - attributes that match the values of the corresponding \c <item> in the XML - document: - - \printuntil pubDate - \printuntil } - - We use the \c feedModel model in a ListView type to display the data: - - \skipuntil ScrollBar - \skipto ListView - \printuntil } - \printuntil } - - To list the news items below the category list in portrait orientation and - to its right in landscape orientation, we use the \c isPortrait custom - property to anchor the top of the news items list to the left of \c window - and bottom of \c categories in portrait orientation and to the right of - \c categories and bottom of \c window in landscape orientation. - - We use the \c anchors.bottom property to anchor the bottom of the list view - to the bottom of the window in both orientations. - - In portrait orientation, we clip the painting of the news items to the - bounding rectangle of the list view to avoid graphical artifacts when news - items are scrolled over other items. In landscape, this is not required, - because the list spans the entire screen vertically. - - We use the \c model property to load XML data from the \c feedModel model, - and use \c NewsDelegate as the delegate to instantiate each item in the - list. - - In NewsDelegate.qml, we use a \l Column type to lay out the XML data: - - \quotefromfile demos/rssnews/content/NewsDelegate.qml - \skipto Column - \printuntil spacing - - Within the column, we use a \l Row and another column to position images and - title text: - - \skipto Row - \printuntil font.bold - \printuntil } - \printuntil } - - We generate a textual representation of how long ago the item was posted - using the \c timeSinceEvent() JavaScript function: - - \printuntil } - \printuntil } - - We use the \c onLinkActivated signal handler to open the URL in an external - browser when users select the link. - - \section1 Providing Feedback to Users - - In CategoryDelegate.qml, we use the \c BusyIndicator custom type to indicate - activity while the XML data is being loaded: - - \quotefromfile demos/rssnews/content/CategoryDelegate.qml - \skipto BusyIndicator - \printuntil } - - We use the \c scale property to reduce the indicator size to \c 0.8. We bind - the \c visible property to the \c isCurrentItem attached property of the - \c delegate list view and \c loading property of the main window to display - the indicator image when a category list item is the current item and XML - data is being loaded. - - We define the \c BusyIndicator type in \c BusyIndicator.qml. We use an - \l Image type to display an image and apply a NumberAnimation to its - \c rotation property to rotate the image in an infinite loop: - - \quotefromfile demos/rssnews/content/BusyIndicator.qml - \skipto Image - \printuntil } - \printuntil } - - In your apps, you can also use the BusyIndicator type from the - \l {Qt Quick Controls} module. - - \section1 Creating Scroll Bars - - In rssnews.qml, we use our own custom \c ScrollBar type to create scroll - bars in the category and news item list views. In your apps, you can also - use the ScrollView type from the \l {Qt Quick Controls} module. - - First, we create a scroll bar in the category list view. We bind the - \c orientation property to the \c isPortrait property and to the - \c Horizontal value of the \c Qt::Orientation enum type to display a - horizontal scroll bar in portrait orientation and to the \c Vertical value - to display a vertical scroll bar in landscape orientation: - - \quotefromfile demos/rssnews/rssnews.qml - \skipto ScrollBar - \printuntil } - - Same as with the \c categories list view, we adjust the width and height of - the scroll bar based on the \c isPortrait property. - - We use the \c scrollArea property to display the scroll bar in the - \c categories list view. - - We use the \c anchors.right property to anchor the scroll bar to the right - side of the category list. - - \skipto ScrollBar - \printuntil } - - Second, we create another scroll bar in the news item list view. We want a - vertical scroll bar to appear on the right side of the view regardless of - screen orientation, so we can set the \c width property to \c 8 and bind the - \c anchors.right property to the \c window.right property. We use the - \c anchors.top property to anchor the scroll bar top to the bottom of the - category list in portrait orientation and to the top of the news item list - in landscape orientation. We use the \c anchors.bottom property to anchor - the scroll bar bottom to the list view bottom in both orientations. - - We define the \c ScrollBar type in \c ScrollBar.qml. We use an \l Item type - with custom properties to create a container for the scroll bar: - - \quotefromfile demos/rssnews/content/ScrollBar.qml - \skipto Item - \printuntil opacity - - We use a BorderImage type to display the scroll bar thumb at the x and y - position that we calculate by using the \c position() function: - - \skipto BorderImage - \printuntil height - \printuntil } - - We use the \c size function to calculate the thumb width and height - depending on the screen orientation. - - We use \c states to make the scroll bar visible when the users move the - scroll area: - - \printuntil } - \printuntil } - - We use \c transitions to apply a NumberAnimation to the \c "opacity" - property when the state changes from "visible" to the default state: - - \printuntil /^\}/ - - \section1 Creating Footers - - In rssnews.qml, we use a \l Component type with a \l Rectangle type to - create a footer for the news list view: - - \quotefromfile demos/rssnews/rssnews.qml - \skipto Component - \printuntil } - \printuntil } - \printuntil } - - We bind the \c width of the footer to the width of the component and the - \c height to the of close button to align them when no news items are - displayed. - - \section1 Creating Buttons - - In rssnews.qml, we use an \l Image type to create a simple push button that - users can tap to close the app: - - \printuntil Qt.quit() - \printuntil } - \printuntil } - \printuntil } - - We use \c anchors to position the close button in the top right corner of - the news list view, with 4-pixel margins. Because the close button overlaps - the category list in portrait orientation, we animate the \c opacity - property to make the button almost fully transparent when users are - scrolling the category list. - - We use the \c onClicked signal handler within a MouseArea to call the - \c quit() function when users select the close button. - - \sa {QML Applications} -*/ diff --git a/examples/quick/demos/rssnews/main.cpp b/examples/quick/demos/rssnews/main.cpp deleted file mode 100644 index 08a2322845..0000000000 --- a/examples/quick/demos/rssnews/main.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(demos/rssnews/rssnews) diff --git a/examples/quick/demos/rssnews/rssnews.pro b/examples/quick/demos/rssnews/rssnews.pro deleted file mode 100644 index c67c5a6558..0000000000 --- a/examples/quick/demos/rssnews/rssnews.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE = app - -QT += quick qml xml xmlpatterns -SOURCES += main.cpp -RESOURCES += rssnews.qrc - -OTHER_FILES = rssnews.qml \ - content/*.qml \ - content/*.js \ - content/images/* - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/rssnews -INSTALLS += target diff --git a/examples/quick/demos/rssnews/rssnews.qml b/examples/quick/demos/rssnews/rssnews.qml deleted file mode 100644 index bd1ed48af5..0000000000 --- a/examples/quick/demos/rssnews/rssnews.qml +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.2 -import QtQuick.XmlListModel 2.0 -import QtQuick.Window 2.1 -import "./content" - -Rectangle { - id: window - - width: 800 - height: 480 - - property string currentFeed: rssFeeds.get(0).feed - property bool loading: feedModel.status === XmlListModel.Loading - property bool isPortrait: Screen.primaryOrientation === Qt.PortraitOrientation - - onLoadingChanged: { - if (feedModel.status == XmlListModel.Ready) - list.positionViewAtBeginning() - } - - RssFeeds { id: rssFeeds } - - XmlListModel { - id: feedModel - - source: "http://" + window.currentFeed - query: "/rss/channel/item[child::media:content]" - namespaceDeclarations: "declare namespace media = 'http://search.yahoo.com/mrss/';" - - XmlRole { name: "title"; query: "title/string()" } - // Remove any links from the description - XmlRole { name: "description"; query: "fn:replace(description/string(), '\<a href=.*\/a\>', '')" } - XmlRole { name: "image"; query: "media:content/@url/string()" } - XmlRole { name: "link"; query: "link/string()" } - XmlRole { name: "pubDate"; query: "pubDate/string()" } - } - - ListView { - id: categories - property int itemWidth: 190 - - width: isPortrait ? parent.width : itemWidth - height: isPortrait ? itemWidth : parent.height - orientation: isPortrait ? ListView.Horizontal : ListView.Vertical - anchors.top: parent.top - model: rssFeeds - delegate: CategoryDelegate { itemSize: categories.itemWidth } - spacing: 3 - } - - ScrollBar { - id: listScrollBar - - orientation: isPortrait ? Qt.Horizontal : Qt.Vertical - height: isPortrait ? 8 : categories.height; - width: isPortrait ? categories.width : 8 - scrollArea: categories; - anchors.right: categories.right - } - - ListView { - id: list - - anchors.left: isPortrait ? window.left : categories.right - anchors.right: closeButton.left - anchors.top: isPortrait ? categories.bottom : window.top - anchors.bottom: window.bottom - anchors.leftMargin: 30 - anchors.rightMargin: 4 - clip: isPortrait - model: feedModel - footer: footerText - delegate: NewsDelegate {} - } - - ScrollBar { - scrollArea: list - width: 8 - anchors.right: window.right - anchors.top: isPortrait ? categories.bottom : window.top - anchors.bottom: window.bottom - } - - Component { - id: footerText - - Rectangle { - width: parent.width - height: closeButton.height - color: "lightgray" - - Text { - text: "RSS Feed from Yahoo News" - anchors.centerIn: parent - font.pixelSize: 14 - } - } - } - - Image { - id: closeButton - source: "content/images/btn_close.png" - scale: 0.8 - anchors.top: parent.top - anchors.right: parent.right - anchors.margins: 4 - opacity: (isPortrait && categories.moving) ? 0.2 : 1.0 - Behavior on opacity { - NumberAnimation { duration: 300; easing.type: Easing.OutSine } - } - - MouseArea { - anchors.fill: parent - onClicked: { - Qt.quit() - } - } - } -} diff --git a/examples/quick/demos/rssnews/rssnews.qmlproject b/examples/quick/demos/rssnews/rssnews.qmlproject deleted file mode 100644 index 5becbdaed0..0000000000 --- a/examples/quick/demos/rssnews/rssnews.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "rssnews.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/demos/rssnews/rssnews.qrc b/examples/quick/demos/rssnews/rssnews.qrc deleted file mode 100644 index 1208d44fd7..0000000000 --- a/examples/quick/demos/rssnews/rssnews.qrc +++ /dev/null @@ -1,25 +0,0 @@ -<RCC> - <qresource prefix="/demos/rssnews"> - <file>rssnews.qml</file> - <file>content/BusyIndicator.qml</file> - <file>content/CategoryDelegate.qml</file> - <file>content/NewsDelegate.qml</file> - <file>content/RssFeeds.qml</file> - <file>content/ScrollBar.qml</file> - <file>content/images/btn_close.png</file> - <file>content/images/Business.jpg</file> - <file>content/images/busy.png</file> - <file>content/images/Entertainment.jpg</file> - <file>content/images/Europe.jpg</file> - <file>content/images/Health.jpg</file> - <file>content/images/Asia.jpg</file> - <file>content/images/Politics.jpg</file> - <file>content/images/Science.jpg</file> - <file>content/images/scrollbar.png</file> - <file>content/images/Sports.jpg</file> - <file>content/images/Technology.jpg</file> - <file>content/images/TopStories.jpg</file> - <file>content/images/USNational.jpg</file> - <file>content/images/World.jpg</file> - </qresource> -</RCC> diff --git a/examples/quick/demos/samegame/content/Block.qml b/examples/quick/demos/samegame/content/Block.qml deleted file mode 100644 index eadb2dcf62..0000000000 --- a/examples/quick/demos/samegame/content/Block.qml +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Item { - id: block - property bool dying: false - property bool spawned: false - property int type: 0 - property ParticleSystem particleSystem - - Behavior on x { - enabled: spawned; - SpringAnimation{ spring: 2; damping: 0.2 } - } - Behavior on y { - SpringAnimation{ spring: 2; damping: 0.2 } - } - - Image { - id: img - source: { - if (type == 0){ - "gfx/red.png"; - } else if (type == 1) { - "gfx/blue.png"; - } else if (type == 2) { - "gfx/green.png"; - } else { - "gfx/yellow.png"; - } - } - opacity: 0 - Behavior on opacity { NumberAnimation { duration: 200 } } - anchors.fill: parent - } - - //Foreground particles - BlockEmitter { - id: particles - system: particleSystem - group: { - if (type == 0){ - "red"; - } else if (type == 1) { - "blue"; - } else if (type == 2) { - "green"; - } else { - "yellow"; - } - } - anchors.fill: parent - } - - //Paint particles on the background - PaintEmitter { - id: particles2 - system: particleSystem - } - - states: [ - State { - name: "AliveState"; when: spawned == true && dying == false - PropertyChanges { target: img; opacity: 1 } - }, - - State { - name: "DeathState"; when: dying == true - StateChangeScript { script: {particleSystem.paused = false; particles.pulse(100); particles2.pulse(100);} } - PropertyChanges { target: img; opacity: 0 } - StateChangeScript { script: block.destroy(1000); } - } - ] -} diff --git a/examples/quick/demos/samegame/content/BlockEmitter.qml b/examples/quick/demos/samegame/content/BlockEmitter.qml deleted file mode 100644 index 840c57a25e..0000000000 --- a/examples/quick/demos/samegame/content/BlockEmitter.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 -// Needed for singletons QTBUG-34418 -import "." - -Emitter { - property Item block: parent - velocity: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -40; magnitudeVariation: 40} - acceleration: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -100;} - shape: EllipseShape{fill:true} - enabled: false; - lifeSpan: 700; lifeSpanVariation: 100 - emitRate: 1000 - maximumEmitted: 100 //only fires 0.1s bursts (still 2x old number) - size: Settings.blockSize * 0.85 - endSize: Settings.blockSize * 0.85 /2 -} diff --git a/examples/quick/demos/samegame/content/Button.qml b/examples/quick/demos/samegame/content/Button.qml deleted file mode 100644 index 8cbfe532f2..0000000000 --- a/examples/quick/demos/samegame/content/Button.qml +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Item { - property alias imgSrc: image.source - property alias system: emitter.system - property alias group: emitter.group - signal clicked - property bool rotatedButton: false - - width: image.width - height: image.sourceSize.height - Image { - id: image - height: parent.height - width: height/sourceSize.height * sourceSize.width - - anchors.horizontalCenter: parent.horizontalCenter - rotation: rotatedButton ? ((Math.random() * 3 + 2) * (Math.random() <= 0.5 ? -1 : 1)) : 0 - MenuEmitter { - id: emitter - anchors.fill: parent - //shape: MaskShape {source: image.source} - } - } - MouseArea { - anchors.fill: parent - onClicked: {parent.clicked(); emitter.burst(400);} - } -} diff --git a/examples/quick/demos/samegame/content/GameArea.qml b/examples/quick/demos/samegame/content/GameArea.qml deleted file mode 100644 index ab5e98e27a..0000000000 --- a/examples/quick/demos/samegame/content/GameArea.qml +++ /dev/null @@ -1,228 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 -import "samegame.js" as Logic -import "." - -Item { - id: gameCanvas - property bool gameOver: true - property int score: 0 - property int highScore: 0 - property int moves: 0 - property string mode: "" - property ParticleSystem ps: particleSystem - //For easy theming - property alias backgroundVisible: bg.visible - property string background: "gfx/background.png" - property string blockFile: "Block.qml" - property int blockSize: Settings.blockSize - onBlockFileChanged: Logic.changeBlock(blockFile); - property alias particlePack: auxLoader.source - //For multiplayer - property int score2: 0 - property int curTurn: 1 - property bool autoTurnChange: false - signal swapPlayers - property bool swapping: false - //onSwapPlayers: if (autoTurnChange) Logic.turnChange();//Now implemented below - //For puzzle - property url level - property bool puzzleWon: false - signal puzzleLost //Since root is tracking the puzzle progress - function showPuzzleEnd (won) { - if (won) { - smokeParticle.color = Qt.rgba(0,1,0,0); - puzzleWin.play(); - } else { - smokeParticle.color = Qt.rgba(1,0,0,0); - puzzleFail.play(); - puzzleLost(); - } - } - function showPuzzleGoal (str) { - puzzleTextBubble.opacity = 1; - puzzleTextLabel.text = str; - } - Image { - id: bg - z: -1 - anchors.fill: parent - source: background; - fillMode: Image.PreserveAspectCrop - } - - MouseArea { - anchors.fill: parent; onClicked: { - if (puzzleTextBubble.opacity == 1) { - puzzleTextBubble.opacity = 0; - Logic.finishLoadingMap(); - } else if (!swapping) { - Logic.handleClick(mouse.x,mouse.y); - } - } - } - - Image { - id: highScoreTextBubble - opacity: mode == "arcade" && gameOver && gameCanvas.score == gameCanvas.highScore ? 1 : 0 - Behavior on opacity { NumberAnimation {} } - anchors.centerIn: parent - z: 10 - source: "gfx/bubble-highscore.png" - Image { - anchors.centerIn: parent - source: "gfx/text-highscore-new.png" - rotation: -10 - } - } - - Image { - id: puzzleTextBubble - anchors.centerIn: parent - opacity: 0 - Behavior on opacity { NumberAnimation {} } - z: 10 - source: "gfx/bubble-puzzle.png" - Connections { - target: gameCanvas - onModeChanged: if (mode != "puzzle" && puzzleTextBubble.opacity > 0) puzzleTextBubble.opacity = 0; - } - Text { - id: puzzleTextLabel - width: parent.width - 24 - anchors.centerIn: parent - horizontalAlignment: Text.AlignHCenter - color: "white" - font.pixelSize: 24 - font.bold: true - wrapMode: Text.WordWrap - } - } - onModeChanged: { - p1WonImg.opacity = 0; - p2WonImg.opacity = 0; - } - SmokeText { id: puzzleWin; source: "gfx/icon-ok.png"; system: particleSystem } - SmokeText { id: puzzleFail; source: "gfx/icon-fail.png"; system: particleSystem } - - onSwapPlayers: { - smokeParticle.color = "yellow" - Logic.turnChange(); - if (curTurn == 1) { - p1Text.play(); - } else { - p2Text.play(); - } - clickDelay.running = true; - } - SequentialAnimation { - id: clickDelay - ScriptAction { script: gameCanvas.swapping = true; } - PauseAnimation { duration: 750 } - ScriptAction { script: gameCanvas.swapping = false; } - } - - SmokeText { - id: p1Text; source: "gfx/text-p1-go.png"; - system: particleSystem; playerNum: 1 - opacity: p1WonImg.opacity + p2WonImg.opacity > 0 ? 0 : 1 - } - - SmokeText { - id: p2Text; source: "gfx/text-p2-go.png"; - system: particleSystem; playerNum: 2 - opacity: p1WonImg.opacity + p2WonImg.opacity > 0 ? 0 : 1 - } - - onGameOverChanged: { - if (gameCanvas.mode == "multiplayer") { - if (gameCanvas.score >= gameCanvas.score2) { - p1WonImg.opacity = 1; - } else { - p2WonImg.opacity = 1; - } - } - } - Image { - id: p1WonImg - source: "gfx/text-p1-won.png" - anchors.centerIn: parent - opacity: 0 - Behavior on opacity { NumberAnimation {} } - z: 10 - } - Image { - id: p2WonImg - source: "gfx/text-p2-won.png" - anchors.centerIn: parent - opacity: 0 - Behavior on opacity { NumberAnimation {} } - z: 10 - } - - ParticleSystem{ - id: particleSystem; - anchors.fill: parent - z: 5 - ImageParticle { - id: smokeParticle - groups: ["smoke"] - source: "gfx/particle-smoke.png" - alpha: 0.1 - alphaVariation: 0.1 - color: "yellow" - } - Loader { - id: auxLoader - anchors.fill: parent - source: "PrimaryPack.qml" - onItemChanged: { - if (item && "particleSystem" in item) - item.particleSystem = particleSystem - if (item && "gameArea" in item) - item.gameArea = gameCanvas - } - } - } -} - diff --git a/examples/quick/demos/samegame/content/LogoAnimation.qml b/examples/quick/demos/samegame/content/LogoAnimation.qml deleted file mode 100644 index 99a056adcc..0000000000 --- a/examples/quick/demos/samegame/content/LogoAnimation.qml +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Item { - id: container //Positioned where the 48x48 S/G should be - property alias running: mainAnim.running - property ParticleSystem particleSystem - property int dur: 500 - signal boomTime - Image { - id: s1 - source: "gfx/logo-s.png" - y: 0 - } - Image { - id: g1 - source: "gfx/logo-g.png" - y: -128 - } - Column { - Repeater { - model: 2 - Item { - width: 48 - height: 48 - BlockEmitter { - id: emitter - anchors.fill: parent - group: "red" - system: particleSystem - Connections { - target: container - onBoomTime: emitter.pulse(100); - } - } - } - } - } - SequentialAnimation { - id: mainAnim - running: true - loops: -1 - PropertyAction { target: g1; property: "y"; value: -128} - PropertyAction { target: g1; property: "opacity"; value: 1} - PropertyAction { target: s1; property: "y"; value: 0} - PropertyAction { target: s1; property: "opacity"; value: 1} - NumberAnimation { target: g1; property: "y"; from: -96; to: -48; duration: dur} - ParallelAnimation { - NumberAnimation { target: g1; property: "y"; from: -48; to: 0; duration: dur} - NumberAnimation { target: s1; property: "y"; from: 0; to: 48; duration: dur } - } - PauseAnimation { duration: dur } - ScriptAction { script: container.boomTime(); } - ParallelAnimation { - NumberAnimation { target: g1; property: "opacity"; to: 0; duration: dur } - NumberAnimation { target: s1; property: "opacity"; to: 0; duration: dur } - } - PropertyAction { target: s1; property: "y"; value: -128} - PropertyAction { target: s1; property: "opacity"; value: 1} - NumberAnimation { target: s1; property: "y"; from: -96; to: 0; duration: dur * 2} - } -} diff --git a/examples/quick/demos/samegame/content/MenuEmitter.qml b/examples/quick/demos/samegame/content/MenuEmitter.qml deleted file mode 100644 index 694badbbb9..0000000000 --- a/examples/quick/demos/samegame/content/MenuEmitter.qml +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Emitter { - anchors.fill: parent - velocity: AngleDirection{angleVariation: 360; magnitude: 140; magnitudeVariation: 40} - enabled: false; - lifeSpan: 500; - emitRate: 1 - size: 28 - endSize: 14 - group: "yellow" -} diff --git a/examples/quick/demos/samegame/content/PaintEmitter.qml b/examples/quick/demos/samegame/content/PaintEmitter.qml deleted file mode 100644 index 15b217d6a8..0000000000 --- a/examples/quick/demos/samegame/content/PaintEmitter.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 -import "." - -Emitter { - property Item block: parent - anchors.fill: parent - shape: EllipseShape { fill: true } - group: { - if (block.type == 0){ - "redspots"; - } else if (block.type == 1) { - "bluespots"; - } else if (block.type == 2) { - "greenspots"; - } else { - "yellowspots"; - } - } - size: Settings.blockSize * 2 - endSize: Settings.blockSize/2 - lifeSpan: 30000 - enabled: false - emitRate: 60 - maximumEmitted: 60 - velocity: PointDirection{ y: 4; yVariation: 4 } - /* Possibly better, but dependent on gerrit change,28212 - property real mainIntensity: 0.8 - property real subIntensity: 0.1 - property real colorVariation: 0.005 - onEmitParticles: {//One group, many colors, for better stacking - for (var i=0; i<particles.length; i++) { - var particle = particles[i]; - if (block.type == 0) { - particle.red = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.green = subIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.blue = subIntensity + (Math.random() * colorVariation * 2 - colorVariation); - } else if (block.type == 1) { - particle.red = subIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.green = subIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.blue = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation); - } else if (block.type == 2) { - particle.red = subIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.green = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.blue = subIntensity + (Math.random() * colorVariation * 2 - colorVariation); - } else if (block.type == 3) { - particle.red = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.green = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.blue = subIntensity + (Math.random() * colorVariation * 2 - colorVariation); - } else { - particle.red = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.green = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation); - particle.blue = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation); - } - } - } - */ -} diff --git a/examples/quick/demos/samegame/content/PrimaryPack.qml b/examples/quick/demos/samegame/content/PrimaryPack.qml deleted file mode 100644 index ecb30eb411..0000000000 --- a/examples/quick/demos/samegame/content/PrimaryPack.qml +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Item { - id: container - property ParticleSystem particleSystem - property GameArea gameArea - onGameAreaChanged: bgstacker.parent = gameArea;//Move to direct child of game canvas - Item { - id: bgstacker - z: 0 - ImageParticle { - groups: ["yellowspots"] - color: Qt.darker("yellow");//Actually want desaturated... - system: particleSystem - source: "gfx/particle-paint.png" - colorVariation: 0.2 - alpha: 0.2 - entryEffect: ImageParticle.None - } - ImageParticle { - groups: ["redspots"] - system: particleSystem - color: Qt.darker("red");//Actually want desaturated... - source: "gfx/particle-paint.png" - colorVariation: 0.2 - alpha: 0.2 - entryEffect: ImageParticle.None - } - ImageParticle { - groups: ["greenspots"] - system: particleSystem - color: Qt.darker("green");//Actually want desaturated... - source: "gfx/particle-paint.png" - colorVariation: 0.2 - alpha: 0.2 - entryEffect: ImageParticle.None - } - ImageParticle { - groups: ["bluespots"] - system: particleSystem - color: Qt.darker("blue");//Actually want desaturated... - source: "gfx/particle-paint.png" - colorVariation: 0.2 - alpha: 0.2 - entryEffect: ImageParticle.None - } - } - ImageParticle { - groups: ["yellow"] - system: particleSystem - color: Qt.darker("yellow");//Actually want desaturated... - source: "gfx/particle-brick.png" - colorVariation: 0.4 - alpha: 0.1 - } - ImageParticle { - groups: ["red"] - system: particleSystem - color: Qt.darker("red");//Actually want desaturated... - source: "gfx/particle-brick.png" - colorVariation: 0.4 - alpha: 0.1 - } - ImageParticle { - groups: ["green"] - system: particleSystem - color: Qt.darker("green");//Actually want desaturated... - source: "gfx/particle-brick.png" - colorVariation: 0.4 - alpha: 0.1 - } - ImageParticle { - groups: ["blue"] - system: particleSystem - color: Qt.darker("blue");//Actually want desaturated... - source: "gfx/particle-brick.png" - colorVariation: 0.4 - alpha: 0.1 - } -} diff --git a/examples/quick/demos/samegame/content/PuzzleBlock.qml b/examples/quick/demos/samegame/content/PuzzleBlock.qml deleted file mode 100644 index e91bf48130..0000000000 --- a/examples/quick/demos/samegame/content/PuzzleBlock.qml +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Item { - id: block - property bool dying: false - property bool spawned: false - property int type: 0 - property ParticleSystem particleSystem - - Behavior on x { - enabled: spawned; - NumberAnimation{ easing.type: Easing.OutBounce } - } - Behavior on y { - NumberAnimation{ easing.type: Easing.InQuad } - } - - Image { - id: img - source: { - if (type == 0){ - "gfx/red-puzzle.png"; - } else if (type == 1) { - "gfx/blue-puzzle.png"; - } else if (type == 2) { - "gfx/green-puzzle.png"; - } else { - "gfx/yellow-puzzle.png"; - } - } - opacity: 0 - Behavior on opacity { NumberAnimation { duration: 200 } } - anchors.centerIn: parent - anchors.verticalCenterOffset: -4 - anchors.horizontalCenterOffset: 4 - } - - //Foreground particles - BlockEmitter { - id: particles - system: particleSystem - group: { - if (type == 0){ - "red"; - } else if (type == 1) { - "blue"; - } else if (type == 2) { - "green"; - } else { - "yellow"; - } - } - anchors.fill: parent - } - - states: [ - State { - name: "AliveState"; when: spawned == true && dying == false - PropertyChanges { target: img; opacity: 1 } - }, - - State { - name: "DeathState"; when: dying == true - PropertyChanges { target: img; scale: 2 } - StateChangeScript { script: particles.pulse(200); } - PropertyChanges { target: img; opacity: 0 } - StateChangeScript { script: block.destroy(1000); } - } - ] -} diff --git a/examples/quick/demos/samegame/content/SamegameText.qml b/examples/quick/demos/samegame/content/SamegameText.qml deleted file mode 100644 index 1ff447edc9..0000000000 --- a/examples/quick/demos/samegame/content/SamegameText.qml +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "." - -Text { - font.pixelSize: Settings.fontPixelSize; - color: "white"; - textFormat: Text.StyledText; - Behavior on opacity { NumberAnimation {} } -} diff --git a/examples/quick/demos/samegame/content/Settings.qml b/examples/quick/demos/samegame/content/Settings.qml deleted file mode 100644 index 0de099b9c3..0000000000 --- a/examples/quick/demos/samegame/content/Settings.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 BlackBerry Limited. All rights reserved. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -pragma Singleton -import QtQml 2.0 - -QtObject { - property int screenHeight: 480 - property int screenWidth: 320 - - property int menuDelay: 500 - - property int headerHeight: 20 // 70 on BB10 - property int footerHeight: 44 // 100 on BB10 - - property int fontPixelSize: 14 // 55 on BB10 - - property int blockSize: 32 // 64 on BB10 - - property int toolButtonHeight: 32 // 64 on BB10 - - property int menuButtonSpacing: 0 // 15 on BB10 -} diff --git a/examples/quick/demos/samegame/content/SimpleBlock.qml b/examples/quick/demos/samegame/content/SimpleBlock.qml deleted file mode 100644 index 1f15ce51be..0000000000 --- a/examples/quick/demos/samegame/content/SimpleBlock.qml +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Item { - id: block - property bool dying: false - property bool spawned: false - property int type: 0 - property ParticleSystem particleSystem - - Behavior on x { - enabled: spawned; - SpringAnimation{ spring: 2; damping: 0.2 } - } - Behavior on y { - SpringAnimation{ spring: 2; damping: 0.2 } - } - - Image { - id: img - source: { - if (type == 0){ - "gfx/red.png"; - } else if (type == 1) { - "gfx/blue.png"; - } else if (type == 2) { - "gfx/green.png"; - } else { - "gfx/yellow.png"; - } - } - opacity: 0 - Behavior on opacity { NumberAnimation { duration: 200 } } - anchors.fill: parent - } - - //Foreground particles - BlockEmitter { - id: particles - system: particleSystem - group: { - if (type == 0){ - "red"; - } else if (type == 1) { - "blue"; - } else if (type == 2) { - "green"; - } else { - "yellow"; - } - } - anchors.fill: parent - } - - states: [ - State { - name: "AliveState"; when: spawned == true && dying == false - PropertyChanges { target: img; opacity: 1 } - }, - - State { - name: "DeathState"; when: dying == true - StateChangeScript { script: {particleSystem.paused = false; particles.pulse(100); } } - PropertyChanges { target: img; opacity: 0 } - StateChangeScript { script: block.destroy(1000); } - } - ] -} diff --git a/examples/quick/demos/samegame/content/SmokeText.qml b/examples/quick/demos/samegame/content/SmokeText.qml deleted file mode 100644 index 85ebb14b99..0000000000 --- a/examples/quick/demos/samegame/content/SmokeText.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Item { - z: 10 - property alias source: img.source - property alias system: emitter.system - property int playerNum: 1 - function play() { - anim.running = true; - } - anchors.centerIn: parent - Image { - opacity: 0 - id: img - anchors.centerIn: parent - rotation: playerNum == 1 ? -8 : -5 - Emitter { - id: emitter - group: "smoke" - anchors.fill: parent - shape: MaskShape { source: img.source } - enabled: false - emitRate: 1000 - lifeSpan: 600 - size: 64 - endSize: 32 - velocity: AngleDirection { angleVariation: 360; magnitudeVariation: 160 } - } - } - SequentialAnimation { - id: anim - running: false - PauseAnimation { duration: 500} - ParallelAnimation { - NumberAnimation { target: img; property: "opacity"; from: 0.1; to: 1.0 } - NumberAnimation { target: img; property: "scale"; from: 0.1; to: 1.0 } - } - PauseAnimation { duration: 250} - ScriptAction { script: emitter.pulse(100); } - NumberAnimation { target: img; property: "opacity"; from: 1.0; to: 0.0 } - } -} diff --git a/examples/quick/demos/samegame/content/gfx/background-puzzle.png b/examples/quick/demos/samegame/content/gfx/background-puzzle.png Binary files differdeleted file mode 100644 index c2eca5f5dc..0000000000 --- a/examples/quick/demos/samegame/content/gfx/background-puzzle.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/background.png b/examples/quick/demos/samegame/content/gfx/background.png Binary files differdeleted file mode 100644 index 60f57b650f..0000000000 --- a/examples/quick/demos/samegame/content/gfx/background.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/bar.png b/examples/quick/demos/samegame/content/gfx/bar.png Binary files differdeleted file mode 100644 index 4953cd6221..0000000000 --- a/examples/quick/demos/samegame/content/gfx/bar.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/blue-puzzle.png b/examples/quick/demos/samegame/content/gfx/blue-puzzle.png Binary files differdeleted file mode 100644 index e550d5935b..0000000000 --- a/examples/quick/demos/samegame/content/gfx/blue-puzzle.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/blue.png b/examples/quick/demos/samegame/content/gfx/blue.png Binary files differdeleted file mode 100644 index b8161c0f70..0000000000 --- a/examples/quick/demos/samegame/content/gfx/blue.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/bubble-highscore.png b/examples/quick/demos/samegame/content/gfx/bubble-highscore.png Binary files differdeleted file mode 100644 index c4e38df824..0000000000 --- a/examples/quick/demos/samegame/content/gfx/bubble-highscore.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/bubble-puzzle.png b/examples/quick/demos/samegame/content/gfx/bubble-puzzle.png Binary files differdeleted file mode 100644 index 278556bc8d..0000000000 --- a/examples/quick/demos/samegame/content/gfx/bubble-puzzle.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/but-game-1.png b/examples/quick/demos/samegame/content/gfx/but-game-1.png Binary files differdeleted file mode 100644 index 3343b7ff13..0000000000 --- a/examples/quick/demos/samegame/content/gfx/but-game-1.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/but-game-2.png b/examples/quick/demos/samegame/content/gfx/but-game-2.png Binary files differdeleted file mode 100644 index afba106962..0000000000 --- a/examples/quick/demos/samegame/content/gfx/but-game-2.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/but-game-3.png b/examples/quick/demos/samegame/content/gfx/but-game-3.png Binary files differdeleted file mode 100644 index adea77a687..0000000000 --- a/examples/quick/demos/samegame/content/gfx/but-game-3.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/but-game-4.png b/examples/quick/demos/samegame/content/gfx/but-game-4.png Binary files differdeleted file mode 100644 index 18c922ba45..0000000000 --- a/examples/quick/demos/samegame/content/gfx/but-game-4.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/but-game-new.png b/examples/quick/demos/samegame/content/gfx/but-game-new.png Binary files differdeleted file mode 100644 index 257e182585..0000000000 --- a/examples/quick/demos/samegame/content/gfx/but-game-new.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/but-menu.png b/examples/quick/demos/samegame/content/gfx/but-menu.png Binary files differdeleted file mode 100644 index 8440e87759..0000000000 --- a/examples/quick/demos/samegame/content/gfx/but-menu.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/but-puzzle-next.png b/examples/quick/demos/samegame/content/gfx/but-puzzle-next.png Binary files differdeleted file mode 100644 index 7e3ed417d0..0000000000 --- a/examples/quick/demos/samegame/content/gfx/but-puzzle-next.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/but-quit.png b/examples/quick/demos/samegame/content/gfx/but-quit.png Binary files differdeleted file mode 100644 index 95c77ced94..0000000000 --- a/examples/quick/demos/samegame/content/gfx/but-quit.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/green-puzzle.png b/examples/quick/demos/samegame/content/gfx/green-puzzle.png Binary files differdeleted file mode 100644 index 581f76fd8d..0000000000 --- a/examples/quick/demos/samegame/content/gfx/green-puzzle.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/green.png b/examples/quick/demos/samegame/content/gfx/green.png Binary files differdeleted file mode 100644 index da4cca5e7f..0000000000 --- a/examples/quick/demos/samegame/content/gfx/green.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/icon-fail.png b/examples/quick/demos/samegame/content/gfx/icon-fail.png Binary files differdeleted file mode 100644 index 40726118a9..0000000000 --- a/examples/quick/demos/samegame/content/gfx/icon-fail.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/icon-ok.png b/examples/quick/demos/samegame/content/gfx/icon-ok.png Binary files differdeleted file mode 100644 index 15a8442e94..0000000000 --- a/examples/quick/demos/samegame/content/gfx/icon-ok.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/icon-time.png b/examples/quick/demos/samegame/content/gfx/icon-time.png Binary files differdeleted file mode 100644 index 9490e49e90..0000000000 --- a/examples/quick/demos/samegame/content/gfx/icon-time.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/logo-a.png b/examples/quick/demos/samegame/content/gfx/logo-a.png Binary files differdeleted file mode 100644 index 20c20ba480..0000000000 --- a/examples/quick/demos/samegame/content/gfx/logo-a.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/logo-e.png b/examples/quick/demos/samegame/content/gfx/logo-e.png Binary files differdeleted file mode 100644 index dd663f114a..0000000000 --- a/examples/quick/demos/samegame/content/gfx/logo-e.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/logo-g.png b/examples/quick/demos/samegame/content/gfx/logo-g.png Binary files differdeleted file mode 100644 index a319bf9ffa..0000000000 --- a/examples/quick/demos/samegame/content/gfx/logo-g.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/logo-m.png b/examples/quick/demos/samegame/content/gfx/logo-m.png Binary files differdeleted file mode 100644 index 6a029b3267..0000000000 --- a/examples/quick/demos/samegame/content/gfx/logo-m.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/logo-s.png b/examples/quick/demos/samegame/content/gfx/logo-s.png Binary files differdeleted file mode 100644 index 963b17546a..0000000000 --- a/examples/quick/demos/samegame/content/gfx/logo-s.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/logo.png b/examples/quick/demos/samegame/content/gfx/logo.png Binary files differdeleted file mode 100644 index e900eddb2f..0000000000 --- a/examples/quick/demos/samegame/content/gfx/logo.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/particle-brick.png b/examples/quick/demos/samegame/content/gfx/particle-brick.png Binary files differdeleted file mode 100644 index 5c83896d22..0000000000 --- a/examples/quick/demos/samegame/content/gfx/particle-brick.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/particle-paint.png b/examples/quick/demos/samegame/content/gfx/particle-paint.png Binary files differdeleted file mode 100644 index 9bd0a2a13f..0000000000 --- a/examples/quick/demos/samegame/content/gfx/particle-paint.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/particle-smoke.png b/examples/quick/demos/samegame/content/gfx/particle-smoke.png Binary files differdeleted file mode 100644 index b27f954a79..0000000000 --- a/examples/quick/demos/samegame/content/gfx/particle-smoke.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/red-puzzle.png b/examples/quick/demos/samegame/content/gfx/red-puzzle.png Binary files differdeleted file mode 100644 index 9ceb17e4d0..0000000000 --- a/examples/quick/demos/samegame/content/gfx/red-puzzle.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/red.png b/examples/quick/demos/samegame/content/gfx/red.png Binary files differdeleted file mode 100644 index 681810fe3b..0000000000 --- a/examples/quick/demos/samegame/content/gfx/red.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-highscore-new.png b/examples/quick/demos/samegame/content/gfx/text-highscore-new.png Binary files differdeleted file mode 100644 index 50f7fcd0f6..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-highscore-new.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-highscore.png b/examples/quick/demos/samegame/content/gfx/text-highscore.png Binary files differdeleted file mode 100644 index 7198c277b8..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-highscore.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-no-winner.png b/examples/quick/demos/samegame/content/gfx/text-no-winner.png Binary files differdeleted file mode 100644 index b4a6685111..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-no-winner.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-p1-go.png b/examples/quick/demos/samegame/content/gfx/text-p1-go.png Binary files differdeleted file mode 100644 index c7bd2a5e75..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-p1-go.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-p1-won.png b/examples/quick/demos/samegame/content/gfx/text-p1-won.png Binary files differdeleted file mode 100644 index 41c2eb7c98..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-p1-won.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-p1.png b/examples/quick/demos/samegame/content/gfx/text-p1.png Binary files differdeleted file mode 100644 index b59c87b977..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-p1.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-p2-go.png b/examples/quick/demos/samegame/content/gfx/text-p2-go.png Binary files differdeleted file mode 100644 index f03cd93afa..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-p2-go.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-p2-won.png b/examples/quick/demos/samegame/content/gfx/text-p2-won.png Binary files differdeleted file mode 100644 index 116b7f2e7a..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-p2-won.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/text-p2.png b/examples/quick/demos/samegame/content/gfx/text-p2.png Binary files differdeleted file mode 100644 index d4f2bc7335..0000000000 --- a/examples/quick/demos/samegame/content/gfx/text-p2.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/yellow-puzzle.png b/examples/quick/demos/samegame/content/gfx/yellow-puzzle.png Binary files differdeleted file mode 100644 index 66044c81b4..0000000000 --- a/examples/quick/demos/samegame/content/gfx/yellow-puzzle.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/gfx/yellow.png b/examples/quick/demos/samegame/content/gfx/yellow.png Binary files differdeleted file mode 100644 index 6bc5d385e3..0000000000 --- a/examples/quick/demos/samegame/content/gfx/yellow.png +++ /dev/null diff --git a/examples/quick/demos/samegame/content/levels/TemplateBase.qml b/examples/quick/demos/samegame/content/levels/TemplateBase.qml deleted file mode 100644 index 85f8b64703..0000000000 --- a/examples/quick/demos/samegame/content/levels/TemplateBase.qml +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle{ - id: control - property int scoreTarget: -1 - property int timeTarget: -1 - property int moveTarget: -1 - property bool mustClear: true - property string goalText: "Clear the level..." - - property var startingGrid //If this isn't an array of ints, we will refuse to load the level. - /* Ints are 0-4. If not enough ints are there it will be prepadded with 0s to fill the grid - (which ruins everything if you have the wrong number of rows). - 0 - No block - 1 - Red - 2 - Blue - 3 - Green - 4 - Yellow - Ideas for future colors, but not supported in this version: - 5 - Purple - 6 - Cyan - 7 - Gray - 8 - Black - 9 - White - */ - - width: 320 - height: 416 - color: "white" //TODO: Theme support for both setting themes per level, and seeing it in the control! -} diff --git a/examples/quick/demos/samegame/content/levels/level0.qml b/examples/quick/demos/samegame/content/levels/level0.qml deleted file mode 100644 index a3cc06d548..0000000000 --- a/examples/quick/demos/samegame/content/levels/level0.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - moveTarget: 3 - goalText: "1 of 10<br><br>Clear in three moves..." - startingGrid: [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , - 0 , 0 , 0 , 0 , 0 , 1 , 1 , 2 , 1 , 1 , - 0 , 0 , 0 , 1 , 1 , 3 , 3 , 3 , 3 , 3 , - 0 , 1 , 1 , 3 , 3 , 3 , 1 , 3 , 1 , 1 , - 1 , 2 , 3 , 3 , 1 , 1 , 3 , 3 , 3 , 3 , - 1 , 3 , 3 , 2 , 3 , 3 , 3 , 3 , 1 , 1 , - 1 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level1.qml b/examples/quick/demos/samegame/content/levels/level1.qml deleted file mode 100644 index b9457aec4b..0000000000 --- a/examples/quick/demos/samegame/content/levels/level1.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - timeTarget: 10 - goalText: "2 of 10<br><br>Clear in 10 seconds..." - startingGrid: [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 1 , 3 , 3 , 3 , 1 , 1 , 1 , 1 , 2 , 2 , - 1 , 2 , 3 , 3 , 3 , 1 , 1 , 1 , 1 , 2 , - 2 , 2 , 1 , 3 , 3 , 3 , 1 , 1 , 1 , 2 , - 2 , 1 , 1 , 1 , 3 , 3 , 3 , 1 , 2 , 2 , - 1 , 1 , 1 , 1 , 1 , 3 , 3 , 3 , 2 , 1 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level2.qml b/examples/quick/demos/samegame/content/levels/level2.qml deleted file mode 100644 index d7863ad286..0000000000 --- a/examples/quick/demos/samegame/content/levels/level2.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - scoreTarget: 1200 - timeTarget: 60 - goalText: "3 of 10<br><br>Score over 1200 points in one minute..." - mustClear: false - startingGrid: [ 3 , 1 , 2 , 1 , 1 , 2 , 1 , 1 , 3 , 3 , - 1 , 3 , 3 , 2 , 3 , 3 , 1 , 1 , 3 , 1 , - 3 , 1 , 3 , 3 , 2 , 3 , 3 , 3 , 1 , 2 , - 3 , 2 , 2 , 1 , 3 , 3 , 2 , 1 , 1 , 2 , - 3 , 1 , 2 , 2 , 2 , 2 , 2 , 1 , 3 , 1 , - 2 , 3 , 1 , 2 , 2 , 3 , 3 , 1 , 3 , 2 , - 3 , 2 , 1 , 1 , 3 , 3 , 3 , 2 , 2 , 1 , - 1 , 2 , 2 , 3 , 2 , 3 , 3 , 3 , 1 , 1 , - 1 , 3 , 3 , 3 , 1 , 2 , 2 , 3 , 3 , 1 , - 3 , 3 , 2 , 1 , 2 , 2 , 1 , 1 , 1 , 3 , - 2 , 1 , 3 , 2 , 3 , 2 , 3 , 2 , 2 , 1 , - 1 , 3 , 1 , 2 , 1 , 2 , 3 , 1 , 2 , 2 , - 1 , 2 , 2 , 2 , 1 , 1 , 2 , 3 , 1 , 2 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level3.qml b/examples/quick/demos/samegame/content/levels/level3.qml deleted file mode 100644 index e9b9b15190..0000000000 --- a/examples/quick/demos/samegame/content/levels/level3.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - scoreTarget: 3000 - timeTarget: 60 - goalText: "4 of 10<br>Clear the board with over 3000 points in under a minute..." - startingGrid: [ 3 , 3 , 1 , 1 , 1 , 2 , 2 , 4 , 3 , 3 , - 4 , 3 , 1 , 4 , 2 , 2 , 2 , 4 , 3 , 4 , - 4 , 3 , 3 , 4 , 1 , 1 , 3 , 3 , 4 , 4 , - 3 , 3 , 3 , 3 , 3 , 1 , 3 , 2 , 2 , 4 , - 4 , 4 , 3 , 4 , 3 , 1 , 4 , 4 , 4 , 4 , - 4 , 4 , 3 , 4 , 1 , 1 , 4 , 4 , 3 , 3 , - 4 , 2 , 2 , 2 , 2 , 2 , 4 , 4 , 4 , 1 , - 4 , 4 , 2 , 4 , 2 , 2 , 1 , 1 , 1 , 1 , - 4 , 4 , 2 , 4 , 2 , 2 , 1 , 4 , 4 , 1 , - 4 , 1 , 1 , 4 , 3 , 3 , 4 , 2 , 4 , 1 , - 4 , 1 , 1 , 2 , 3 , 3 , 4 , 2 , 2 , 1 , - 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 2 , 1 , - 4 , 1 , 1 , 2 , 2 , 3 , 4 , 3 , 4 , 4 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level4.qml b/examples/quick/demos/samegame/content/levels/level4.qml deleted file mode 100644 index 00e1d3703f..0000000000 --- a/examples/quick/demos/samegame/content/levels/level4.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - goalText: "5 of 10<br><br>Clear the level..." - startingGrid: [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 1 , 3 , 2 , 1 , 1 , 1 , 1 , 3 , 2 , 3 , - 1 , 2 , 3 , 1 , 3 , 2 , 2 , 1 , 1 , 2 , - 3 , 2 , 2 , 2 , 1 , 1 , 1 , 1 , 3 , 3 , - 2 , 1 , 1 , 3 , 2 , 1 , 1 , 2 , 1 , 3 , - 1 , 3 , 3 , 1 , 2 , 1 , 2 , 1 , 3 , 3 , - 1 , 3 , 2 , 2 , 2 , 1 , 1 , 3 , 2 , 3 , - 1 , 1 , 3 , 2 , 3 , 3 , 2 , 1 , 1 , 1 , - 1 , 2 , 2 , 3 , 2 , 2 , 1 , 3 , 1 , 3 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level5.qml b/examples/quick/demos/samegame/content/levels/level5.qml deleted file mode 100644 index 0be3c9d15d..0000000000 --- a/examples/quick/demos/samegame/content/levels/level5.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - moveTarget: 4 - goalText: "6 of 10<br><br>Clear in four or less moves..." - startingGrid: [ 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , - 4 , 2 , 2 , 2 , 4 , 3 , 3 , 3 , 4 , 4 , - 4 , 2 , 4 , 4 , 4 , 3 , 2 , 3 , 4 , 4 , - 4 , 2 , 2 , 2 , 4 , 3 , 3 , 3 , 4 , 4 , - 4 , 4 , 4 , 2 , 4 , 3 , 4 , 3 , 4 , 4 , - 4 , 2 , 2 , 2 , 4 , 3 , 4 , 3 , 4 , 4 , - 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , - 4 , 3 , 4 , 3 , 4 , 2 , 2 , 2 , 4 , 3 , - 4 , 3 , 3 , 3 , 4 , 2 , 4 , 4 , 4 , 3 , - 4 , 3 , 3 , 3 , 4 , 2 , 2 , 2 , 4 , 3 , - 4 , 3 , 4 , 3 , 4 , 2 , 4 , 4 , 4 , 4 , - 4 , 3 , 4 , 3 , 4 , 2 , 2 , 2 , 4 , 3 , - 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level6.qml b/examples/quick/demos/samegame/content/levels/level6.qml deleted file mode 100644 index e4964678e3..0000000000 --- a/examples/quick/demos/samegame/content/levels/level6.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - moveTarget: 20 - timeTarget: 40 - goalText: "7 of 10<br><br>Clear with 20 moves in 40 seconds (or better)." - startingGrid: [ 1 , 3 , 1 , 1 , 1 , 1 , 2 , 1 , 2 , 2 , - 2 , 1 , 2 , 3 , 3 , 1 , 3 , 1 , 1 , 3 , - 3 , 1 , 1 , 1 , 2 , 2 , 3 , 2 , 3 , 1 , - 1 , 3 , 1 , 1 , 3 , 1 , 1 , 1 , 2 , 3 , - 2 , 1 , 1 , 1 , 3 , 2 , 3 , 3 , 2 , 3 , - 3 , 3 , 3 , 3 , 2 , 2 , 3 , 1 , 3 , 2 , - 2 , 2 , 3 , 2 , 2 , 3 , 2 , 2 , 2 , 2 , - 1 , 2 , 1 , 2 , 1 , 3 , 2 , 3 , 2 , 3 , - 1 , 1 , 2 , 3 , 3 , 3 , 3 , 1 , 1 , 2 , - 3 , 3 , 2 , 2 , 2 , 2 , 3 , 1 , 3 , 1 , - 1 , 2 , 3 , 3 , 3 , 1 , 3 , 2 , 1 , 2 , - 1 , 2 , 1 , 1 , 2 , 3 , 1 , 2 , 1 , 3 , - 3 , 1 , 2 , 2 , 1 , 3 , 3 , 1 , 3 , 2 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level7.qml b/examples/quick/demos/samegame/content/levels/level7.qml deleted file mode 100644 index bf190577d6..0000000000 --- a/examples/quick/demos/samegame/content/levels/level7.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - goalText: "8 of 10<br><br>Clear the grid." - startingGrid: [ 2 , 4 , 3 , 2 , 3 , 2 , 3 , 3 , 4 , 3 , - 2 , 2 , 3 , 3 , 1 , 4 , 3 , 3 , 3 , 2 , - 1 , 4 , 2 , 3 , 4 , 3 , 3 , 1 , 1 , 1 , - 2 , 1 , 2 , 4 , 4 , 2 , 2 , 3 , 2 , 1 , - 3 , 4 , 4 , 1 , 3 , 2 , 4 , 2 , 1 , 1 , - 2 , 2 , 3 , 1 , 2 , 4 , 1 , 2 , 1 , 2 , - 1 , 2 , 3 , 2 , 4 , 4 , 3 , 1 , 1 , 2 , - 4 , 4 , 2 , 1 , 2 , 4 , 2 , 2 , 4 , 3 , - 4 , 2 , 4 , 1 , 3 , 4 , 1 , 4 , 2 , 4 , - 4 , 3 , 4 , 1 , 4 , 3 , 1 , 3 , 1 , 1 , - 3 , 3 , 2 , 3 , 2 , 4 , 1 , 2 , 4 , 4 , - 3 , 4 , 2 , 2 , 4 , 3 , 4 , 1 , 3 , 2 , - 4 , 3 , 3 , 4 , 2 , 4 , 1 , 2 , 3 , 2 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level8.qml b/examples/quick/demos/samegame/content/levels/level8.qml deleted file mode 100644 index 45163e08b7..0000000000 --- a/examples/quick/demos/samegame/content/levels/level8.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - scoreTarget: 1000 - goalText: "9 of 10<br><br>Score over 1000 points" - startingGrid: [ 1 , 4 , 4 , 3 , 2 , 1 , 4 , 2 , 4 , 2 , - 2 , 3 , 4 , 4 , 1 , 1 , 1 , 4 , 4 , 4 , - 1 , 3 , 1 , 2 , 2 , 1 , 2 , 1 , 4 , 2 , - 4 , 3 , 4 , 2 , 1 , 4 , 1 , 2 , 2 , 3 , - 3 , 4 , 2 , 4 , 4 , 3 , 2 , 2 , 2 , 1 , - 4 , 4 , 3 , 2 , 4 , 4 , 2 , 1 , 1 , 1 , - 1 , 2 , 1 , 3 , 4 , 1 , 1 , 3 , 2 , 3 , - 3 , 4 , 2 , 2 , 1 , 3 , 2 , 2 , 4 , 2 , - 2 , 4 , 1 , 2 , 2 , 4 , 3 , 3 , 3 , 1 , - 1 , 2 , 2 , 4 , 1 , 2 , 2 , 3 , 3 , 3 , - 4 , 4 , 1 , 4 , 3 , 1 , 3 , 3 , 3 , 4 , - 1 , 2 , 4 , 1 , 2 , 1 , 1 , 4 , 2 , 1 , - 1 , 2 , 3 , 4 , 2 , 4 , 4 , 2 , 1 , 3 ] -} diff --git a/examples/quick/demos/samegame/content/levels/level9.qml b/examples/quick/demos/samegame/content/levels/level9.qml deleted file mode 100644 index 2498ca9abc..0000000000 --- a/examples/quick/demos/samegame/content/levels/level9.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -TemplateBase{ - scoreTarget: 2000 - timeTarget: 60 - moveTarget: 20 - mustClear: false - goalText: "10 of 10<br><br>Score 2000 in one minute with less than 20 moves!" - startingGrid: [ 3 , 2 , 3 , 1 , 3 , 3 , 4 , 1 , 3 , 3 , - 2 , 3 , 2 , 1 , 1 , 2 , 2 , 2 , 4 , 1 , - 2 , 4 , 4 , 4 , 3 , 1 , 4 , 4 , 4 , 1 , - 3 , 1 , 3 , 4 , 4 , 2 , 2 , 2 , 2 , 3 , - 2 , 1 , 4 , 4 , 3 , 3 , 1 , 1 , 3 , 2 , - 3 , 2 , 1 , 4 , 3 , 4 , 1 , 3 , 4 , 2 , - 3 , 3 , 1 , 4 , 4 , 4 , 2 , 1 , 2 , 3 , - 2 , 3 , 4 , 3 , 4 , 1 , 1 , 3 , 2 , 4 , - 4 , 4 , 1 , 2 , 4 , 3 , 2 , 2 , 2 , 4 , - 1 , 4 , 2 , 2 , 1 , 1 , 2 , 1 , 1 , 4 , - 1 , 4 , 3 , 3 , 3 , 1 , 3 , 4 , 4 , 2 , - 3 , 4 , 1 , 1 , 2 , 2 , 2 , 3 , 2 , 1 , - 3 , 3 , 4 , 3 , 1 , 1 , 1 , 4 , 4 , 3 ] -} diff --git a/examples/quick/demos/samegame/content/qmldir b/examples/quick/demos/samegame/content/qmldir deleted file mode 100644 index 3b552ec1f1..0000000000 --- a/examples/quick/demos/samegame/content/qmldir +++ /dev/null @@ -1,13 +0,0 @@ -singleton Settings 1.0 Settings.qml -Block 1.0 Block.qml -BlockEmitter 1.0 BlockEmitter.qml -Button 1.0 Button.qml -GameArea 1.0 GameArea.qml -LogoAnimation 1.0 LogoAnimation.qml -MenuEmitter 1.0 MenuEmitter.qml -PaintEmitter 1.0 PaintEmitter.qml -PrimaryPack 1.0 PrimaryPack.qml -PuzzleBlock 1.0 PuzzleBlock.qml -SamegameText 1.0 SamegameText.qml -SimpleBlock 1.0 SimpleBlock.qml -SmokeText 1.0 SmokeText.qml diff --git a/examples/quick/demos/samegame/content/samegame.js b/examples/quick/demos/samegame/content/samegame.js deleted file mode 100644 index 8f32fb9007..0000000000 --- a/examples/quick/demos/samegame/content/samegame.js +++ /dev/null @@ -1,580 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* This script file handles the game logic */ -.pragma library -.import QtQuick.LocalStorage 2.0 as Sql - -var maxColumn = 10; -var maxRow = 13; -var types = 3; -var maxIndex = maxColumn*maxRow; -var board = new Array(maxIndex); -var blockSrc = "Block.qml"; -var gameDuration; -var component = Qt.createComponent(blockSrc); -var gameCanvas; -var betweenTurns = false; - -var puzzleLevel = null; -var puzzlePath = ""; - -var gameMode = "arcade"; //Set in new game, then tweaks behaviour of other functions -var gameOver = false; - -function changeBlock(src) -{ - blockSrc = src; - component = Qt.createComponent(blockSrc); -} - -// Index function used instead of a 2D array -function index(column, row) -{ - return column + row * maxColumn; -} - -function timeStr(msecs) -{ - var secs = Math.floor(msecs/1000); - var m = Math.floor(secs/60); - var ret = "" + m + "m " + (secs%60) + "s"; - return ret; -} - -function cleanUp() -{ - if (gameCanvas == undefined) - return; - // Delete blocks from previous game - for (var i = 0; i < maxIndex; i++) { - if (board[i] != null) - board[i].destroy(); - board[i] = null; - } - if (puzzleLevel != null){ - puzzleLevel.destroy(); - puzzleLevel = null; - } - gameCanvas.mode = "" -} - -function startNewGame(gc, mode, map) -{ - gameCanvas = gc; - if (mode == undefined) - gameMode = "arcade"; - else - gameMode = mode; - gameOver = false; - - cleanUp(); - - gc.gameOver = false; - gc.mode = gameMode; - // Calculate board size - maxColumn = Math.floor(gameCanvas.width/gameCanvas.blockSize); - maxRow = Math.floor(gameCanvas.height/gameCanvas.blockSize); - maxIndex = maxRow * maxColumn; - if (gameMode == "arcade") //Needs to be after board sizing - getHighScore(); - - - // Initialize Board - board = new Array(maxIndex); - gameCanvas.score = 0; - gameCanvas.score2 = 0; - gameCanvas.moves = 0; - gameCanvas.curTurn = 1; - if (gameMode == "puzzle") - loadMap(map); - else//Note that we load them in reverse order for correct visual stacking - for (var column = maxColumn - 1; column >= 0; column--) - for (var row = maxRow - 1; row >= 0; row--) - createBlock(column, row); - if (gameMode == "puzzle") - getLevelHistory();//Needs to be after map load - gameDuration = new Date(); -} - -var fillFound; // Set after a floodFill call to the number of blocks found -var floodBoard; // Set to 1 if the floodFill reaches off that node - -// NOTE: Be careful with vars named x,y, as the calling object's x,y are still in scope -function handleClick(x,y) -{ - if (betweenTurns || gameOver || gameCanvas == undefined) - return; - var column = Math.floor(x/gameCanvas.blockSize); - var row = Math.floor(y/gameCanvas.blockSize); - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return; - if (board[index(column, row)] == null) - return; - // If it's a valid block, remove it and all connected (does nothing if it's not connected) - floodFill(column,row, -1); - if (fillFound <= 0) - return; - if (gameMode == "multiplayer" && gameCanvas.curTurn == 2) - gameCanvas.score2 += (fillFound - 1) * (fillFound - 1); - else - gameCanvas.score += (fillFound - 1) * (fillFound - 1); - if (gameMode == "multiplayer" && gameCanvas.curTurn == 2) - shuffleUp(); - else - shuffleDown(); - gameCanvas.moves += 1; - if (gameMode == "endless") - refill(); - else if (gameMode != "multiplayer") - victoryCheck(); - if (gameMode == "multiplayer" && !gc.gameOver){ - betweenTurns = true; - gameCanvas.swapPlayers();//signal, animate and call turnChange() when ready - } -} - -function floodFill(column,row,type) -{ - if (board[index(column, row)] == null) - return; - var first = false; - if (type == -1) { - first = true; - type = board[index(column,row)].type; - - // Flood fill initialization - fillFound = 0; - floodBoard = new Array(maxIndex); - } - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return; - if (floodBoard[index(column, row)] == 1 || (!first && type != board[index(column, row)].type)) - return; - floodBoard[index(column, row)] = 1; - floodFill(column + 1, row, type); - floodFill(column - 1, row, type); - floodFill(column, row + 1, type); - floodFill(column, row - 1, type); - if (first == true && fillFound == 0) - return; // Can't remove single blocks - board[index(column, row)].dying = true; - board[index(column, row)] = null; - fillFound += 1; -} - -function shuffleDown() -{ - // Fall down - for (var column = 0; column < maxColumn; column++) { - var fallDist = 0; - for (var row = maxRow - 1; row >= 0; row--) { - if (board[index(column,row)] == null) { - fallDist += 1; - } else { - if (fallDist > 0) { - var obj = board[index(column, row)]; - obj.y = (row + fallDist) * gameCanvas.blockSize; - board[index(column, row + fallDist)] = obj; - board[index(column, row)] = null; - } - } - } - } - // Fall to the left - fallDist = 0; - for (column = 0; column < maxColumn; column++) { - if (board[index(column, maxRow - 1)] == null) { - fallDist += 1; - } else { - if (fallDist > 0) { - for (row = 0; row < maxRow; row++) { - obj = board[index(column, row)]; - if (obj == null) - continue; - obj.x = (column - fallDist) * gameCanvas.blockSize; - board[index(column - fallDist,row)] = obj; - board[index(column, row)] = null; - } - } - } - } -} - - -function shuffleUp() -{ - // Fall up - for (var column = 0; column < maxColumn; column++) { - var fallDist = 0; - for (var row = 0; row < maxRow; row++) { - if (board[index(column,row)] == null) { - fallDist += 1; - } else { - if (fallDist > 0) { - var obj = board[index(column, row)]; - obj.y = (row - fallDist) * gameCanvas.blockSize; - board[index(column, row - fallDist)] = obj; - board[index(column, row)] = null; - } - } - } - } - // Fall to the left (or should it be right, so as to be left for P2?) - fallDist = 0; - for (column = 0; column < maxColumn; column++) { - if (board[index(column, 0)] == null) { - fallDist += 1; - } else { - if (fallDist > 0) { - for (row = 0; row < maxRow; row++) { - obj = board[index(column, row)]; - if (obj == null) - continue; - obj.x = (column - fallDist) * gameCanvas.blockSize; - board[index(column - fallDist,row)] = obj; - board[index(column, row)] = null; - } - } - } - } -} - -function turnChange()//called by ui outside -{ - betweenTurns = false; - if (gameCanvas.curTurn == 1){ - shuffleUp(); - gameCanvas.curTurn = 2; - victoryCheck(); - }else{ - shuffleDown(); - gameCanvas.curTurn = 1; - victoryCheck(); - } -} - -function refill() -{ - for (var column = 0; column < maxColumn; column++) { - for (var row = 0; row < maxRow; row++) { - if (board[index(column, row)] == null) - createBlock(column, row); - } - } -} - -function victoryCheck() -{ - // Awards bonuses for no blocks left - var deservesBonus = true; - if (board[index(0,maxRow - 1)] != null || board[index(0,0)] != null) - deservesBonus = false; - // Checks for game over - if (deservesBonus){ - if (gameCanvas.curTurn = 1) - gameCanvas.score += 1000; - else - gameCanvas.score2 += 1000; - } - gameOver = deservesBonus; - if (gameCanvas.curTurn == 1){ - if (!(floodMoveCheck(0, maxRow - 1, -1))) - gameOver = true; - }else{ - if (!(floodMoveCheck(0, 0, -1, true))) - gameOver = true; - } - if (gameMode == "puzzle"){ - puzzleVictoryCheck(deservesBonus);//Takes it from here - return; - } - if (gameOver) { - var winnerScore = Math.max(gameCanvas.score, gameCanvas.score2); - if (gameMode == "multiplayer"){ - gameCanvas.score = winnerScore; - saveHighScore(gameCanvas.score2); - } - saveHighScore(gameCanvas.score); - gameDuration = new Date() - gameDuration; - gameCanvas.gameOver = true; - } -} - -// Only floods up and right, to see if it can find adjacent same-typed blocks -function floodMoveCheck(column, row, type, goDownInstead) -{ - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return false; - if (board[index(column, row)] == null) - return false; - var myType = board[index(column, row)].type; - if (type == myType) - return true; - if (goDownInstead) - return floodMoveCheck(column + 1, row, myType, goDownInstead) || - floodMoveCheck(column, row + 1, myType, goDownInstead); - else - return floodMoveCheck(column + 1, row, myType) || - floodMoveCheck(column, row - 1, myType); -} - -function createBlock(column,row,type) -{ - // Note that we don't wait for the component to become ready. This will - // only work if the block QML is a local file. Otherwise the component will - // not be ready immediately. There is a statusChanged signal on the - // component you could use if you want to wait to load remote files. - if (component.status == 1){ - if (type == undefined) - type = Math.floor(Math.random() * types); - if (type < 0 || type > 4) { - console.log("Invalid type requested");//TODO: Is this triggered by custom levels much? - return; - } - var dynamicObject = component.createObject(gameCanvas, - {"type": type, - "x": column*gameCanvas.blockSize, - "y": -1*gameCanvas.blockSize, - "width": gameCanvas.blockSize, - "height": gameCanvas.blockSize, - "particleSystem": gameCanvas.ps}); - if (dynamicObject == null){ - console.log("error creating block"); - console.log(component.errorString()); - return false; - } - dynamicObject.y = row*gameCanvas.blockSize; - dynamicObject.spawned = true; - - board[index(column,row)] = dynamicObject; - }else{ - console.log("error loading block component"); - console.log(component.errorString()); - return false; - } - return true; -} - -function showPuzzleError(str) -{ - //TODO: Nice user visible UI? - console.log(str); -} - -function loadMap(map) -{ - puzzlePath = map; - var levelComp = Qt.createComponent(puzzlePath); - if (levelComp.status != 1){ - console.log("Error loading level"); - showPuzzleError(levelComp.errorString()); - return; - } - puzzleLevel = levelComp.createObject(); - if (puzzleLevel == null || !puzzleLevel.startingGrid instanceof Array) { - showPuzzleError("Bugger!"); - return; - } - gameCanvas.showPuzzleGoal(puzzleLevel.goalText); - //showPuzzleGoal should call finishLoadingMap as the next thing it does, before handling more events -} - -function finishLoadingMap() -{ - for (var i in puzzleLevel.startingGrid) - if (! (puzzleLevel.startingGrid[i] >= 0 && puzzleLevel.startingGrid[i] <= 9) ) - puzzleLevel.startingGrid[i] = 0; - //TODO: Don't allow loading larger levels, leads to cheating - while (puzzleLevel.startingGrid.length > maxIndex) puzzleLevel.startingGrid.shift(); - while (puzzleLevel.startingGrid.length < maxIndex) puzzleLevel.startingGrid.unshift(0); - for (var i in puzzleLevel.startingGrid) - if (puzzleLevel.startingGrid[i] > 0) - createBlock(i % maxColumn, Math.floor(i / maxColumn), puzzleLevel.startingGrid[i] - 1); - - //### Experimental feature - allow levels to contain arbitrary QML scenes as well! - //while (puzzleLevel.children.length) - // puzzleLevel.children[0].parent = gameCanvas; - gameDuration = new Date(); //Don't start until we finish loading -} - -function puzzleVictoryCheck(clearedAll)//gameOver has also been set if no more moves -{ - var won = true; - var soFar = new Date() - gameDuration; - if (puzzleLevel.scoreTarget != -1 && gameCanvas.score < puzzleLevel.scoreTarget){ - won = false; - } if (puzzleLevel.scoreTarget != -1 && gameCanvas.score >= puzzleLevel.scoreTarget && !puzzleLevel.mustClear){ - gameOver = true; - } if (puzzleLevel.timeTarget != -1 && soFar/1000.0 > puzzleLevel.timeTarget){ - gameOver = true; - } if (puzzleLevel.moveTarget != -1 && gameCanvas.moves >= puzzleLevel.moveTarget){ - gameOver = true; - } if (puzzleLevel.mustClear && gameOver && !clearedAll) { - won = false; - } - - if (gameOver) { - gameCanvas.gameOver = true; - gameCanvas.showPuzzleEnd(won); - - if (won) { - // Store progress - saveLevelHistory(); - } - } -} - -function getHighScore() -{ - var db = Sql.LocalStorage.openDatabaseSync( - "SameGame", - "2.0", - "SameGame Local Data", - 100 - ); - db.transaction( - function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(game TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); - // Only show results for the current grid size - var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "' - + maxColumn + "x" + maxRow + '" AND game = "' + gameMode + '" ORDER BY score desc'); - if (rs.rows.length > 0) - gameCanvas.highScore = rs.rows.item(0).score; - else - gameCanvas.highScore = 0; - } - ); -} - -function saveHighScore(score) -{ - // Offline storage - var db = Sql.LocalStorage.openDatabaseSync( - "SameGame", - "2.0", - "SameGame Local Data", - 100 - ); - var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)"; - var data = [ - gameMode, - score, - maxColumn + "x" + maxRow, - Math.floor(gameDuration / 1000) - ]; - if (score >= gameCanvas.highScore)//Update UI field - gameCanvas.highScore = score; - - db.transaction( - function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(game TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); - tx.executeSql(dataStr, data); - } - ); -} - -function getLevelHistory() -{ - var db = Sql.LocalStorage.openDatabaseSync( - "SameGame", - "2.0", - "SameGame Local Data", - 100 - ); - db.transaction( - function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Puzzle(level TEXT, score NUMBER, moves NUMBER, time NUMBER)'); - var rs = tx.executeSql('SELECT * FROM Puzzle WHERE level = "' + puzzlePath + '" ORDER BY score desc'); - if (rs.rows.length > 0) { - gameCanvas.puzzleWon = true; - gameCanvas.highScore = rs.rows.item(0).score; - } else { - gameCanvas.puzzleWon = false; - gameCanvas.highScore = 0; - } - } - ); -} - -function saveLevelHistory() -{ - var db = Sql.LocalStorage.openDatabaseSync( - "SameGame", - "2.0", - "SameGame Local Data", - 100 - ); - var dataStr = "INSERT INTO Puzzle VALUES(?, ?, ?, ?)"; - var data = [ - puzzlePath, - gameCanvas.score, - gameCanvas.moves, - Math.floor(gameDuration / 1000) - ]; - gameCanvas.puzzleWon = true; - - db.transaction( - function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Puzzle(level TEXT, score NUMBER, moves NUMBER, time NUMBER)'); - tx.executeSql(dataStr, data); - } - ); -} - -function nuke() //For "Debug mode" -{ - for (var row = 1; row <= 5; row++) { - for (var col = 0; col < 5; col++) { - if (board[index(col, maxRow - row)] != null) { - board[index(col, maxRow - row)].dying = true; - board[index(col, maxRow - row)] = null; - } - } - } - if (gameMode == "multiplayer" && gameCanvas.curTurn == 2) - shuffleUp(); - else - shuffleDown(); - if (gameMode == "endless") - refill(); - else - victoryCheck(); -} diff --git a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png Binary files differdeleted file mode 100644 index cce9f11017..0000000000 --- a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png +++ /dev/null diff --git a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png Binary files differdeleted file mode 100644 index ca9e8368b1..0000000000 --- a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png +++ /dev/null diff --git a/examples/quick/demos/samegame/main.cpp b/examples/quick/demos/samegame/main.cpp deleted file mode 100644 index c6b01f491a..0000000000 --- a/examples/quick/demos/samegame/main.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(demos/samegame/samegame) diff --git a/examples/quick/demos/samegame/samegame.pro b/examples/quick/demos/samegame/samegame.pro deleted file mode 100644 index 7b680490ad..0000000000 --- a/examples/quick/demos/samegame/samegame.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = app - -QT += qml quick sql -SOURCES += main.cpp -RESOURCES += samegame.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/samegame -INSTALLS += target diff --git a/examples/quick/demos/samegame/samegame.qml b/examples/quick/demos/samegame/samegame.qml deleted file mode 100644 index 63e4083a8b..0000000000 --- a/examples/quick/demos/samegame/samegame.qml +++ /dev/null @@ -1,372 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 -import "content/samegame.js" as Logic -import "content" - -Rectangle { - id: root - width: Settings.screenWidth; height: Settings.screenHeight - property int acc: 0 - - - function loadPuzzle() { - if (gameCanvas.mode != "") - Logic.cleanUp(); - Logic.startNewGame(gameCanvas,"puzzle","levels/level"+acc+".qml") - } - function nextPuzzle() { - acc = (acc + 1) % 10; - loadPuzzle(); - } - Timer { - id: gameOverTimer - interval: 1500 - running : gameCanvas.gameOver && gameCanvas.mode == "puzzle" //mode will be reset by cleanUp(); - repeat : false - onTriggered: { - Logic.cleanUp(); - nextPuzzle(); - } - } - - Image { - source: "content/gfx/background.png" - anchors.fill: parent - } - - GameArea { - id: gameCanvas - z: 1 - y: Settings.headerHeight - - width: parent.width - height: parent.height - Settings.headerHeight - Settings.footerHeight - - backgroundVisible: root.state == "in-game" - onModeChanged: if (gameCanvas.mode != "puzzle") puzzleWon = false; //UI has stricter constraints on this variable than the game does - Age { - groups: ["redspots", "greenspots", "bluespots", "yellowspots"] - enabled: root.state == "" - system: gameCanvas.ps - } - - onPuzzleLost: acc--;//So that nextPuzzle() reloads the current one - - } - - Item { - id: menu - z: 2 - width: parent.width; - anchors.top: parent.top - anchors.bottom: bottomBar.top - - LogoAnimation { - x: 64 - y: Settings.headerHeight - particleSystem: gameCanvas.ps - running: root.state == "" - } - Row { - x: 112 - y: 20 - Image { source: "content/gfx/logo-a.png" } - Image { source: "content/gfx/logo-m.png" } - Image { source: "content/gfx/logo-e.png" } - } - - Column { - y: 100 + 40 - spacing: Settings.menuButtonSpacing - width: parent.width - height: parent.height - (140 + Settings.footerHeight) - - Button { - width: root.width - rotatedButton: true - imgSrc: "content/gfx/but-game-1.png" - onClicked: { - if (root.state == "in-game") - return //Prevent double clicking - root.state = "in-game" - gameCanvas.blockFile = "Block.qml" - gameCanvas.background = "gfx/background.png" - arcadeTimer.start(); - } - //Emitted particles don't fade out, because ImageParticle is on the GameArea - system: gameCanvas.ps - group: "green" - Timer { - id: arcadeTimer - interval: Settings.menuDelay - running : false - repeat : false - onTriggered: Logic.startNewGame(gameCanvas) - } - } - - Button { - width: root.width - rotatedButton: true - imgSrc: "content/gfx/but-game-2.png" - onClicked: { - if (root.state == "in-game") - return - root.state = "in-game" - gameCanvas.blockFile = "Block.qml" - gameCanvas.background = "gfx/background.png" - twopTimer.start(); - } - system: gameCanvas.ps - group: "green" - Timer { - id: twopTimer - interval: Settings.menuDelay - running : false - repeat : false - onTriggered: Logic.startNewGame(gameCanvas, "multiplayer") - } - } - - Button { - width: root.width - rotatedButton: true - imgSrc: "content/gfx/but-game-3.png" - onClicked: { - if (root.state == "in-game") - return - root.state = "in-game" - gameCanvas.blockFile = "SimpleBlock.qml" - gameCanvas.background = "gfx/background.png" - endlessTimer.start(); - } - system: gameCanvas.ps - group: "blue" - Timer { - id: endlessTimer - interval: Settings.menuDelay - running : false - repeat : false - onTriggered: Logic.startNewGame(gameCanvas, "endless") - } - } - - Button { - width: root.width - rotatedButton: true - imgSrc: "content/gfx/but-game-4.png" - group: "yellow" - onClicked: { - if (root.state == "in-game") - return - root.state = "in-game" - gameCanvas.blockFile = "PuzzleBlock.qml" - gameCanvas.background = "gfx/background.png" - puzzleTimer.start(); - } - Timer { - id: puzzleTimer - interval: Settings.menuDelay - running : false - repeat : false - onTriggered: loadPuzzle(); - } - system: gameCanvas.ps - } - } - } - - Image { - id: scoreBar - source: "content/gfx/bar.png" - width: parent.width - z: 6 - y: -Settings.headerHeight - height: Settings.headerHeight - Behavior on opacity { NumberAnimation {} } - SamegameText { - id: arcadeScore - anchors { right: parent.right; topMargin: 3; rightMargin: 11; top: parent.top} - text: '<font color="#f7d303">P1:</font> ' + gameCanvas.score - font.pixelSize: Settings.fontPixelSize - textFormat: Text.StyledText - color: "white" - opacity: gameCanvas.mode == "arcade" ? 1 : 0 - Behavior on opacity { NumberAnimation {} } - } - SamegameText { - id: arcadeHighScore - anchors { left: parent.left; topMargin: 3; leftMargin: 11; top: parent.top} - text: '<font color="#f7d303">Highscore:</font> ' + gameCanvas.highScore - opacity: gameCanvas.mode == "arcade" ? 1 : 0 - } - SamegameText { - id: p1Score - anchors { right: parent.right; topMargin: 3; rightMargin: 11; top: parent.top} - text: '<font color="#f7d303">P1:</font> ' + gameCanvas.score - opacity: gameCanvas.mode == "multiplayer" ? 1 : 0 - } - SamegameText { - id: p2Score - anchors { left: parent.left; topMargin: 3; leftMargin: 11; top: parent.top} - text: '<font color="#f7d303">P2:</font> ' + gameCanvas.score2 - opacity: gameCanvas.mode == "multiplayer" ? 1 : 0 - rotation: 180 - } - SamegameText { - id: puzzleMoves - anchors { left: parent.left; topMargin: 3; leftMargin: 11; top: parent.top} - text: '<font color="#f7d303">Moves:</font> ' + gameCanvas.moves - opacity: gameCanvas.mode == "puzzle" ? 1 : 0 - } - SamegameText { - Image { - source: "content/gfx/icon-time.png" - x: -20 - } - id: puzzleTime - anchors { topMargin: 3; top: parent.top; horizontalCenter: parent.horizontalCenter; horizontalCenterOffset: 20} - text: "00:00" - opacity: gameCanvas.mode == "puzzle" ? 1 : 0 - Timer { - interval: 1000 - repeat: true - running: gameCanvas.mode == "puzzle" && !gameCanvas.gameOver - onTriggered: { - var elapsed = Math.floor((new Date() - Logic.gameDuration)/ 1000.0); - var mins = Math.floor(elapsed/60.0); - var secs = (elapsed % 60); - puzzleTime.text = (mins < 10 ? "0" : "") + mins + ":" + (secs < 10 ? "0" : "") + secs; - } - } - } - SamegameText { - id: puzzleScore - anchors { right: parent.right; topMargin: 3; rightMargin: 11; top: parent.top} - text: '<font color="#f7d303">Score:</font> ' + gameCanvas.score - opacity: gameCanvas.mode == "puzzle" ? 1 : 0 - } - } - - Image { - id: bottomBar - width: parent.width - height: Settings.footerHeight - source: "content/gfx/bar.png" - y: parent.height - Settings.footerHeight; - z: 2 - Button { - id: quitButton - height: Settings.toolButtonHeight - imgSrc: "content/gfx/but-quit.png" - onClicked: {Qt.quit(); } - anchors { left: parent.left; verticalCenter: parent.verticalCenter; leftMargin: 11 } - } - Button { - id: menuButton - height: Settings.toolButtonHeight - imgSrc: "content/gfx/but-menu.png" - visible: (root.state == "in-game"); - onClicked: {root.state = ""; Logic.cleanUp(); gameCanvas.mode = ""} - anchors { left: quitButton.right; verticalCenter: parent.verticalCenter; leftMargin: 0 } - } - Button { - id: againButton - height: Settings.toolButtonHeight - imgSrc: "content/gfx/but-game-new.png" - visible: (root.state == "in-game"); - opacity: gameCanvas.gameOver && (gameCanvas.mode == "arcade" || gameCanvas.mode == "multiplayer") - Behavior on opacity{ NumberAnimation {} } - onClicked: {if (gameCanvas.gameOver) { Logic.startNewGame(gameCanvas, gameCanvas.mode);}} - anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 11 } - } - Button { - id: nextButton - height: Settings.toolButtonHeight - imgSrc: "content/gfx/but-puzzle-next.png" - visible: (root.state == "in-game") && gameCanvas.mode == "puzzle" && gameCanvas.puzzleWon - opacity: gameCanvas.puzzleWon ? 1 : 0 - Behavior on opacity{ NumberAnimation {} } - onClicked: {if (gameCanvas.puzzleWon) nextPuzzle();} - anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 11 } - } - } - - Connections { - target: root - onStateChanged: stateChangeAnim.running = true - } - SequentialAnimation { - id: stateChangeAnim - ParallelAnimation { - NumberAnimation { target: bottomBar; property: "y"; to: root.height; duration: Settings.menuDelay/2; easing.type: Easing.OutQuad } - NumberAnimation { target: scoreBar; property: "y"; to: -Settings.headerHeight; duration: Settings.menuDelay/2; easing.type: Easing.OutQuad } - } - ParallelAnimation { - NumberAnimation { target: bottomBar; property: "y"; to: root.height - Settings.footerHeight; duration: Settings.menuDelay/2; easing.type: Easing.OutBounce} - NumberAnimation { target: scoreBar; property: "y"; to: root.state == "" ? -Settings.headerHeight : 0; duration: Settings.menuDelay/2; easing.type: Easing.OutBounce} - } - } - - states: [ - State { - name: "in-game" - PropertyChanges { - target: menu - opacity: 0 - visible: false - } - } - ] - - transitions: [ - Transition { - NumberAnimation {properties: "x,y,opacity"} - } - ] - - //"Debug mode" - focus: true - Keys.onAsteriskPressed: Logic.nuke(); - Keys.onSpacePressed: gameCanvas.puzzleWon = true; -} diff --git a/examples/quick/demos/samegame/samegame.qmlproject b/examples/quick/demos/samegame/samegame.qmlproject deleted file mode 100644 index 42ffacf4f8..0000000000 --- a/examples/quick/demos/samegame/samegame.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "samegame.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/demos/samegame/samegame.qrc b/examples/quick/demos/samegame/samegame.qrc deleted file mode 100644 index 348ee109f9..0000000000 --- a/examples/quick/demos/samegame/samegame.qrc +++ /dev/null @@ -1,73 +0,0 @@ -<RCC> - <qresource prefix="/demos/samegame"> - <file>samegame.qml</file> - <file>content/qmldir</file> - <file>content/Settings.qml</file> - <file>content/gfx/text-p1-won.png</file> - <file>content/gfx/background-puzzle.png</file> - <file>content/gfx/background.png</file> - <file>content/gfx/bar.png</file> - <file>content/gfx/blue-puzzle.png</file> - <file>content/gfx/blue.png</file> - <file>content/gfx/bubble-highscore.png</file> - <file>content/gfx/bubble-puzzle.png</file> - <file>content/gfx/but-game-1.png</file> - <file>content/gfx/but-game-2.png</file> - <file>content/gfx/but-game-3.png</file> - <file>content/gfx/but-game-4.png</file> - <file>content/gfx/but-game-new.png</file> - <file>content/gfx/but-menu.png</file> - <file>content/gfx/but-puzzle-next.png</file> - <file>content/gfx/but-quit.png</file> - <file>content/gfx/green-puzzle.png</file> - <file>content/gfx/green.png</file> - <file>content/gfx/icon-fail.png</file> - <file>content/gfx/icon-ok.png</file> - <file>content/gfx/icon-time.png</file> - <file>content/gfx/logo-a.png</file> - <file>content/gfx/logo-e.png</file> - <file>content/gfx/logo-g.png</file> - <file>content/gfx/logo-m.png</file> - <file>content/gfx/logo-s.png</file> - <file>content/gfx/logo.png</file> - <file>content/gfx/particle-brick.png</file> - <file>content/gfx/particle-paint.png</file> - <file>content/gfx/particle-smoke.png</file> - <file>content/gfx/red-puzzle.png</file> - <file>content/gfx/red.png</file> - <file>content/gfx/text-highscore-new.png</file> - <file>content/gfx/text-highscore.png</file> - <file>content/gfx/text-no-winner.png</file> - <file>content/gfx/text-p1-go.png</file> - <file>content/gfx/text-p1.png</file> - <file>content/gfx/text-p2-go.png</file> - <file>content/gfx/text-p2-won.png</file> - <file>content/gfx/text-p2.png</file> - <file>content/gfx/yellow-puzzle.png</file> - <file>content/gfx/yellow.png</file> - <file>content/levels/level0.qml</file> - <file>content/levels/level1.qml</file> - <file>content/levels/level2.qml</file> - <file>content/levels/level3.qml</file> - <file>content/levels/level4.qml</file> - <file>content/levels/level5.qml</file> - <file>content/levels/level6.qml</file> - <file>content/levels/level7.qml</file> - <file>content/levels/level8.qml</file> - <file>content/levels/level9.qml</file> - <file>content/levels/TemplateBase.qml</file> - <file>content/SamegameText.qml</file> - <file>content/SimpleBlock.qml</file> - <file>content/Block.qml</file> - <file>content/BlockEmitter.qml</file> - <file>content/Button.qml</file> - <file>content/GameArea.qml</file> - <file>content/LogoAnimation.qml</file> - <file>content/MenuEmitter.qml</file> - <file>content/PaintEmitter.qml</file> - <file>content/PrimaryPack.qml</file> - <file>content/PuzzleBlock.qml</file> - <file>content/samegame.js</file> - <file>content/SmokeText.qml</file> - </qresource> -</RCC> diff --git a/examples/quick/demos/stocqt/content/+windows/Settings.qml b/examples/quick/demos/stocqt/content/+windows/Settings.qml deleted file mode 100644 index 1d4d7edcee..0000000000 --- a/examples/quick/demos/stocqt/content/+windows/Settings.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -pragma Singleton -import QtQml 2.0 - -QtObject { - property string fontFamily: "Arial" -} diff --git a/examples/quick/demos/stocqt/content/Banner.qml b/examples/quick/demos/stocqt/content/Banner.qml deleted file mode 100644 index 8d64e88410..0000000000 --- a/examples/quick/demos/stocqt/content/Banner.qml +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 - -Rectangle { - id: banner - height: 80 - color: "#000000" - - GridLayout { - anchors.fill: parent - rows: 1 - columns: 3 - Rectangle { - Layout.leftMargin: 10 - Layout.topMargin: 20 - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - Image { - id: arrow - source: "./images/icon-left-arrow.png" - visible: root.currentIndex == 1 ? true : false - - MouseArea { - anchors.fill: parent - onClicked: root.currentIndex = 0; - } - } - } - Text { - id: stocText - color: "#ffffff" - font.family: "Abel" - font.pointSize: 40 - text: "Stoc" - Layout.alignment: Qt.AlignRight - Layout.leftMargin: parent.width / 2.5 - } - Text { - id: qtText - color: "#5caa15" - font.family: "Abel" - font.pointSize: 40 - text: "Qt" - Layout.fillWidth: true - } - } -} diff --git a/examples/quick/demos/stocqt/content/Button.qml b/examples/quick/demos/stocqt/content/Button.qml deleted file mode 100644 index 4ef86a2cc3..0000000000 --- a/examples/quick/demos/stocqt/content/Button.qml +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "." - -Rectangle { - id: button - signal clicked - property alias text: txt.text - property bool buttonEnabled: false - width: Math.max(64, txt.width + 16) - height: 32 - color: "transparent" - MouseArea { - anchors.fill: parent - onClicked: button.clicked() - } - Text { - anchors.centerIn: parent - font.family: Settings.fontFamily - font.pointSize: 19 - font.weight: Font.DemiBold - color: button.buttonEnabled ? "#000000" : "#14aaff" - id: txt - } -} diff --git a/examples/quick/demos/stocqt/content/CheckBox.qml b/examples/quick/demos/stocqt/content/CheckBox.qml deleted file mode 100644 index f62eb538fb..0000000000 --- a/examples/quick/demos/stocqt/content/CheckBox.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - id: button - property bool buttonEnabled: true - width: 30 - height: 30 - x: 5 - MouseArea { - id: mouse - anchors.fill: parent - onClicked: { - if (buttonEnabled) - buttonEnabled = false; - else - buttonEnabled = true; - } - } - Rectangle { - id: checkbox - width: 30 - height: 30 - border.color: "#999999" - border.width: 1 - antialiasing: true - radius: 2 - color: "transparent" - Rectangle { - anchors.fill: parent - anchors.margins: 5 - antialiasing: true - radius: 1 - color: mouse.pressed || buttonEnabled ? "#999999" : "transparent" - } - } -} diff --git a/examples/quick/demos/stocqt/content/Settings.qml b/examples/quick/demos/stocqt/content/Settings.qml deleted file mode 100644 index 39e1c4c241..0000000000 --- a/examples/quick/demos/stocqt/content/Settings.qml +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -pragma Singleton -import QtQml 2.0 - -QtObject { - property string fontFamily: "Open Sans" -} diff --git a/examples/quick/demos/stocqt/content/StockChart.qml b/examples/quick/demos/stocqt/content/StockChart.qml deleted file mode 100644 index e90aba3aef..0000000000 --- a/examples/quick/demos/stocqt/content/StockChart.qml +++ /dev/null @@ -1,419 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import "." - -Rectangle { - id: chart - - property var stockModel: null - property var startDate: new Date() - property var endDate: new Date() - property string activeChart: "week" - property var settings - property int gridSize: 4 - property real gridStep: gridSize ? (canvas.width - canvas.tickMargin) / gridSize : canvas.xGridStep - - function update() { - endDate = new Date(); - if (chart.activeChart === "year") { - chart.startDate = new Date(chart.endDate.getFullYear() - 1, - chart.endDate.getMonth(), - chart.endDate.getDate()); - chart.gridSize = 12; - } - else if (chart.activeChart === "month") { - chart.startDate = new Date(chart.endDate.getFullYear(), - chart.endDate.getMonth() - 1, - chart.endDate.getDate()); - gridSize = 4; - } - else if (chart.activeChart === "week") { - chart.startDate = new Date(chart.endDate.getFullYear(), - chart.endDate.getMonth(), - chart.endDate.getDate() - 7); - gridSize = 0; - } - else if (chart.activeChart === "halfyear") { - chart.startDate = new Date(chart.endDate.getFullYear(), - chart.endDate.getMonth() - 6, - chart.endDate.getDate()); - gridSize = 6; - } - else if (chart.activeChart === "quarter") { - chart.startDate = new Date(chart.endDate.getFullYear(), - chart.endDate.getMonth() - 3, - chart.endDate.getDate()); - gridSize = 3; - } - else { - chart.startDate = new Date(2005, 3, 25); - gridSize = 4; - } - - canvas.requestPaint(); - } - - GridLayout { - anchors.fill: parent - columns: 6 - rows: 3 - columnSpacing: 4 - Button { - id: weekButton - text: "Week" - buttonEnabled: chart.activeChart === "week" - onClicked: { - chart.activeChart = "week"; - chart.update(); - } - } - - Button { - id: monthButton - text: "Month" - buttonEnabled: chart.activeChart === "month" - onClicked: { - chart.activeChart = "month"; - chart.update(); - } - } - - Button { - id: quarterlyButton - text: "3M" - buttonEnabled: chart.activeChart === "quarter" - onClicked: { - chart.activeChart = "quarter"; - chart.update(); - } - } - - Button { - id: halfYearlyButton - text: "6M" - buttonEnabled: chart.activeChart === "halfyear" - onClicked: { - chart.activeChart = "halfyear"; - chart.update(); - } - } - Button { - id: yearButton - text: "Year" - buttonEnabled: chart.activeChart === "year" - onClicked: { - chart.activeChart = "year"; - chart.update(); - } - } - Button { - id: maxButton - text: "Max" - buttonEnabled: chart.activeChart === "max" - onClicked: { - chart.activeChart = "max"; - chart.update(); - } - } - - Canvas { - id: canvas - Layout.fillWidth: true - Layout.fillHeight: true - Layout.columnSpan: 6 - // Uncomment below lines to use OpenGL hardware accelerated rendering. - // See Canvas documentation for available options. - // renderTarget: Canvas.FramebufferObject - // renderStrategy: Canvas.Threaded - - property int pixelSkip: 1 - property int numPoints: 1 - property int tickMargin: 34 - - property real xGridStep: (canvas.width - tickMargin) / numPoints - property real yGridOffset: canvas.height / 26 - property real yGridStep: canvas.height / 12 - - function drawBackground(ctx) { - ctx.save(); - ctx.fillStyle = "#ffffff"; - ctx.fillRect(0, 0, canvas.width, canvas.height); - ctx.strokeStyle = "#d7d7d7"; - ctx.beginPath(); - // Horizontal grid lines - for (var i = 0; i < 12; i++) { - ctx.moveTo(0, canvas.yGridOffset + i * canvas.yGridStep); - ctx.lineTo(canvas.width, canvas.yGridOffset + i * canvas.yGridStep); - } - - // Vertical grid lines - var height = 35 * canvas.height / 36; - var yOffset = canvas.height - height; - var xOffset = 0; - for (i = 0; i < chart.gridSize; i++) { - ctx.moveTo(xOffset + i * chart.gridStep, yOffset); - ctx.lineTo(xOffset + i * chart.gridStep, height); - } - ctx.stroke(); - - // Right ticks - ctx.strokeStyle = "#666666"; - ctx.beginPath(); - var xStart = canvas.width - tickMargin; - ctx.moveTo(xStart, 0); - ctx.lineTo(xStart, canvas.height); - for (i = 0; i < 12; i++) { - ctx.moveTo(xStart, canvas.yGridOffset + i * canvas.yGridStep); - ctx.lineTo(canvas.width, canvas.yGridOffset + i * canvas.yGridStep); - } - ctx.moveTo(0, canvas.yGridOffset + 9 * canvas.yGridStep); - ctx.lineTo(canvas.width, canvas.yGridOffset + 9 * canvas.yGridStep); - ctx.closePath(); - ctx.stroke(); - - ctx.restore(); - } - - // Returns a shortened, readable version of the potentially - // large volume number. - function volumeToString(value) { - if (value < 1000) - return value; - var exponent = parseInt(Math.log(value) / Math.log(1000)); - var shortVal = parseFloat(parseFloat(value) / Math.pow(1000, exponent)).toFixed(1); - - // Drop the decimal point on 3-digit values to make it fit - if (shortVal >= 100.0) { - shortVal = parseFloat(shortVal).toFixed(0); - } - return shortVal + "KMBTG".charAt(exponent - 1); - } - - function drawScales(ctx, high, low, vol) - { - ctx.save(); - ctx.strokeStyle = "#888888"; - ctx.font = "10px Open Sans" - - ctx.beginPath(); - - // prices on y-axis - var x = canvas.width - tickMargin + 3; - var priceStep = (high - low) / 9.0; - for (var i = 0; i < 10; i += 2) { - var price = parseFloat(high - i * priceStep).toFixed(1); - ctx.text(price, x, canvas.yGridOffset + i * yGridStep - 2); - } - - // volume scale - for (i = 0; i < 3; i++) { - var volume = volumeToString(vol - (i * (vol/3))); - ctx.text(volume, x, canvas.yGridOffset + (i + 9) * yGridStep + 10); - } - - ctx.closePath(); - ctx.stroke(); - ctx.restore(); - } - - function drawPrice(ctx, from, to, color, price, points, highest, lowest) - { - ctx.save(); - ctx.globalAlpha = 0.7; - ctx.strokeStyle = color; - - ctx.lineWidth = numPoints > 200 ? 1 : 3 - - ctx.beginPath(); - - var end = points.length; - - var range = highest - lowest; - if (range == 0) { - range = 1; - } - - for (var i = 0; i < end; i += pixelSkip) { - var x = points[i].x; - var y = points[i][price]; - var h = 9 * yGridStep; - - y = h * (lowest - y)/range + h + yGridOffset; - - if (i == 0) { - ctx.moveTo(x, y); - } else { - ctx.lineTo(x, y); - } - } - ctx.stroke(); - ctx.restore(); - } - - function drawVolume(ctx, from, to, color, price, points, highest) - { - ctx.save(); - ctx.fillStyle = color; - ctx.globalAlpha = 0.8; - ctx.lineWidth = 0; - ctx.beginPath(); - - var end = points.length; - var margin = 0; - - if (chart.activeChart === "month" || chart.activeChart === "week") { - margin = 8; - ctx.shadowOffsetX = 4; - ctx.shadowBlur = 3.5; - ctx.shadowColor = Qt.darker(color); - } - - // To match the volume graph with price grid, skip drawing the initial - // volume of the first day on chart. - for (var i = 1; i < end; i += pixelSkip) { - var x = points[i - 1].x; - var y = points[i][price]; - y = canvas.height * (y / highest); - y = 3 * y / 12; - ctx.fillRect(x, canvas.height - y + yGridOffset, - canvas.xGridStep - margin, y); - } - - ctx.stroke(); - ctx.restore(); - } - - function drawError(ctx, msg) - { - ctx.save(); - ctx.strokeStyle = "#888888"; - ctx.font = "24px Open Sans" - ctx.textAlign = "center" - ctx.shadowOffsetX = 4; - ctx.shadowOffsetY = 4; - ctx.shadowBlur = 1.5; - ctx.shadowColor = "#aaaaaa"; - ctx.beginPath(); - - ctx.fillText(msg, (canvas.width - tickMargin) / 2, - (canvas.height - yGridOffset - yGridStep) / 2); - - ctx.closePath(); - ctx.stroke(); - ctx.restore(); - } - - onPaint: { - numPoints = stockModel.indexOf(chart.startDate); - - if (chart.gridSize == 0) - chart.gridSize = numPoints - - var ctx = canvas.getContext("2d"); - ctx.globalCompositeOperation = "source-over"; - ctx.lineWidth = 1; - - drawBackground(ctx); - - if (!stockModel.ready) { - drawError(ctx, "No data available."); - return; - } - - var highestPrice = 0; - var highestVolume = 0; - var lowestPrice = -1; - var points = []; - for (var i = numPoints, j = 0; i >= 0 ; i -= pixelSkip, j += pixelSkip) { - var price = stockModel.get(i); - if (parseFloat(highestPrice) < parseFloat(price.high)) - highestPrice = price.high; - if (parseInt(highestVolume, 10) < parseInt(price.volume, 10)) - highestVolume = price.volume; - if (lowestPrice < 0 || parseFloat(lowestPrice) > parseFloat(price.low)) - lowestPrice = price.low; - points.push({ - x: j * xGridStep, - open: price.open, - close: price.close, - high: price.high, - low: price.low, - volume: price.volume - }); - } - - if (settings.drawHighPrice) - drawPrice(ctx, 0, numPoints, settings.highColor, "high", points, highestPrice, lowestPrice); - if (settings.drawLowPrice) - drawPrice(ctx, 0, numPoints, settings.lowColor, "low", points, highestPrice, lowestPrice); - if (settings.drawOpenPrice) - drawPrice(ctx, 0, numPoints,settings.openColor, "open", points, highestPrice, lowestPrice); - if (settings.drawClosePrice) - drawPrice(ctx, 0, numPoints, settings.closeColor, "close", points, highestPrice, lowestPrice); - - drawVolume(ctx, 0, numPoints, settings.volumeColor, "volume", points, highestVolume); - drawScales(ctx, highestPrice, lowestPrice, highestVolume); - } - } - - - Text { - id: fromDate - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 8 - Layout.alignment: Qt.AlignLeft - text: "| " + startDate.toDateString() - } - Text { - id: toDate - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 8 - Layout.alignment: Qt.AlignRight - Layout.rightMargin: canvas.tickMargin - Layout.columnSpan: 5 - text: endDate.toDateString() + " |" - } - } -} diff --git a/examples/quick/demos/stocqt/content/StockInfo.qml b/examples/quick/demos/stocqt/content/StockInfo.qml deleted file mode 100644 index 2935e74db9..0000000000 --- a/examples/quick/demos/stocqt/content/StockInfo.qml +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import "." - -Rectangle { - id: root - color: "transparent" - - property var stock: null - - GridLayout { - id: stockInfoLayout - anchors.fill: parent - columns: 2 - rows: 3 - rowSpacing: 4 - - Text { - id: stockIdText - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 28 - font.weight: Font.DemiBold - text: root.stock.stockId - Layout.alignment: Qt.AlignLeft | Qt.AlignBottom - Layout.leftMargin: 10 - } - - Text { - id: price - color: "#6d6d6d" - font.family: Settings.fontFamily - font.pointSize: 28 - font.weight: Font.DemiBold - text: parseFloat(root.stock.stockPrice).toFixed(2); - Layout.fillWidth: true - Layout.alignment: Qt.AlignLeft | Qt.AlignBottom - Layout.leftMargin: 5 - } - - Text { - id: stockNameText - color: "#0c0c0c" - font.family: Settings.fontFamily - font.pointSize: 16 - elide: Text.ElideRight - maximumLineCount: 3 - wrapMode: Text.WordWrap - text: root.stock.stockName - Layout.leftMargin: 10 - Layout.columnSpan: 2 - Layout.alignment: Qt.AlignLeft - } - - - Text { - id: priceChange - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - Layout.leftMargin: 10 - color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930" - font.family: Settings.fontFamily - font.pointSize: 18 - text: parseFloat(root.stock.stockPriceChanged).toFixed(2); - } - - Text { - id: priceChangePercentage - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930" - font.family: Settings.fontFamily - font.pointSize: 18 - font.weight: Font.DemiBold - Layout.fillWidth: true - text: "(" + - parseFloat(root.stock.stockPriceChanged / - (root.stock.stockPrice - root.stock.stockPriceChanged) * 100.0).toFixed(2) + - "%)" - } - } -} diff --git a/examples/quick/demos/stocqt/content/StockListDelegate.qml b/examples/quick/demos/stocqt/content/StockListDelegate.qml deleted file mode 100644 index f3a3ab6976..0000000000 --- a/examples/quick/demos/stocqt/content/StockListDelegate.qml +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.5 -import QtQuick.Layouts 1.1 -import "." - -Rectangle { - height: 102 - width: parent.width - color: "transparent" - MouseArea { - anchors.fill: parent; - onClicked: { - if (view.currentIndex == index) - mainRect.currentIndex = 1; - else - view.currentIndex = index; - } - } - GridLayout { - id: stockGrid - columns: 3 - rows: 2 - anchors.fill: parent - - Text { - id: stockIdText - Layout.alignment: Qt.AlignLeft | Qt.AlignBottom - Layout.leftMargin: 10 - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 20 - font.weight: Font.Bold - verticalAlignment: Text.AlignVCenter - text: stockId - } - - Text { - id: stockValueText - Layout.preferredWidth: 100 - Layout.alignment: Qt.AlignRight | Qt.AlignBottom - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 20 - font.bold: true - horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - text: value - } - Text { - id: stockValueChangeText - Layout.preferredWidth: 135 - Layout.rightMargin: 10 - Layout.alignment: Qt.AlignRight | Qt.AlignBottom - color: "#328930" - font.family: Settings.fontFamily - font.pointSize: 20 - font.bold: true - horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - text: change - onTextChanged: { - if (parseFloat(text) >= 0.0) - color = "#328930"; - else - color = "#d40000"; - } - } - Text { - id: stockNameText - Layout.preferredWidth: 300 - Layout.leftMargin: 10 - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 16 - font.bold: false - elide: Text.ElideRight - maximumLineCount: 1 - verticalAlignment: Text.AlignVCenter - text: name - } - - Item {Layout.fillWidth: true } - - Text { - id: stockValueChangePercentageText - Layout.fillWidth: true - Layout.alignment: Qt.AlignRight | Qt.AlignTop - Layout.rightMargin: 10 - color: "#328930" - font.family: Settings.fontFamily - font.pointSize: 18 - font.bold: false - horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - text: changePercentage - onTextChanged: { - if (parseFloat(text) >= 0.0) - color = "#328930"; - else - color = "#d40000"; - } - } - } - - Rectangle { - id: endingLine - anchors.top: stockGrid.bottom - height: 1 - width: parent.width - color: "#d7d7d7" - } -} - diff --git a/examples/quick/demos/stocqt/content/StockListModel.qml b/examples/quick/demos/stocqt/content/StockListModel.qml deleted file mode 100644 index 02ece32a49..0000000000 --- a/examples/quick/demos/stocqt/content/StockListModel.qml +++ /dev/null @@ -1,213 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -ListModel { - id: stocks - - // pre-fetch data for all entries - Component.onCompleted: { - for (var idx = 0; idx < count; ++idx) { - getCloseValue(idx) - } - } - - function requestUrl(stockId) { - var endDate = new Date(""); // today - var startDate = new Date() - startDate.setDate(startDate.getDate() - 5); - - var request = "http://ichart.finance.yahoo.com/table.csv?"; - request += "s=" + stockId; - request += "&g=d"; - request += "&a=" + startDate.getMonth(); - request += "&b=" + startDate.getDate(); - request += "&c=" + startDate.getFullYear(); - request += "&d=" + endDate.getMonth(); - request += "&e=" + endDate.getDate(); - request += "&f=" + endDate.getFullYear(); - request += "&g=d"; - request += "&ignore=.csv"; - return request; - } - - function getCloseValue(index) { - var req = requestUrl(get(index).stockId); - - if (!req) - return; - - var xhr = new XMLHttpRequest; - - xhr.open("GET", req, true); - - xhr.onreadystatechange = function() { - if (xhr.readyState === XMLHttpRequest.LOADING || xhr.readyState === XMLHttpRequest.DONE) { - var records = xhr.responseText.split('\n'); - var unknown = "n/a"; - set(index, {"value": unknown, "change": unknown, "changePercentage": unknown}); - if (records.length > 0 && xhr.status == 200) { - var r = records[1].split(','); - var today = parseFloat(r[4]); - if (!isNaN(today)) - setProperty(index, "value", today.toFixed(2)); - if (records.length > 2) { - r = records[2].split(','); - var yesterday = parseFloat(r[4]); - var change = today - yesterday; - if (change >= 0.0) - setProperty(index, "change", "+" + change.toFixed(2)); - else - setProperty(index, "change", change.toFixed(2)); - - var changePercentage = (change / yesterday) * 100.0; - if (changePercentage >= 0.0) - setProperty(index, "changePercentage", "+" + changePercentage.toFixed(2) + "%"); - else - setProperty(index, "changePercentage", changePercentage.toFixed(2) + "%"); - } - } - } - } - xhr.send() - } - // Uncomment to test invalid entries - // ListElement {name: "The Qt Company"; stockId: "TQTC"; value: "999.0"; change: "0.0"; changePercentage: "0.0"} - - // Data from http://www.nasdaq.com/quotes/nasdaq-100-stocks.aspx - ListElement {name: "Activision Blizzard Inc."; stockId: "ATVI"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Adobe Systems Inc."; stockId: "ADBE"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Akamai Technologies Inc."; stockId: "AKAM"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Alexion Pharmaceuticals Inc."; stockId: "ALXN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Alphabet Inc."; stockId: "GOOG"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Alphabet Inc."; stockId: "GOOGL"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Amazon.com Inc."; stockId: "AMZN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "American Airlines Group Inc."; stockId: "AAL"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Amgen Inc."; stockId: "AMGN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Analog Devices Inc."; stockId: "ADI"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Apple Inc."; stockId: "AAPL"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Applied Materials Inc."; stockId: "AMAT"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Autodesk Inc."; stockId: "ADSK"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Automatic Data Processing Inc."; stockId: "ADP"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Baidu Inc."; stockId: "BIDU"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Bed Bath & Beyond Inc."; stockId: "BBBY"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Biogen Inc."; stockId: "BIIB"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "BioMarin Pharmaceutical Inc."; stockId: "BMRN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Broadcom Limited"; stockId: "AVGO"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "CA Inc."; stockId: "CA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Celgene Corp."; stockId: "CELG"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Cerner Corp."; stockId: "CERN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Charter Communications Inc."; stockId: "CHTR"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Check Point Software Technologies Ltd."; stockId: "CHKP"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Cisco Systems Inc."; stockId: "CSCO"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Citrix Systems Inc."; stockId: "CTXS"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Cognizant Technology Solutions Corp."; stockId: "CTSH"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Comcast Corp."; stockId: "CMCSA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Costco Wholesale Corp."; stockId: "COST"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Ctrip.com International Ltd."; stockId: "CTRP"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Discovery Communications Inc."; stockId: "DISCA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Discovery Communications Inc."; stockId: "DISCK"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "DISH Network Corp."; stockId: "DISH"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Dollar Tree Inc."; stockId: "DLTR"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "eBay Inc."; stockId: "EBAY"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Electronic Arts Inc."; stockId: "EA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Endo International Plc"; stockId: "ENDP"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Intel Corp."; stockId: "INTC"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Intuit Inc."; stockId: "INTU"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Intuitive Surgical Inc."; stockId: "ISRG"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "JD.com Inc."; stockId: "JD"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "KLA-Tencor Corp."; stockId: "KLAC"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Lam Research Corp."; stockId: "LRCX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Liberty Global Plc"; stockId: "LBTYA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Liberty Global Plc"; stockId: "LBTYK"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Liberty Interactive Corp."; stockId: "LVNTA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Liberty Interactive Corp."; stockId: "QVCA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Liberty Media Corp."; stockId: "LMCA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Liberty Media Corp."; stockId: "LMCK"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Linear Technology Corp."; stockId: "LLTC"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Marriott International"; stockId: "MAR"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Mattel Inc."; stockId: "MAT"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Maxim Integrated Products Inc."; stockId: "MXIM"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Micron Technology Inc."; stockId: "MU"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Microsoft Corp."; stockId: "MSFT"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Mondelez International Inc."; stockId: "MDLZ"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Monster Beverage Corp."; stockId: "MNST"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Mylan N.V."; stockId: "MYL"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "NetApp Inc."; stockId: "NTAP"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Netflix Inc."; stockId: "NFLX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Norwegian Cruise Line Holdings Ltd."; stockId: "NCLH"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "NVIDIA Corp."; stockId: "NVDA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "NXP Semiconductors N.V."; stockId: "NXPI"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "O'Reilly Automotive Inc."; stockId: "ORLY"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "PACCAR Inc."; stockId: "PCAR"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Paychex Inc."; stockId: "PAYX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "PayPal Holdings Inc."; stockId: "PYPL"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "QUALCOMM Inc."; stockId: "QCOM"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Regeneron Pharmaceuticals Inc."; stockId: "REGN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Ross Stores Inc."; stockId: "ROST"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "SanDisk Corp."; stockId: "SNDK"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "SBA Communications Corp."; stockId: "SBAC"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Seagate Technology PLC"; stockId: "STX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Sirius XM Holdings Inc."; stockId: "SIRI"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Skyworks Solutions Inc."; stockId: "SWKS"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Starbucks Corp."; stockId: "SBUX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Stericycle Inc."; stockId: "SRCL"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Symantec Corp."; stockId: "SYMC"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "T-Mobile US Inc."; stockId: "TMUS"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Tesla Motors Inc."; stockId: "TSLA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Texas Instruments Inc."; stockId: "TXN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "The Kraft Heinz Company"; stockId: "KHC"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "The Priceline Group Inc."; stockId: "PCLN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Tractor Supply Company"; stockId: "TSCO"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "TripAdvisor Inc."; stockId: "TRIP"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Twenty-First Century Fox Inc."; stockId: "FOX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Twenty-First Century Fox Inc."; stockId: "FOXA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Ulta Salon Cosmetics & Fragrance Inc."; stockId: "ULTA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Verisk Analytics Inc."; stockId: "VRSK"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Vertex Pharmaceuticals Inc."; stockId: "VRTX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Viacom Inc."; stockId: "VIAB"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Vodafone Group Plc"; stockId: "VOD"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Walgreens Boots Alliance Inc."; stockId: "WBA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Western Digital Corp."; stockId: "WDC"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Whole Foods Market Inc."; stockId: "WFM"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Xilinx Inc."; stockId: "XLNX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} - ListElement {name: "Yahoo! Inc."; stockId: "YHOO"; value: "0.0"; change: "0.0"; changePercentage: "0.0"} -} diff --git a/examples/quick/demos/stocqt/content/StockListView.qml b/examples/quick/demos/stocqt/content/StockListView.qml deleted file mode 100644 index 177580cf6b..0000000000 --- a/examples/quick/demos/stocqt/content/StockListView.qml +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "." - -Rectangle { - id: root - anchors.top: parent.top - anchors.bottom: parent.bottom - color: "white" - - property string currentStockId: "" - property string currentStockName: "" - - ListView { - id: view - anchors.fill: parent - clip: true - keyNavigationWraps: true - highlightMoveDuration: 0 - focus: true - snapMode: ListView.SnapToItem - model: StockListModel {} - currentIndex: -1 // Don't pre-select any item - - onCurrentIndexChanged: { - if (currentItem) { - root.currentStockId = model.get(currentIndex).stockId; - root.currentStockName = model.get(currentIndex).name; - } - } - - delegate: StockListDelegate {} - - highlight: Rectangle { - width: view.width - color: "#eeeeee" - } - } -} diff --git a/examples/quick/demos/stocqt/content/StockModel.qml b/examples/quick/demos/stocqt/content/StockModel.qml deleted file mode 100644 index 035d9454d0..0000000000 --- a/examples/quick/demos/stocqt/content/StockModel.qml +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -ListModel { - id: model - property string stockId: "" - property string stockName: "" - property string stockDataCycle: "d" - property bool ready: false - property real stockPrice: 0.0 - property real stockPriceChanged: 0.0 - - signal dataReady - - function indexOf(date) { - if (model.count == 0) - return -1; - - var newest = new Date(model.get(0).date); - var oldest = new Date(model.get(model.count - 1).date); - if (newest <= date) - return -1; - - if (oldest >= date) - return model.count - 1; - - var currDiff = 0; - var bestDiff = Math.abs(date.getTime() - newest.getTime()); - var retval = 0; - for (var i = 0; i < model.count; i++) { - var d = new Date(model.get(i).date); - currDiff = Math.abs(d.getTime() - date.getTime()); - if (currDiff < bestDiff) { - bestDiff = currDiff; - retval = i; - } - if (currDiff > bestDiff) - return retval; - } - - return -1; - } - - function requestUrl() { - if (stockId === "") - return; - - var startDate = new Date(2011, 4, 25); - - var endDate = new Date(); //today - - if (stockDataCycle !== "d" && stockDataCycle !== "w" && stockDataCycle !== "m") - stockDataCycle = "d"; - - /* - Fetch stock data from yahoo finance: - url: http://ichart.finance.yahoo.com/table.csv?s=NOK&a=5&b=11&c=2010&d=7&e=23&f=2010&g=d&ignore=.csv - s:stock name/id, a:start day, b:start month, c:start year default: 25 April 1995, oldest c= 1962 - d:end day, e:end month, f:end year, default:today (data only available 3 days before today) - g:data cycle(d daily, w weekly, m monthly, v Dividend) - */ - var request = "http://ichart.finance.yahoo.com/table.csv?"; - request += "s=" + stockId; - request += "&a=" + startDate.getMonth(); - request += "&b=" + startDate.getDate(); - request += "&c=" + startDate.getFullYear(); - request += "&d=" + endDate.getMonth(); - request += "&e=" + endDate.getDate(); - request += "&f=" + endDate.getFullYear(); - request += "&g=" + stockDataCycle; - request += "&ignore=.csv"; - return request; - } - - function createStockPrice(r) { - return { - "date": r[0], - "open":r[1], - "high":r[2], - "low":r[3], - "close":r[4], - "volume":r[5], - "adjusted":r[6] - }; - } - - function updateStock() { - var req = requestUrl(); - - if (!req) - return; - - var xhr = new XMLHttpRequest; - - xhr.open("GET", req, true); - - model.ready = false; - model.clear(); - var i = 1; //skip the first line - xhr.onreadystatechange = function() { - if (xhr.readyState === XMLHttpRequest.LOADING || xhr.readyState === XMLHttpRequest.DONE) { - var records = xhr.responseText.split('\n'); - - for (;i < records.length; i++ ) { - var r = records[i].split(','); - if (r.length === 7) - model.append(createStockPrice(r)); - } - - if (xhr.readyState === XMLHttpRequest.DONE) { - if (model.count > 0) { - model.ready = true; - model.stockPrice = model.get(0).adjusted; - model.stockPriceChanged = model.count > 1 ? (Math.round((model.stockPrice - model.get(1).close) * 100) / 100) : 0; - } else { - model.stockPrice = 0; - model.stockPriceChanged = 0; - } - model.dataReady(); // emit signal - model.ready indicates whether the data is valid - } - } - } - xhr.send() - } -} diff --git a/examples/quick/demos/stocqt/content/StockSettingsPanel.qml b/examples/quick/demos/stocqt/content/StockSettingsPanel.qml deleted file mode 100644 index 1ac1035789..0000000000 --- a/examples/quick/demos/stocqt/content/StockSettingsPanel.qml +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.1 -import "." - -Rectangle { - id: root - color: "transparent" - - property bool drawOpenPrice: openButton.buttonEnabled - property bool drawClosePrice: closeButton.buttonEnabled - property bool drawHighPrice: highButton.buttonEnabled - property bool drawLowPrice: lowButton.buttonEnabled - - property string openColor: "#face20" - property string closeColor: "#14aaff" - property string highColor: "#80c342" - property string lowColor: "#f30000" - property string volumeColor: "#14aaff" - - GridLayout { - id: settingsGrid - rows: 5 - columns: 3 - rowSpacing: 4 - anchors.fill: parent - - Item { - Layout.fillHeight: true - Layout.columnSpan: 3 - } - - Text { - id: openText - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 19 - text: "Open" - Layout.leftMargin: 10 - } - Rectangle { - Layout.preferredHeight: 4 - Layout.preferredWidth: 114 - color: openColor - } - CheckBox { - id: openButton - buttonEnabled: false - Layout.rightMargin: 10 - } - - Text { - id: closeText - Layout.leftMargin: 10 - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 19 - text: "Close" - } - Rectangle { - Layout.preferredHeight: 4 - Layout.preferredWidth: 114 - color: closeColor - } - CheckBox { - id: closeButton - buttonEnabled: false - Layout.rightMargin: 10 - } - - Text { - id: highText - Layout.leftMargin: 10 - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 19 - text: "High" - } - Rectangle { - Layout.preferredHeight: 4 - Layout.preferredWidth: 114 - color: highColor - } - CheckBox { - id: highButton - buttonEnabled: true - Layout.rightMargin: 10 - } - - Text { - id: lowText - Layout.leftMargin: 10 - color: "#000000" - font.family: Settings.fontFamily - font.pointSize: 19 - text: "Low" - } - Rectangle { - Layout.preferredHeight: 4 - Layout.preferredWidth: 114 - color: lowColor - } - - CheckBox { - id: lowButton - buttonEnabled: true - Layout.rightMargin: 10 - } - } -} diff --git a/examples/quick/demos/stocqt/content/StockView.qml b/examples/quick/demos/stocqt/content/StockView.qml deleted file mode 100644 index d598ddd201..0000000000 --- a/examples/quick/demos/stocqt/content/StockView.qml +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Window 2.1 -import QtQuick.Layouts 1.1 - -Rectangle { - id: root - width: 320 - height: 480 - color: "transparent" - - property var stock: null - property var stocklist: null - signal settingsClicked - - function update() { - chart.update() - } - - Rectangle { - id: mainRect - color: "transparent" - anchors.fill: parent - - GridLayout { - anchors.fill: parent - rows: 2 - columns: Screen.primaryOrientation === Qt.PortraitOrientation ? 1 : 2 - - StockInfo { - id: stockInfo - Layout.alignment: Qt.AlignTop - Layout.preferredWidth: 400 - Layout.preferredHeight: 160 - stock: root.stock - } - - StockChart { - id: chart - Layout.alignment: Qt.AlignRight - Layout.margins: 5 - Layout.fillWidth: true - Layout.fillHeight: true - Layout.rowSpan: 2 - stockModel: root.stock - settings: settingsPanel - } - StockSettingsPanel { - id: settingsPanel - Layout.alignment: Qt.AlignBottom - Layout.fillHeight: true - Layout.preferredWidth: 400 - Layout.bottomMargin: 5 - onDrawOpenPriceChanged: root.update() - onDrawClosePriceChanged: root.update(); - onDrawHighPriceChanged: root.update(); - onDrawLowPriceChanged: root.update(); - } - } - } -} diff --git a/examples/quick/demos/stocqt/content/images/icon-left-arrow.png b/examples/quick/demos/stocqt/content/images/icon-left-arrow.png Binary files differdeleted file mode 100644 index 926938cadd..0000000000 --- a/examples/quick/demos/stocqt/content/images/icon-left-arrow.png +++ /dev/null diff --git a/examples/quick/demos/stocqt/content/images/wheel-touch.png b/examples/quick/demos/stocqt/content/images/wheel-touch.png Binary files differdeleted file mode 100644 index 11c8120ada..0000000000 --- a/examples/quick/demos/stocqt/content/images/wheel-touch.png +++ /dev/null diff --git a/examples/quick/demos/stocqt/content/images/wheel.png b/examples/quick/demos/stocqt/content/images/wheel.png Binary files differdeleted file mode 100644 index 470a675b35..0000000000 --- a/examples/quick/demos/stocqt/content/images/wheel.png +++ /dev/null diff --git a/examples/quick/demos/stocqt/content/qmldir b/examples/quick/demos/stocqt/content/qmldir deleted file mode 100644 index 77f5ed3c56..0000000000 --- a/examples/quick/demos/stocqt/content/qmldir +++ /dev/null @@ -1,12 +0,0 @@ -singleton Settings 1.0 Settings.qml -Button 1.0 Button.qml -CheckBox 1.0 CheckBox.qml -StockChart 1.0 StockChart.qml -StockInfo 1.0 StockInfo.qml -StockListModel 1.0 StockListModel.qml -StockListView 1.0 StockListView.qml -StockModel 1.0 StockModel.qml -StockSettingsPanel 1.0 StockSettingsPanel.qml -StockView 1.0 StockView.qml -StockListDelegate 1.0 StockListDelegate.qml -Banner 1.0 Banner.qml diff --git a/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png b/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png Binary files differdeleted file mode 100644 index dc09a84dc3..0000000000 --- a/examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.png +++ /dev/null diff --git a/examples/quick/demos/stocqt/doc/src/stocqt.qdoc b/examples/quick/demos/stocqt/doc/src/stocqt.qdoc deleted file mode 100644 index 800bba570c..0000000000 --- a/examples/quick/demos/stocqt/doc/src/stocqt.qdoc +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Qt Quick Demo - StocQt - \ingroup qtquickdemos - \example demos/stocqt - \brief A configurable stock chart for the NASDAQ-100. - \image qtquick-demo-stocqt.png - - The \e{StocQt} application presents a trend chart for the first stock in - the list of NASDAQ-100 stocks maintained by it. It allows the user to - choose another stock from the list, and fetches the required data for - the selected stock by sending an \c XMLHttpRequest to - http://finance.yahoo.com. - - The application uses several custom types such as Button, CheckBox, - StockChart, StockInfo, StockView, and so on. These types are used to - present the stock data in a readable form and also let the user customize - the trend chart. For example, the user can choose to view the yearly, - monthly, or daily trends in the stock price. - - The application uses the ObjectModel type to access the two visual data - models that it depends on. - - \quotefromfile demos/stocqt/stocqt.qml - \skipto ListView - \printuntil id - \dots 8 - \skipto model - \printuntil StockView - \printuntil } - \printuntil } - \printuntil } - - The StockListView model is a static data model listing the - NASDAQ-100 stocks with basic information such as stockId, name, value, - change, and so on. This data model is used by the application if the - user wants to choose another stock from the list. - - StockView is a complex data model that presents a trend chart for the - selected stock. It uses another custom type, StockChart, which presents - the graphical trend of the stock price using a Canvas. This data model - is used for most of the time during the lifetime of the application. - - \quotefromfile demos/stocqt/content/StockChart.qml - \skipto Rectangle - \printuntil id - \dots - \skipto Canvas - \printuntil id - \dots 8 - \skipto onPaint - \printuntil /^\}$/ - - To understand the application better, browse through its code using - Qt Creator. - - \include examples-run.qdocinc - - \sa {QML Applications} -*/ diff --git a/examples/quick/demos/stocqt/main.cpp b/examples/quick/demos/stocqt/main.cpp deleted file mode 100644 index cedffaf6e1..0000000000 --- a/examples/quick/demos/stocqt/main.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(demos/stocqt/stocqt) diff --git a/examples/quick/demos/stocqt/stocqt.pro b/examples/quick/demos/stocqt/stocqt.pro deleted file mode 100644 index 0e89a30050..0000000000 --- a/examples/quick/demos/stocqt/stocqt.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = app - -QT += qml quick -SOURCES += main.cpp -RESOURCES += stocqt.qrc -OTHER_FILES += *.qml content/*.qml content/images/*.png - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/stocqt -INSTALLS += target diff --git a/examples/quick/demos/stocqt/stocqt.qml b/examples/quick/demos/stocqt/stocqt.qml deleted file mode 100644 index a13e63fd50..0000000000 --- a/examples/quick/demos/stocqt/stocqt.qml +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQml.Models 2.1 -import QtQuick.Layouts 1.1 -import "./content" - -Rectangle { - id: mainRect - width: 1000 - height: 700 - - property alias currentIndex: root.currentIndex - - ColumnLayout { - anchors.fill: parent - - Banner { - id: banner - Layout.fillWidth: true - } - - ListView { - id: root - Layout.fillHeight: true - Layout.fillWidth: true - snapMode: ListView.SnapOneItem - highlightRangeMode: ListView.StrictlyEnforceRange - highlightMoveDuration: 250 - focus: false - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - - StockModel { - id: stock - stockId: listView.currentStockId - stockName: listView.currentStockName - onStockIdChanged: stock.updateStock(); - onDataReady: { - root.currentIndex = 1 - stockView.update() - } - } - - model: ObjectModel { - StockListView { - id: listView - width: root.width - height: root.height - } - - StockView { - id: stockView - width: root.width - height: root.height - stocklist: listView - stock: stock - } - } - } - } -} diff --git a/examples/quick/demos/stocqt/stocqt.qmlproject b/examples/quick/demos/stocqt/stocqt.qmlproject deleted file mode 100644 index 11ab78418a..0000000000 --- a/examples/quick/demos/stocqt/stocqt.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "stocqt.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/demos/stocqt/stocqt.qrc b/examples/quick/demos/stocqt/stocqt.qrc deleted file mode 100644 index ab7772a62a..0000000000 --- a/examples/quick/demos/stocqt/stocqt.qrc +++ /dev/null @@ -1,22 +0,0 @@ -<RCC> - <qresource prefix="/demos/stocqt"> - <file>stocqt.qml</file> - <file>content/qmldir</file> - <file>content/Button.qml</file> - <file>content/CheckBox.qml</file> - <file>content/StockChart.qml</file> - <file>content/StockListModel.qml</file> - <file>content/StockListView.qml</file> - <file>content/StockModel.qml</file> - <file>content/StockView.qml</file> - <file>content/images/wheel-touch.png</file> - <file>content/images/wheel.png</file> - <file>content/images/icon-left-arrow.png</file> - <file>content/StockSettingsPanel.qml</file> - <file>content/StockInfo.qml</file> - <file>content/Settings.qml</file> - <file>content/+windows/Settings.qml</file> - <file>content/StockListDelegate.qml</file> - <file>content/Banner.qml</file> - </qresource> -</RCC> diff --git a/examples/quick/demos/tweetsearch/content/FlipBar.qml b/examples/quick/demos/tweetsearch/content/FlipBar.qml deleted file mode 100644 index f1e240c4a4..0000000000 --- a/examples/quick/demos/tweetsearch/content/FlipBar.qml +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - id: container - property int animDuration: 300 - property Item front: Item {} - property Item back: Item {} - property real factor: 0.1 // amount the edges fold in for the 3D effect - property alias delta: effect.delta - property Item cur: frontShown ? front : back - property Item noncur: frontShown ? back : front - - function swap() { - var tmp = front; - front = back; - back = tmp; - resync(); - } - - width: cur.width - height: cur.height - onFrontChanged: resync(); - onBackChanged: resync(); - - function resync() {//TODO: Are the items ever actually visible? - back.parent = container; - front.parent = container; - frontShown ? back.visible = false : front.visible = false; - } - - property bool frontShown: true - - onFrontShownChanged: { - back.visible = !frontShown - front.visible = frontShown - } - - function flipUp(start) { - effect.visible = true; - effect.sourceA = effect.source1 - effect.sourceB = effect.source2 - if (start == undefined) - start = 1.0; - deltaAnim.from = start; - deltaAnim.to = 0.0 - dAnim.start(); - frontShown = false; - } - - function flipDown(start) { - effect.visible = true; - effect.sourceA = effect.source1 - effect.sourceB = effect.source2 - if (start == undefined) - start = 0.0; - deltaAnim.from = start; - deltaAnim.to = 1.0 - dAnim.start(); - frontShown = true; - } - - ShaderEffect { - id: effect - width: cur.width - height: cur.height - property real factor: container.factor * width - property real delta: 1.0 - - mesh: GridMesh { resolution: Qt.size(8,2) } - - SequentialAnimation on delta { - id: dAnim - running: false - NumberAnimation { - id: deltaAnim - duration: animDuration//expose anim - } - } - - property variant sourceA: source1 - property variant sourceB: source1 - property variant source1: ShaderEffectSource { - sourceItem: front - hideSource: effect.visible - } - - property variant source2: ShaderEffectSource { - sourceItem: back - hideSource: effect.visible - } - - fragmentShader: " - uniform lowp float qt_Opacity; - uniform sampler2D sourceA; - uniform sampler2D sourceB; - uniform highp float delta; - varying highp vec2 qt_TexCoord0; - void main() { - highp vec4 tex = vec4(qt_TexCoord0.x, qt_TexCoord0.y * 2.0, qt_TexCoord0.x, (qt_TexCoord0.y-0.5) * 2.0); - highp float shade = clamp(delta*2.0, 0.5, 1.0); - highp vec4 col; - if (qt_TexCoord0.y < 0.5) { - col = texture2D(sourceA, tex.xy) * (shade); - } else { - col = texture2D(sourceB, tex.zw) * (1.5 - shade); - col.w = 1.0; - } - gl_FragColor = col * qt_Opacity; - } - " - property real h: height - vertexShader: " - uniform highp float delta; - uniform highp float factor; - uniform highp float h; - uniform highp mat4 qt_Matrix; - attribute highp vec4 qt_Vertex; - attribute highp vec2 qt_MultiTexCoord0; - varying highp vec2 qt_TexCoord0; - void main() { - highp vec4 pos = qt_Vertex; - if (qt_MultiTexCoord0.y == 0.0) - pos.x += factor * (1. - delta) * (qt_MultiTexCoord0.x * -2.0 + 1.0); - else if (qt_MultiTexCoord0.y == 1.0) - pos.x += factor * (delta) * (qt_MultiTexCoord0.x * -2.0 + 1.0); - else - pos.y = delta * h; - gl_Position = qt_Matrix * pos; - qt_TexCoord0 = qt_MultiTexCoord0; - }" - - } -} diff --git a/examples/quick/demos/tweetsearch/content/LineInput.qml b/examples/quick/demos/tweetsearch/content/LineInput.qml deleted file mode 100644 index 46bc73f3af..0000000000 --- a/examples/quick/demos/tweetsearch/content/LineInput.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -FocusScope { - id: wrapper - - property alias text: input.text - property alias hint: hint.text - property alias prefix: prefix.text - - signal accepted - - Rectangle { - anchors.fill: parent - border.color: "#707070" - color: "#c1c1c1" - radius: 4 - - Text { - id: hint - anchors { fill: parent; leftMargin: 14 } - verticalAlignment: Text.AlignVCenter - text: "Enter word" - font.pixelSize: 18 - color: "#707070" - opacity: input.displayText.length ? 0 : 1 - } - - Text { - id: prefix - anchors { left: parent.left; leftMargin: 14; verticalCenter: parent.verticalCenter } - verticalAlignment: Text.AlignVCenter - font.pixelSize: 18 - color: "#707070" - opacity: !hint.opacity - } - - TextInput { - id: input - focus: true - anchors { left: prefix.right; right: parent.right; top: parent.top; bottom: parent.bottom } - verticalAlignment: Text.AlignVCenter - font.pixelSize: 18 - color: "#707070" - onAccepted: wrapper.accepted() - } - - Image { - source: "resources/icon-search.png" - anchors.right: parent.right - anchors.rightMargin: 12 - anchors.verticalCenter: parent.verticalCenter - MouseArea { - anchors { fill: parent; margins: -10 } - onClicked: wrapper.accepted() - } - } - } -} diff --git a/examples/quick/demos/tweetsearch/content/ListFooter.qml b/examples/quick/demos/tweetsearch/content/ListFooter.qml deleted file mode 100644 index 9a062d9488..0000000000 --- a/examples/quick/demos/tweetsearch/content/ListFooter.qml +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - color: "#d6d6d6" - width: parent.width - height: childrenRect.height - z: 2 - Connections { - target: mainListView - onAutoSearch: { - if (type == 'tag') { - tagSearch.open() - tagSearch.searchText = str - } else if (type == 'user'){ - userSearch.open() - userSearch.searchText = str - } else { - wordSearch.open() - wordSearch.searchText = str - } - } - } - - Column { - width: parent.width - - SearchDelegate { - id: wordSearch - label: "Search word..." - placeHolder: "Enter word" - onHasOpened: { - tagSearch.close() - userSearch.close() - } - onOk: { - mainListView.positionViewAtBeginning() - mainListView.clear() - tweetsModel.from = "" - tweetsModel.phrase = searchText - } - } - - SearchDelegate { - id: userSearch - label: "From user..." - placeHolder: "@username" - prefix: "@" - onHasOpened:{ - tagSearch.close() - wordSearch.close() - } - onOk: { - mainListView.positionViewAtBeginning() - mainListView.clear() - tweetsModel.phrase = "" - tweetsModel.from = searchText - } - } - - SearchDelegate { - id: tagSearch - label: "Search hashtag..." - placeHolder: "#hashtag" - prefix: "#" - onHasOpened:{ - userSearch.close() - wordSearch.close() - } - onOk: { - mainListView.positionViewAtBeginning() - mainListView.clear() - tweetsModel.from = "" - tweetsModel.phrase = "#" + searchText - } - } - - SpriteSequence { - id: sprite - anchors.horizontalCenter: parent.horizontalCenter - width: 320 - height: 300 - running: true - interpolate: false - Sprite { - name: "bird" - source: "resources/bird-anim-sprites.png" - frameCount: 1 - frameRate: 1 - frameWidth: 320 - frameHeight: 300 - to: { "bird":10, "trill":1, "blink":1 } - } - Sprite { - name: "trill" - source: "resources/bird-anim-sprites.png" - frameCount: 5 - frameRate: 3 - frameWidth: 320 - frameHeight: 300 - to: {"bird":1} - } - Sprite { - name: "blink" - source: "resources/bird-anim-sprites.png" - frameCount: 1 - frameRate: 3 - frameWidth: 320 - frameHeight: 300 - frameX: 1600 - to: {"bird":1} - } - } - } -} diff --git a/examples/quick/demos/tweetsearch/content/ListHeader.qml b/examples/quick/demos/tweetsearch/content/ListHeader.qml deleted file mode 100644 index d37300162d..0000000000 --- a/examples/quick/demos/tweetsearch/content/ListHeader.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - height: 60 - width: parent.width - - property bool refresh: state == "pulled" ? true : false - - Row { - spacing: 6 - height: childrenRect.height - anchors.centerIn: parent - - Image { - id: arrow - source: "resources/icon-refresh.png" - transformOrigin: Item.Center - Behavior on rotation { NumberAnimation { duration: 200 } } - } - - Text { - id: label - anchors.verticalCenter: arrow.verticalCenter - text: "Pull to refresh... " - font.pixelSize: 18 - color: "#999999" - } - } - - states: [ - State { - name: "base"; when: mainListView.contentY >= -120 - PropertyChanges { target: arrow; rotation: 180 } - }, - State { - name: "pulled"; when: mainListView.contentY < -120 - PropertyChanges { target: label; text: "Release to refresh..." } - PropertyChanges { target: arrow; rotation: 0 } - } - ] -} diff --git a/examples/quick/demos/tweetsearch/content/SearchDelegate.qml b/examples/quick/demos/tweetsearch/content/SearchDelegate.qml deleted file mode 100644 index 0dc4aacb34..0000000000 --- a/examples/quick/demos/tweetsearch/content/SearchDelegate.qml +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -FlipBar { - id: flipBar - animDuration: 250 - property string label: "" - property string placeHolder: "" - property alias searchText: lineInput.text - property alias prefix: lineInput.prefix - property bool opened: false - signal ok - signal hasOpened - - height: 60 - width: parent.width - - function open() { - flipBar.flipUp() - flipBar.opened = true - lineInput.forceActiveFocus() - flipBar.hasOpened() - } - - function close() { - if (opened) { - flipBar.flipDown() - flipBar.opened = false - } - } - - front: Rectangle { - height: 60 - width: parent.width - color: "#999999" - - Rectangle { color: "#c1c1c1"; width: parent.width; height: 1 } - Rectangle { color: "#707070"; width: parent.width; height: 1; anchors.bottom: parent.bottom } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - if (!flipBar.opened) - open() - else if (!lineInput.activeFocus) - lineInput.forceActiveFocus() - else - close() - } - } - - Text { - text: flipBar.label - anchors { left: parent.left; leftMargin: 20 } - anchors.verticalCenter: parent.verticalCenter - font.pixelSize: 18 - color: "#ffffff" - } - } - - back: FocusScope { - height: 60 - width: parent.width - Rectangle { - anchors.fill: parent - color: "#999999" - - Rectangle { color: "#c1c1c1"; width: parent.width; height: 1 } - Rectangle { color: "#707070"; width: parent.width; height: 1; anchors.bottom: parent.bottom } - - LineInput { - id: lineInput - hint: flipBar.placeHolder - focus: flipBar.opened - anchors { fill: parent; margins: 6 } - onAccepted: { - if (Qt.inputMethod.visible) - Qt.inputMethod.hide() - flipBar.ok() - } - } - } - } - -} diff --git a/examples/quick/demos/tweetsearch/content/TweetDelegate.qml b/examples/quick/demos/tweetsearch/content/TweetDelegate.qml deleted file mode 100644 index 202ced0285..0000000000 --- a/examples/quick/demos/tweetsearch/content/TweetDelegate.qml +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "tweetsearch.js" as Helper - -Item { - id: container - property real hm: 1.0 - property int appear: -1 - property real startRotation: 1 - - onAppearChanged: { - container.startRotation = 0.5 - flipBar.animDuration = appear; - delayedAnim.start(); - } - - SequentialAnimation { - id: delayedAnim - PauseAnimation { duration: 50 } - ScriptAction { script: flipBar.flipDown(startRotation); } - } - - width: 320 - height: flipBar.height * hm - - FlipBar { - id: flipBar - - property bool flipped: false - delta: startRotation - - anchors.bottom: parent.bottom - width: container.ListView.view ? container.ListView.view.width : 0 - height: Math.max(72, tweet.y + tweet.height + 10) - - front: Rectangle { - width: container.ListView.view ? container.ListView.view.width : 0 - height: Math.max(72, tweet.y + tweet.height + 10) - color: "#2699bf" - - Rectangle { color: "#33ccff"; width: parent.width; height: 1 } - Rectangle { color: "#1a6680"; width: parent.width; height: 1; anchors.bottom: parent.bottom } - - Image { - id: placeHolder - source: "resources/anonymous.png" - x: 10; y: 9 - visible: avatar.status != Image.Ready - } - - Image { - id: avatar - source: model.userImage - anchors.fill: placeHolder - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - flipBar.flipUp() - flipBar.flipped = true - } - } - } - - Text { - id: name - text: model.name - anchors { left: avatar.right; leftMargin: 10; top: avatar.top; topMargin: -3 } - font.pixelSize: 12 - font.bold: true - color: "white" - linkColor: "white" - } - - Text { - id: tweet - text: model.statusText - anchors { left: avatar.right; leftMargin: 10; top: name.bottom; topMargin: 0; right: parent.right; rightMargin: 10 } - wrapMode: Text.WordWrap - font.pixelSize: 12 - font.bold: false - color: "#adebff" - linkColor: "white" - onLinkActivated: { - var tag = link.split("https://twitter.com/search?q=%23") - var user = link.split("https://twitter.com/") - if (tag[1] != undefined) { - mainListView.positionViewAtBeginning() - mainListView.clear() - mainListView.autoSearch('tag', tag[1]) - tweetsModel.from = "" - tweetsModel.phrase = "#" + tag[1] - } else if (user[1] != undefined) { - mainListView.positionViewAtBeginning() - mainListView.clear() - mainListView.autoSearch('user', user[1]) - tweetsModel.phrase = "" - tweetsModel.from = user[1] - } else - Qt.openUrlExternally(link) - } - } - } - - back: Rectangle { - width: container.ListView.view ? container.ListView.view.width : 0 - height: Math.max(72, tweet.y + tweet.height + 10) - color: "#be4a25" - - Rectangle { color: "#ff6633"; width: parent.width; height: 1 } - Rectangle { color: "#80341a"; width: parent.width; height: 1; anchors.bottom: parent.bottom } - - Image { - id: avatar2 - source: model.userImage - anchors.right: parent.right - anchors.rightMargin: 10 - y: 9 - MouseArea { - anchors.fill: parent - onClicked: { - flipBar.flipDown() - flipBar.flipped = false - } - } - } - - Text { - id: username - text: model.twitterName - x: 10; anchors { top: avatar2.top; topMargin: -3 } - font.pixelSize: 12 - font.bold: true - color: "white" - linkColor: "white" - } - - Text { - text: model.source + "<br>" + Helper.formatDate(model.published) + "<br>" + model.uri - x: 10; anchors { top: username.bottom; topMargin: 0 } - wrapMode: Text.WordWrap - font.pixelSize: 12 - font.bold: false - color: "#ffc2ad" - linkColor: "white" - onLinkActivated: Qt.openUrlExternally(link); - } - } - } -} diff --git a/examples/quick/demos/tweetsearch/content/TweetsModel.qml b/examples/quick/demos/tweetsearch/content/TweetsModel.qml deleted file mode 100644 index d7de9a186e..0000000000 --- a/examples/quick/demos/tweetsearch/content/TweetsModel.qml +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "tweetsearch.js" as Helper - -Item { - id: wrapper - - // Insert valid consumer key and secret tokens below - // See https://dev.twitter.com/apps -//! [auth tokens] - property string consumerKey : "" - property string consumerSecret : "" -//! [auth tokens] - property string bearerToken : "" - - property variant model: tweets - property string from : "" - property string phrase : "" - - property int status: XMLHttpRequest.UNSENT - property bool isLoading: status === XMLHttpRequest.LOADING - property bool wasLoading: false - signal isLoaded - - ListModel { id: tweets } - - function encodePhrase(x) { return encodeURIComponent(x); } - - function reload() { - tweets.clear() - - if (from == "" && phrase == "") - return; - -//! [requesting] - var req = new XMLHttpRequest; - req.open("GET", "https://api.twitter.com/1.1/search/tweets.json?from=" + from + - "&count=10&q=" + encodePhrase(phrase)); - req.setRequestHeader("Authorization", "Bearer " + bearerToken); - req.onreadystatechange = function() { - status = req.readyState; - if (status === XMLHttpRequest.DONE) { - var objectArray = JSON.parse(req.responseText); - if (objectArray.errors !== undefined) - console.log("Error fetching tweets: " + objectArray.errors[0].message) - else { - for (var key in objectArray.statuses) { - var jsonObject = objectArray.statuses[key]; - tweets.append(jsonObject); - } - } - if (wasLoading == true) - wrapper.isLoaded() - } - wasLoading = (status === XMLHttpRequest.LOADING); - } - req.send(); -//! [requesting] - } - - onPhraseChanged: reload(); - onFromChanged: reload(); - - Component.onCompleted: { - if (consumerKey === "" || consumerSecret == "") { - bearerToken = encodeURIComponent(Helper.demoToken()) - return; - } - - var authReq = new XMLHttpRequest; - authReq.open("POST", "https://api.twitter.com/oauth2/token"); - authReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); - authReq.setRequestHeader("Authorization", "Basic " + Qt.btoa(consumerKey + ":" + consumerSecret)); - authReq.onreadystatechange = function() { - if (authReq.readyState === XMLHttpRequest.DONE) { - var jsonResponse = JSON.parse(authReq.responseText); - if (jsonResponse.errors !== undefined) - console.log("Authentication error: " + jsonResponse.errors[0].message) - else - bearerToken = jsonResponse.access_token; - } - } - authReq.send("grant_type=client_credentials"); - } - -} diff --git a/examples/quick/demos/tweetsearch/content/resources/anonymous.png b/examples/quick/demos/tweetsearch/content/resources/anonymous.png Binary files differdeleted file mode 100644 index 88fba26e90..0000000000 --- a/examples/quick/demos/tweetsearch/content/resources/anonymous.png +++ /dev/null diff --git a/examples/quick/demos/tweetsearch/content/resources/bird-anim-sprites.png b/examples/quick/demos/tweetsearch/content/resources/bird-anim-sprites.png Binary files differdeleted file mode 100644 index 4e8d7e6116..0000000000 --- a/examples/quick/demos/tweetsearch/content/resources/bird-anim-sprites.png +++ /dev/null diff --git a/examples/quick/demos/tweetsearch/content/resources/icon-clear.png b/examples/quick/demos/tweetsearch/content/resources/icon-clear.png Binary files differdeleted file mode 100644 index 75672f64c7..0000000000 --- a/examples/quick/demos/tweetsearch/content/resources/icon-clear.png +++ /dev/null diff --git a/examples/quick/demos/tweetsearch/content/resources/icon-loading.png b/examples/quick/demos/tweetsearch/content/resources/icon-loading.png Binary files differdeleted file mode 100644 index 8dbff8b70f..0000000000 --- a/examples/quick/demos/tweetsearch/content/resources/icon-loading.png +++ /dev/null diff --git a/examples/quick/demos/tweetsearch/content/resources/icon-refresh.png b/examples/quick/demos/tweetsearch/content/resources/icon-refresh.png Binary files differdeleted file mode 100644 index b639a638fe..0000000000 --- a/examples/quick/demos/tweetsearch/content/resources/icon-refresh.png +++ /dev/null diff --git a/examples/quick/demos/tweetsearch/content/resources/icon-search.png b/examples/quick/demos/tweetsearch/content/resources/icon-search.png Binary files differdeleted file mode 100644 index e41935a6c1..0000000000 --- a/examples/quick/demos/tweetsearch/content/resources/icon-search.png +++ /dev/null diff --git a/examples/quick/demos/tweetsearch/content/tweetsearch.js b/examples/quick/demos/tweetsearch/content/tweetsearch.js deleted file mode 100644 index 42a76c99fc..0000000000 --- a/examples/quick/demos/tweetsearch/content/tweetsearch.js +++ /dev/null @@ -1,62 +0,0 @@ -.pragma library - -function formatDate(date) -{ - var da = new Date(date) - return da.toDateString() -} - -function demoToken() -{ - var a = new Array(22).join('A') - return a + String.fromCharCode(0x44, 0x69, 0x4a, 0x52, 0x51, 0x41, 0x41, 0x41, 0x41, - 0x41, 0x41, 0x74, 0x2b, 0x72, 0x6a, 0x6c, 0x2b, 0x71, - 0x6d, 0x7a, 0x30, 0x72, 0x63, 0x79, 0x2b, 0x42, 0x62, - 0x75, 0x58, 0x42, 0x42, 0x73, 0x72, 0x55, 0x48, 0x47, - 0x45, 0x67, 0x3d, 0x71, 0x30, 0x45, 0x4b, 0x32, 0x61, - 0x57, 0x71, 0x51, 0x4d, 0x62, 0x31, 0x35, 0x67, 0x43, - 0x5a, 0x4e, 0x77, 0x5a, 0x6f, 0x39, 0x79, 0x71, 0x61, - 0x65, 0x30, 0x68, 0x70, 0x65, 0x32, 0x46, 0x44, 0x73, - 0x53, 0x39, 0x32, 0x57, 0x41, 0x75, 0x30, 0x67) -} - -function linkForEntity(entity) -{ - return (entity.url ? entity.url : - (entity.screen_name ? 'https://twitter.com/' + entity.screen_name : - 'https://twitter.com/search?q=%23' + entity.text)) -} - -function textForEntity(entity) -{ - return (entity.display_url ? entity.display_url : - (entity.screen_name ? entity.screen_name : entity.text)) -} - -function insertLinks(text, entities) -{ - if (typeof text !== 'string') - return ""; - - if (!entities) - return text; - - // Add all links (urls, usernames and hashtags) to an array and sort them in - // descending order of appearance in text - var links = [] - if (entities.urls) - links = entities.urls.concat(entities.hashtags, entities.user_mentions) - else if (entities.url) - links = entities.url.urls - - links.sort(function(a, b) { return b.indices[0] - a.indices[0] }) - - for (var i = 0; i < links.length; i++) { - var offset = links[i].url ? 0 : 1 - text = text.substring(0, links[i].indices[0] + offset) + - '<a href=\"' + linkForEntity(links[i]) + '\">' + - textForEntity(links[i]) + '</a>' + - text.substring(links[i].indices[1]) - } - return text.replace(/\n/g, '<br>'); -} diff --git a/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png Binary files differdeleted file mode 100644 index 930ee39929..0000000000 --- a/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.png +++ /dev/null diff --git a/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png b/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png Binary files differdeleted file mode 100644 index 9eff191a47..0000000000 --- a/examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.png +++ /dev/null diff --git a/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc b/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc deleted file mode 100644 index 4b859bbcc7..0000000000 --- a/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Qt Quick Demo - Tweet Search - \ingroup qtquickdemos - \example demos/tweetsearch - \brief A Twitter search client with 3D effects. - \image qtquick-demo-tweetsearch-med-1.png - \image qtquick-demo-tweetsearch-med-2.png - - \e{Tweet Search} is a QML application that searches items posted to Twitter - service using a number of query parameters. Search can be done for tweets - from a specified user, a hashtag, or a search phrase. - - The search result is a list of items showing the contents of the - tweet as well as the name and image of the user who posted it. - Hashtags, names and links in the content are clickable. Clicking - on the image will flip the item to reveal more information. - - \include examples-run.qdocinc - - Tweet Search uses Twitter API v1.1 for running seaches. - - \section1 Request Authentication - - Each request must be authenticated on behalf of the application. - For demonstration purposes, the application uses a hard-coded - token for identifying itself to the Twitter service. However, this - token is subject to rate limits for the number of requests as well - as possible expiration. - - If you are having authentication or rate limit problems running the - demo, obtain a set of application-specific tokens (consumer - key and consumer secret) by registering a new application on - \l{https://dev.twitter.com/apps}. - - Type in the two token values in \e {TweetsModel.qml}: - - \snippet demos/tweetsearch/content/TweetsModel.qml auth tokens - - Rebuild and run the demo. - - \section1 JSON Parsing - - Search results are returned in JSON (JavaScript Object Notation) - format. \c TweetsModel uses an \l XMLHTTPRequest object to send - an HTTP GET request, and calls JSON.parse() on the returned text - string to convert it to a JavaScript object. Each object - representing a tweet is then added to a \l ListModel: - - \snippet demos/tweetsearch/content/TweetsModel.qml requesting - - \sa {QML Applications} -*/ diff --git a/examples/quick/demos/tweetsearch/main.cpp b/examples/quick/demos/tweetsearch/main.cpp deleted file mode 100644 index 554892ac2b..0000000000 --- a/examples/quick/demos/tweetsearch/main.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(demos/tweetsearch/tweetsearch) diff --git a/examples/quick/demos/tweetsearch/tweetsearch.pro b/examples/quick/demos/tweetsearch/tweetsearch.pro deleted file mode 100644 index 27c34bac5d..0000000000 --- a/examples/quick/demos/tweetsearch/tweetsearch.pro +++ /dev/null @@ -1,13 +0,0 @@ -TEMPLATE = app - -QT += quick qml -SOURCES += main.cpp -RESOURCES += tweetsearch.qrc - -OTHER_FILES = tweetsearch.qml \ - content/*.qml \ - content/*.js \ - content/resources/* - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/tweetsearch -INSTALLS += target diff --git a/examples/quick/demos/tweetsearch/tweetsearch.qml b/examples/quick/demos/tweetsearch/tweetsearch.qml deleted file mode 100644 index b1323a6dc9..0000000000 --- a/examples/quick/demos/tweetsearch/tweetsearch.qml +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "content" -import "content/tweetsearch.js" as Helper - -Rectangle { - id: main - width: 320 - height: 480 - color: "#d6d6d6" - - property int inAnimDur: 250 - property int counter: 0 - property alias isLoading: tweetsModel.isLoading - property var idx - property var ids - - Component.onCompleted: ids = new Array() - - function idInModel(id) - { - for (var j = 0; j < ids.length; j++) - if (ids[j] === id) - return 1 - return 0 - } - - TweetsModel { - id: tweetsModel - onIsLoaded: { - console.debug("Reload") - idx = new Array() - for (var i = 0; i < tweetsModel.model.count; i++) { - var id = tweetsModel.model.get(i).id - if (!idInModel(id)) - idx.push(i) - } - console.debug(idx.length + " new tweets") - main.counter = idx.length - } - } - - Timer { - id: timer - interval: 500; running: main.counter; repeat: true - onTriggered: { - main.counter--; - var id = tweetsModel.model.get(idx[main.counter]).id - var item = tweetsModel.model.get(main.counter) - mainListView.add( { "statusText": Helper.insertLinks(item.text, item.entities), - "twitterName": item.user.screen_name, - "name" : item.user.name, - "userImage": item.user.profile_image_url, - "source": item.source, - "id": id, - "uri": Helper.insertLinks(item.user.url, item.user.entities), - "published": item.created_at } ); - ids.push(id) - } - } - - ListView { - id: mainListView - anchors.fill: parent - delegate: TweetDelegate { } - model: ListModel { id: finalModel } - - add: Transition { - NumberAnimation { property: "hm"; from: 0; to: 1.0; duration: 300; easing.type: Easing.OutQuad } - PropertyAction { property: "appear"; value: 250 } - } - - onDragEnded: if (header.refresh) { tweetsModel.reload() } - - ListHeader { - id: header - y: -mainListView.contentY - height - } - - footer: ListFooter { } - - function clear() { - ids = new Array() - model.clear() - } - - function add(obj) { - model.insert(0, obj) - } - - signal autoSearch(string type, string str) // To communicate with Footer instance - } -} diff --git a/examples/quick/demos/tweetsearch/tweetsearch.qmlproject b/examples/quick/demos/tweetsearch/tweetsearch.qmlproject deleted file mode 100644 index 5a0f31117b..0000000000 --- a/examples/quick/demos/tweetsearch/tweetsearch.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "tweetsearch.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/demos/tweetsearch/tweetsearch.qrc b/examples/quick/demos/tweetsearch/tweetsearch.qrc deleted file mode 100644 index b23c3c5537..0000000000 --- a/examples/quick/demos/tweetsearch/tweetsearch.qrc +++ /dev/null @@ -1,19 +0,0 @@ -<RCC> - <qresource prefix="/demos/tweetsearch"> - <file>tweetsearch.qml</file> - <file>content/FlipBar.qml</file> - <file>content/LineInput.qml</file> - <file>content/ListFooter.qml</file> - <file>content/ListHeader.qml</file> - <file>content/SearchDelegate.qml</file> - <file>content/TweetDelegate.qml</file> - <file>content/tweetsearch.js</file> - <file>content/TweetsModel.qml</file> - <file>content/resources/anonymous.png</file> - <file>content/resources/bird-anim-sprites.png</file> - <file>content/resources/icon-clear.png</file> - <file>content/resources/icon-loading.png</file> - <file>content/resources/icon-refresh.png</file> - <file>content/resources/icon-search.png</file> - </qresource> -</RCC> diff --git a/examples/quick/draganddrop/doc/src/draganddrop.qdoc b/examples/quick/draganddrop/doc/src/draganddrop.qdoc index ee10e77d72..754fa8f8cb 100644 --- a/examples/quick/draganddrop/doc/src/draganddrop.qdoc +++ b/examples/quick/draganddrop/doc/src/draganddrop.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,14 +20,14 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ /*! \title Qt Quick Examples - Drag and Drop \example draganddrop - \brief This is a collection of QML drag and drop examples + \brief This is a collection of QML drag and drop examples. \image qml-draganddrop-example.png \ingroup qtquickexamples @@ -57,8 +57,9 @@ \section1 GridView Example - The \e {GridView Example} adds drag and drop to a \l GridView, allowing you to reorder the - list. It also uses a \l DelegateModel to move a delegate item to the + The \e {GridView Example} adds drag and drop to a \l GridView, allowing you + to visually reorder the delegates without changing the underlying + \l ListModel. It uses a \l DelegateModel to move a delegate item to the position of another item it is dragged over. \snippet draganddrop/views/gridview.qml 0 diff --git a/examples/quick/draganddrop/draganddrop.qml b/examples/quick/draganddrop/draganddrop.qml index c2e9e3c27c..b1fb6eb268 100644 --- a/examples/quick/draganddrop/draganddrop.qml +++ b/examples/quick/draganddrop/draganddrop.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/draganddrop/main.cpp b/examples/quick/draganddrop/main.cpp index ff6dfddc9e..f31dc51577 100644 --- a/examples/quick/draganddrop/main.cpp +++ b/examples/quick/draganddrop/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/draganddrop/tiles/DragTile.qml b/examples/quick/draganddrop/tiles/DragTile.qml index eaaf332e95..78fe7a483a 100644 --- a/examples/quick/draganddrop/tiles/DragTile.qml +++ b/examples/quick/draganddrop/tiles/DragTile.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/draganddrop/tiles/DropTile.qml b/examples/quick/draganddrop/tiles/DropTile.qml index ebae6efec8..de4c0dee44 100644 --- a/examples/quick/draganddrop/tiles/DropTile.qml +++ b/examples/quick/draganddrop/tiles/DropTile.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/draganddrop/tiles/tiles.qml b/examples/quick/draganddrop/tiles/tiles.qml index 0d20af327a..80270354aa 100644 --- a/examples/quick/draganddrop/tiles/tiles.qml +++ b/examples/quick/draganddrop/tiles/tiles.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/draganddrop/views/gridview.qml b/examples/quick/draganddrop/views/gridview.qml index 6fa9d0166d..6c5bcef729 100644 --- a/examples/quick/draganddrop/views/gridview.qml +++ b/examples/quick/draganddrop/views/gridview.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.12 import QtQml.Models 2.1 GridView { @@ -82,26 +92,38 @@ GridView { ListElement { color: "teal" } } //! [1] - delegate: MouseArea { + delegate: DropArea { id: delegateRoot - property int visualIndex: DelegateModel.itemsIndex - width: 80; height: 80 - drag.target: icon + + onEntered: visualModel.items.move(drag.source.visualIndex, icon.visualIndex) + property int visualIndex: DelegateModel.itemsIndex + Binding { target: icon; property: "visualIndex"; value: visualIndex } Rectangle { id: icon + property int visualIndex: 0 width: 72; height: 72 anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter } - color: model.color radius: 3 + color: model.color - Drag.active: delegateRoot.drag.active - Drag.source: delegateRoot + Text { + anchors.centerIn: parent + color: "white" + text: parent.visualIndex + } + + DragHandler { + id: dragHandler + } + + Drag.active: dragHandler.active + Drag.source: icon Drag.hotSpot.x: 36 Drag.hotSpot.y: 36 @@ -114,19 +136,13 @@ GridView { } AnchorChanges { - target: icon; - anchors.horizontalCenter: undefined; + target: icon + anchors.horizontalCenter: undefined anchors.verticalCenter: undefined } } ] } - - DropArea { - anchors { fill: parent; margins: 15 } - - onEntered: visualModel.items.move(drag.source.visualIndex, delegateRoot.visualIndex) - } } //! [1] } diff --git a/examples/quick/externaldraganddrop/DragAndDropTextItem.qml b/examples/quick/externaldraganddrop/DragAndDropTextItem.qml index 5dfbafb06d..9858a961c9 100644 --- a/examples/quick/externaldraganddrop/DragAndDropTextItem.qml +++ b/examples/quick/externaldraganddrop/DragAndDropTextItem.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -39,32 +49,36 @@ ****************************************************************************/ import QtQuick 2.2 +import "../shared" as Examples Rectangle { id: item property string display - color: "#EEE" + property alias dropEnabled: acceptDropCB.checked + color: dropArea.containsDrag ? "#CFC" : "#EEE" + ColorAnimation on color { + id: rejectAnimation + from: "#FCC" + to: "#EEE" + duration: 1000 + } Text { anchors.fill: parent text: item.display wrapMode: Text.WordWrap } DropArea { + id: dropArea anchors.fill: parent keys: ["text/plain"] - onEntered: { - item.color = "#FCC" + onEntered: if (!acceptDropCB.checked) { + drag.accepted = false + rejectAnimation.start() } - onExited: { - item.color = "#EEE" - } - onDropped: { - item.color = "#EEE" - if (drop.hasText) { - if (drop.proposedAction == Qt.MoveAction || drop.proposedAction == Qt.CopyAction) { - item.display = drop.text - drop.acceptProposedAction() - } + onDropped: if (drop.hasText && acceptDropCB.checked) { + if (drop.proposedAction == Qt.MoveAction || drop.proposedAction == Qt.CopyAction) { + item.display = drop.text + drop.acceptProposedAction() } } } @@ -81,12 +95,12 @@ Rectangle { Drag.hotSpot.y: 0 Drag.mimeData: { "text/plain": item.display } Drag.dragType: Drag.Automatic - Drag.onDragStarted: { - } - Drag.onDragFinished: { - if (dropAction == Qt.MoveAction) { - item.display = "" - } - } - } // Item + Drag.onDragFinished: if (dropAction == Qt.MoveAction) item.display = "" + } + Examples.CheckBox { + id: acceptDropCB + anchors.right: parent.right + checked: true + text: "accept drop" + } } diff --git a/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc b/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc index 35035ea2cf..547b7f6695 100644 --- a/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc +++ b/examples/quick/externaldraganddrop/doc/src/externaldraganddrop.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/externaldraganddrop/externaldraganddrop.pro b/examples/quick/externaldraganddrop/externaldraganddrop.pro index 646781e7d1..0a592a84f3 100644 --- a/examples/quick/externaldraganddrop/externaldraganddrop.pro +++ b/examples/quick/externaldraganddrop/externaldraganddrop.pro @@ -2,9 +2,10 @@ TEMPLATE = app QT += quick qml SOURCES += main.cpp -RESOURCES += externaldraganddrop.qrc +RESOURCES += externaldraganddrop.qrc ../shared/shared.qrc EXAMPLE_FILES = \ + externaldraganddrop.qml \ DragAndDropTextItem.qml target.path = $$[QT_INSTALL_EXAMPLES]/quick/externaldraganddrop diff --git a/examples/quick/externaldraganddrop/externaldraganddrop.qml b/examples/quick/externaldraganddrop/externaldraganddrop.qml index 7563f32e32..47a76a259a 100644 --- a/examples/quick/externaldraganddrop/externaldraganddrop.qml +++ b/examples/quick/externaldraganddrop/externaldraganddrop.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -72,8 +82,8 @@ Item { DragAndDropTextItem { Layout.fillWidth: true height: 142 + dropEnabled: false display: "Drag out into other applications." } - } } diff --git a/examples/quick/externaldraganddrop/main.cpp b/examples/quick/externaldraganddrop/main.cpp index 05fc62646e..555fc93c84 100644 --- a/examples/quick/externaldraganddrop/main.cpp +++ b/examples/quick/externaldraganddrop/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/Tag.qml b/examples/quick/imageelements/animatedimage.qml index aff9f6fb3b..04bc38fe95 100644 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/Tag.qml +++ b/examples/quick/imageelements/animatedimage.qml @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtQml module of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage @@ -47,54 +47,69 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +import QtQuick 2.12 +import "../shared" as Examples -import QtQuick 2.0 +Column { + width: 320 + height: 480 + spacing: 6 + y: 12 -Flipable { - id: flipable - - property alias frontLabel: frontButton.label - property alias backLabel: backButton.label - - property int angle: 0 - property int randomAngle: Math.random() * (2 * 6 + 1) - 6 - property bool flipped: false - - signal frontClicked - signal backClicked - signal tagChanged(string tag) - - front: EditableButton { - id: frontButton; rotation: flipable.randomAngle - anchors { centerIn: parent; verticalCenterOffset: -20 } - onClicked: flipable.frontClicked() - onLabelChanged: flipable.tagChanged(label) +//! [image] + AnimatedImage { + id: animation + source: "content/Uniflow_steam_engine.gif" + anchors.horizontalCenter: parent.horizontalCenter + speed: speedSlider.value + TapHandler { + onTapped: animation.playing = !animation.playing + } } +//! [image] - back: Button { - id: backButton; tint: "red"; rotation: flipable.randomAngle - anchors { centerIn: parent; verticalCenterOffset: -20 } - onClicked: flipable.backClicked() - } + Rectangle { + id: timeline + color: "steelblue" + width: animation.width + height: 1 + x: animation.x + y: animation.height + 12 + visible: animation.playing - transform: Rotation { - origin.x: flipable.width / 2; origin.y: flipable.height / 2 - axis.x: 0; axis.y: 1; axis.z: 0 - angle: flipable.angle + Rectangle { + property int frames: animation.frameCount + width: 4; height: 8 + x: (animation.width - width) * animation.currentFrame / frames + y: -4 + color: "red" + } } - states: State { - name: "back"; when: flipable.flipped - PropertyChanges { target: flipable; angle: 180 } + Examples.Slider { + id: speedSlider + name: "Speed" + min: 0 + max: 5 + init: 1 + width: 240 + x: animation.x + Text { + font.pointSize: 12 + text: Math.round(animation.speed * 100) + "%" + x: animation.width - width + anchors.verticalCenter: parent.verticalCenter + anchors.margins: 6 + } } - transitions: Transition { - ParallelAnimation { - NumberAnimation { properties: "angle"; duration: 400 } - SequentialAnimation { - NumberAnimation { target: flipable; property: "scale"; to: 0.8; duration: 200 } - NumberAnimation { target: flipable; property: "scale"; to: 1.0; duration: 200 } - } + Examples.Button { + text: "Reset" + enabled: speedSlider.value !== 1 + anchors.horizontalCenter: parent.horizontalCenter + onClicked: { + speedSlider.setValue(1) + animation.playing = true } } } diff --git a/examples/quick/imageelements/animatedsprite.qml b/examples/quick/imageelements/animatedsprite.qml index 2a00371a5e..0c6bf5e28d 100644 --- a/examples/quick/imageelements/animatedsprite.qml +++ b/examples/quick/imageelements/animatedsprite.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -50,8 +60,6 @@ Item { //! [sprite] AnimatedSprite { id: sprite - width: 170 - height: 170 anchors.centerIn: parent source: "content/speaker.png" frameCount: 60 diff --git a/examples/quick/imageelements/borderimage.qml b/examples/quick/imageelements/borderimage.qml index fde8b98d21..00f18737f6 100644 --- a/examples/quick/imageelements/borderimage.qml +++ b/examples/quick/imageelements/borderimage.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageelements/content/BorderImageSelector.qml b/examples/quick/imageelements/content/BorderImageSelector.qml index 05e7937c44..93ff5136bc 100644 --- a/examples/quick/imageelements/content/BorderImageSelector.qml +++ b/examples/quick/imageelements/content/BorderImageSelector.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageelements/content/ImageCell.qml b/examples/quick/imageelements/content/ImageCell.qml index 83df6c59af..4b147633c3 100644 --- a/examples/quick/imageelements/content/ImageCell.qml +++ b/examples/quick/imageelements/content/ImageCell.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageelements/content/MyBorderImage.qml b/examples/quick/imageelements/content/MyBorderImage.qml index 40104b77d1..01d26a9630 100644 --- a/examples/quick/imageelements/content/MyBorderImage.qml +++ b/examples/quick/imageelements/content/MyBorderImage.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageelements/content/ShadowRectangle.qml b/examples/quick/imageelements/content/ShadowRectangle.qml index 1286816754..7bce665b23 100644 --- a/examples/quick/imageelements/content/ShadowRectangle.qml +++ b/examples/quick/imageelements/content/ShadowRectangle.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageelements/content/Uniflow_steam_engine.gif b/examples/quick/imageelements/content/Uniflow_steam_engine.gif Binary files differnew file mode 100644 index 0000000000..8754de4af9 --- /dev/null +++ b/examples/quick/imageelements/content/Uniflow_steam_engine.gif diff --git a/examples/quick/imageelements/doc/src/imageelements.qdoc b/examples/quick/imageelements/doc/src/imageelements.qdoc index 5872df3710..2c6490fb2c 100644 --- a/examples/quick/imageelements/doc/src/imageelements.qdoc +++ b/examples/quick/imageelements/doc/src/imageelements.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -36,29 +36,29 @@ \include examples-run.qdocinc - \section1 BorderImage + \section1 Scaling with BorderImage \e BorderImage shows off the various scaling modes of the \l BorderImage type by setting its horizontalTileMode and verticalTileMode properties. - \section1 Image + \section1 Image Fill \e Image shows off the various fill modes of the \l Image type. - \section1 Shadows + \section1 Shadow Effects \e Shadows shows how to create a drop shadow effect for a rectangular item using a \l BorderImage: \snippet imageelements/content/ShadowRectangle.qml shadow - \section1 AnimatedSprite + \section1 Sprite Animations with AnimatedSprite \e AnimatedSprite shows how to display a simple animation using an \l AnimatedSprite object: \snippet imageelements/animatedsprite.qml sprite The sprite animation will loop three times. - \section1 SpriteSequence + \section1 Sprite Animations with SpriteSequence \e SpriteSequence demonstrates using a sprite sequence to draw an animated and interactive bear. The \l SpriteSequence object defines five different diff --git a/examples/quick/imageelements/image.qml b/examples/quick/imageelements/image.qml index e1b5b40ec7..d414f59629 100644 --- a/examples/quick/imageelements/image.qml +++ b/examples/quick/imageelements/image.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageelements/imageelements.qml b/examples/quick/imageelements/imageelements.qml index 5dddfbd6e2..dfb4d24ea6 100644 --- a/examples/quick/imageelements/imageelements.qml +++ b/examples/quick/imageelements/imageelements.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -51,6 +61,7 @@ Item { addExample("BorderImage", "An image with scaled borders", Qt.resolvedUrl("borderimage.qml")); addExample("Image", "A showcase of the options available to Image", Qt.resolvedUrl("image.qml")); addExample("Shadows", "Rectangles with a drop-shadow effect", Qt.resolvedUrl("shadows.qml")); + addExample("AnimatedImage", "An image which plays animated formats", Qt.resolvedUrl("animatedimage.qml")); addExample("AnimatedSprite", "A simple sprite-based animation", Qt.resolvedUrl("animatedsprite.qml")); addExample("SpriteSequence", "A sprite-based animation with complex transitions", Qt.resolvedUrl("spritesequence.qml")); } diff --git a/examples/quick/imageelements/imageelements.qrc b/examples/quick/imageelements/imageelements.qrc index ef8a9e52cb..2488fb083b 100644 --- a/examples/quick/imageelements/imageelements.qrc +++ b/examples/quick/imageelements/imageelements.qrc @@ -13,7 +13,9 @@ <file>content/shadow.png</file> <file>content/ShadowRectangle.qml</file> <file>content/speaker.png</file> + <file>content/Uniflow_steam_engine.gif</file> <file>imageelements.qml</file> + <file>animatedimage.qml</file> <file>animatedsprite.qml</file> <file>borderimage.qml</file> <file>image.qml</file> diff --git a/examples/quick/imageelements/main.cpp b/examples/quick/imageelements/main.cpp index d7383cd263..235976b2fa 100644 --- a/examples/quick/imageelements/main.cpp +++ b/examples/quick/imageelements/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageelements/shadows.qml b/examples/quick/imageelements/shadows.qml index 91db62405b..981133f725 100644 --- a/examples/quick/imageelements/shadows.qml +++ b/examples/quick/imageelements/shadows.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageelements/spritesequence.qml b/examples/quick/imageelements/spritesequence.qml index c2d68b64e5..8581bf1ea8 100644 --- a/examples/quick/imageelements/spritesequence.qml +++ b/examples/quick/imageelements/spritesequence.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageprovider/doc/src/imageprovider.qdoc b/examples/quick/imageprovider/doc/src/imageprovider.qdoc index f848e03fcd..2f380cb2de 100644 --- a/examples/quick/imageprovider/doc/src/imageprovider.qdoc +++ b/examples/quick/imageprovider/doc/src/imageprovider.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/imageprovider/imageprovider-example.qml b/examples/quick/imageprovider/imageprovider-example.qml index bb8f81230d..fcda0ff3dc 100644 --- a/examples/quick/imageprovider/imageprovider-example.qml +++ b/examples/quick/imageprovider/imageprovider-example.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageprovider/imageprovider.cpp b/examples/quick/imageprovider/imageprovider.cpp index 1e4f53e736..2d927ea79a 100644 --- a/examples/quick/imageprovider/imageprovider.cpp +++ b/examples/quick/imageprovider/imageprovider.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -46,7 +56,6 @@ #include <QImage> #include <QPainter> -//![0] class ColorImageProvider : public QQuickImageProvider { public: @@ -55,7 +64,7 @@ public: { } - QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) + QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override { int width = 100; int height = 50; @@ -65,7 +74,6 @@ public: QPixmap pixmap(requestedSize.width() > 0 ? requestedSize.width() : width, requestedSize.height() > 0 ? requestedSize.height() : height); pixmap.fill(QColor(id).rgba()); -//![0] // write the color name QPainter painter(&pixmap); @@ -77,11 +85,9 @@ public: painter.scale(requestedSize.width() / width, requestedSize.height() / height); painter.drawText(QRectF(0, 0, width, height), Qt::AlignCenter, id); -//![1] return pixmap; } }; -//![1] class ImageProviderExtensionPlugin : public QQmlExtensionPlugin @@ -89,12 +95,12 @@ class ImageProviderExtensionPlugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: - void registerTypes(const char *uri) + void registerTypes(const char *uri) override { Q_UNUSED(uri); } - void initializeEngine(QQmlEngine *engine, const char *uri) + void initializeEngine(QQmlEngine *engine, const char *uri) override { Q_UNUSED(uri); engine->addImageProvider("colors", new ColorImageProvider); diff --git a/examples/quick/imageresponseprovider/doc/src/imageresponseprovider.qdoc b/examples/quick/imageresponseprovider/doc/src/imageresponseprovider.qdoc index a883ee1f2e..a402033fd0 100644 --- a/examples/quick/imageresponseprovider/doc/src/imageresponseprovider.qdoc +++ b/examples/quick/imageresponseprovider/doc/src/imageresponseprovider.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2015 Canonical Limited and/or its subsidiary(-ies) -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/imageresponseprovider/imageresponseprovider-example.qml b/examples/quick/imageresponseprovider/imageresponseprovider-example.qml index 20c1e69434..54305f0109 100644 --- a/examples/quick/imageresponseprovider/imageresponseprovider-example.qml +++ b/examples/quick/imageresponseprovider/imageresponseprovider-example.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2015 Canonical Limited and/or its subsidiary(-ies) -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/imageresponseprovider/imageresponseprovider.cpp b/examples/quick/imageresponseprovider/imageresponseprovider.cpp index d4633b779a..4f7c12b1d8 100644 --- a/examples/quick/imageresponseprovider/imageresponseprovider.cpp +++ b/examples/quick/imageresponseprovider/imageresponseprovider.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2015 Canonical Limited and/or its subsidiary(-ies) -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -56,12 +66,12 @@ class AsyncImageResponse : public QQuickImageResponse, public QRunnable setAutoDelete(false); } - QQuickTextureFactory *textureFactory() const + QQuickTextureFactory *textureFactory() const override { return QQuickTextureFactory::textureFactoryForImage(m_image); } - void run() + void run() override { m_image = QImage(50, 50, QImage::Format_RGB32); if (m_id == "slow") { @@ -87,7 +97,7 @@ class AsyncImageResponse : public QQuickImageResponse, public QRunnable class AsyncImageProvider : public QQuickAsyncImageProvider { public: - QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) + QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) override { AsyncImageResponse *response = new AsyncImageResponse(id, requestedSize); pool.start(response); @@ -104,12 +114,12 @@ class ImageProviderExtensionPlugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: - void registerTypes(const char *uri) + void registerTypes(const char *uri) override { Q_UNUSED(uri); } - void initializeEngine(QQmlEngine *engine, const char *uri) + void initializeEngine(QQmlEngine *engine, const char *uri) override { Q_UNUSED(uri); engine->addImageProvider("async", new AsyncImageProvider); diff --git a/examples/quick/keyinteraction/doc/src/keyinteraction.qdoc b/examples/quick/keyinteraction/doc/src/keyinteraction.qdoc index 0cef808598..04824f91de 100644 --- a/examples/quick/keyinteraction/doc/src/keyinteraction.qdoc +++ b/examples/quick/keyinteraction/doc/src/keyinteraction.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/keyinteraction/focus/Core/ContextMenu.qml b/examples/quick/keyinteraction/focus/Core/ContextMenu.qml index 45b23fd208..c5430aa650 100644 --- a/examples/quick/keyinteraction/focus/Core/ContextMenu.qml +++ b/examples/quick/keyinteraction/focus/Core/ContextMenu.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/keyinteraction/focus/Core/GridMenu.qml b/examples/quick/keyinteraction/focus/Core/GridMenu.qml index 4c1f3f0251..3f62adc792 100644 --- a/examples/quick/keyinteraction/focus/Core/GridMenu.qml +++ b/examples/quick/keyinteraction/focus/Core/GridMenu.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/keyinteraction/focus/Core/ListMenu.qml b/examples/quick/keyinteraction/focus/Core/ListMenu.qml index 327967604d..d8e9daba78 100644 --- a/examples/quick/keyinteraction/focus/Core/ListMenu.qml +++ b/examples/quick/keyinteraction/focus/Core/ListMenu.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml b/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml index 44efd64045..b1dde9ddc5 100644 --- a/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml +++ b/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/keyinteraction/focus/Core/TabMenu.qml b/examples/quick/keyinteraction/focus/Core/TabMenu.qml index 91b44da8b5..a40e070b2c 100644 --- a/examples/quick/keyinteraction/focus/Core/TabMenu.qml +++ b/examples/quick/keyinteraction/focus/Core/TabMenu.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/keyinteraction/focus/focus.qml b/examples/quick/keyinteraction/focus/focus.qml index 8b3be66e8b..e07df57697 100644 --- a/examples/quick/keyinteraction/focus/focus.qml +++ b/examples/quick/keyinteraction/focus/focus.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/keyinteraction/keyinteraction.qml b/examples/quick/keyinteraction/keyinteraction.qml index d7fe0675ed..7fa3078803 100644 --- a/examples/quick/keyinteraction/keyinteraction.qml +++ b/examples/quick/keyinteraction/keyinteraction.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/keyinteraction/main.cpp b/examples/quick/keyinteraction/main.cpp index 27ff9ed63b..53d26fb9b5 100644 --- a/examples/quick/keyinteraction/main.cpp +++ b/examples/quick/keyinteraction/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/layouts/doc/src/qtquicklayouts-examples.qdoc b/examples/quick/layouts/doc/src/qtquicklayouts-examples.qdoc index 23e36c0469..deb1d62b2b 100644 --- a/examples/quick/layouts/doc/src/qtquicklayouts-examples.qdoc +++ b/examples/quick/layouts/doc/src/qtquicklayouts-examples.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,14 +20,14 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ /*! \title Qt Quick Layouts - Basic Example \example layouts - \brief Demonstrates how to use layout types to arrange a UI + \brief Demonstrates how to use layout types to arrange a UI. \image qtquicklayouts-example-layouts.png \ingroup qtquickexamples diff --git a/examples/quick/localstorage/doc/src/localstorage.qdoc b/examples/quick/localstorage/doc/src/localstorage.qdoc index 8ffcbe9d14..144edae2f5 100644 --- a/examples/quick/localstorage/doc/src/localstorage.qdoc +++ b/examples/quick/localstorage/doc/src/localstorage.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/localstorage/localstorage/Database.js b/examples/quick/localstorage/localstorage/Database.js index 387033795f..80cd0a2b34 100644 --- a/examples/quick/localstorage/localstorage/Database.js +++ b/examples/quick/localstorage/localstorage/Database.js @@ -1,26 +1,49 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:FDL$ +** $QT_BEGIN_LICENSE:BSD$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** -** 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: http://www.gnu.org/copyleft/fdl.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/localstorage/localstorage/Header.qml b/examples/quick/localstorage/localstorage/Header.qml index a08645a170..18f51c1b6e 100644 --- a/examples/quick/localstorage/localstorage/Header.qml +++ b/examples/quick/localstorage/localstorage/Header.qml @@ -1,27 +1,50 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:FDL$ +** $QT_BEGIN_LICENSE:BSD$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** -** 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: http://www.gnu.org/copyleft/fdl.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/localstorage/localstorage/MyButton.qml b/examples/quick/localstorage/localstorage/MyButton.qml index 4659b45f64..c83ea63a85 100644 --- a/examples/quick/localstorage/localstorage/MyButton.qml +++ b/examples/quick/localstorage/localstorage/MyButton.qml @@ -1,26 +1,49 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:FDL$ +** $QT_BEGIN_LICENSE:BSD$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** -** 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: http://www.gnu.org/copyleft/fdl.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/localstorage/localstorage/MyDelegate.qml b/examples/quick/localstorage/localstorage/MyDelegate.qml index 9a4ac1cc46..63a83bfbae 100644 --- a/examples/quick/localstorage/localstorage/MyDelegate.qml +++ b/examples/quick/localstorage/localstorage/MyDelegate.qml @@ -1,26 +1,49 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:FDL$ +** $QT_BEGIN_LICENSE:BSD$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** -** 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: http://www.gnu.org/copyleft/fdl.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/localstorage/localstorage/MyModel.qml b/examples/quick/localstorage/localstorage/MyModel.qml index 0677ec74d6..7ccb97e266 100644 --- a/examples/quick/localstorage/localstorage/MyModel.qml +++ b/examples/quick/localstorage/localstorage/MyModel.qml @@ -1,26 +1,49 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:FDL$ +** $QT_BEGIN_LICENSE:BSD$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/localstorage/localstorage/localstorage.qml b/examples/quick/localstorage/localstorage/localstorage.qml index b85fad4764..434639db54 100644 --- a/examples/quick/localstorage/localstorage/localstorage.qml +++ b/examples/quick/localstorage/localstorage/localstorage.qml @@ -1,26 +1,49 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:FDL$ +** $QT_BEGIN_LICENSE:BSD$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** -** 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: http://www.gnu.org/copyleft/fdl.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/localstorage/localstorage/main.cpp b/examples/quick/localstorage/localstorage/main.cpp index 9f8adbb7a5..293c81768a 100644 --- a/examples/quick/localstorage/localstorage/main.cpp +++ b/examples/quick/localstorage/localstorage/main.cpp @@ -1,26 +1,49 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:FDL$ +** $QT_BEGIN_LICENSE:BSD$ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/models/abstractitemmodel/doc/src/abstractitemmodel-example.qdoc b/examples/quick/models/abstractitemmodel/doc/src/abstractitemmodel-example.qdoc index 0c3dc0a201..114a04c8f1 100644 --- a/examples/quick/models/abstractitemmodel/doc/src/abstractitemmodel-example.qdoc +++ b/examples/quick/models/abstractitemmodel/doc/src/abstractitemmodel-example.qdoc @@ -1,39 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** +** $QT_BEGIN_LICENSE:FDL$ +** 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. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -44,4 +31,4 @@ \brief Shows how to use a QAbstractItemModel subclass as a model in QML. \image qml-abstractitemmodel-example.png -*/
\ No newline at end of file +*/ diff --git a/examples/quick/models/abstractitemmodel/main.cpp b/examples/quick/models/abstractitemmodel/main.cpp index 9631e1fcb6..515f47ec30 100644 --- a/examples/quick/models/abstractitemmodel/main.cpp +++ b/examples/quick/models/abstractitemmodel/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/abstractitemmodel/model.cpp b/examples/quick/models/abstractitemmodel/model.cpp index 688ea2d5cf..9d0032e34c 100644 --- a/examples/quick/models/abstractitemmodel/model.cpp +++ b/examples/quick/models/abstractitemmodel/model.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/abstractitemmodel/model.h b/examples/quick/models/abstractitemmodel/model.h index 68c3061ae3..186388c96f 100644 --- a/examples/quick/models/abstractitemmodel/model.h +++ b/examples/quick/models/abstractitemmodel/model.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/abstractitemmodel/view.qml b/examples/quick/models/abstractitemmodel/view.qml index 6ede7b567b..f699aa40c8 100644 --- a/examples/quick/models/abstractitemmodel/view.qml +++ b/examples/quick/models/abstractitemmodel/view.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/objectlistmodel/dataobject.cpp b/examples/quick/models/objectlistmodel/dataobject.cpp index 3555db8283..6963d75c42 100644 --- a/examples/quick/models/objectlistmodel/dataobject.cpp +++ b/examples/quick/models/objectlistmodel/dataobject.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/objectlistmodel/dataobject.h b/examples/quick/models/objectlistmodel/dataobject.h index 4e3f3c1090..6033ff40c4 100644 --- a/examples/quick/models/objectlistmodel/dataobject.h +++ b/examples/quick/models/objectlistmodel/dataobject.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/objectlistmodel/doc/src/objectlistmodel-example.qdoc b/examples/quick/models/objectlistmodel/doc/src/objectlistmodel-example.qdoc index 117886672a..2c9f0f1459 100644 --- a/examples/quick/models/objectlistmodel/doc/src/objectlistmodel-example.qdoc +++ b/examples/quick/models/objectlistmodel/doc/src/objectlistmodel-example.qdoc @@ -1,39 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** +** $QT_BEGIN_LICENSE:FDL$ +** 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. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/models/objectlistmodel/main.cpp b/examples/quick/models/objectlistmodel/main.cpp index 76e8c83ef1..977bbfb93b 100644 --- a/examples/quick/models/objectlistmodel/main.cpp +++ b/examples/quick/models/objectlistmodel/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/objectlistmodel/view.qml b/examples/quick/models/objectlistmodel/view.qml index a9140cfd95..d9a32aff14 100644 --- a/examples/quick/models/objectlistmodel/view.qml +++ b/examples/quick/models/objectlistmodel/view.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/stringlistmodel/doc/src/stringlistmodel-example.qdoc b/examples/quick/models/stringlistmodel/doc/src/stringlistmodel-example.qdoc index 00beceb23c..3d2fd8cb95 100644 --- a/examples/quick/models/stringlistmodel/doc/src/stringlistmodel-example.qdoc +++ b/examples/quick/models/stringlistmodel/doc/src/stringlistmodel-example.qdoc @@ -1,39 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** +** $QT_BEGIN_LICENSE:FDL$ +** 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. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/models/stringlistmodel/main.cpp b/examples/quick/models/stringlistmodel/main.cpp index 155f579848..6b4db422a6 100644 --- a/examples/quick/models/stringlistmodel/main.cpp +++ b/examples/quick/models/stringlistmodel/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/models/stringlistmodel/view.qml b/examples/quick/models/stringlistmodel/view.qml index 0d4e2e46b7..f74b7db1c1 100644 --- a/examples/quick/models/stringlistmodel/view.qml +++ b/examples/quick/models/stringlistmodel/view.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/mousearea/doc/src/mousearea.qdoc b/examples/quick/mousearea/doc/src/mousearea.qdoc index db792dcfe0..3911764614 100644 --- a/examples/quick/mousearea/doc/src/mousearea.qdoc +++ b/examples/quick/mousearea/doc/src/mousearea.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/mousearea/main.cpp b/examples/quick/mousearea/main.cpp index 7874ddfd33..6113ab1ad8 100644 --- a/examples/quick/mousearea/main.cpp +++ b/examples/quick/mousearea/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/mousearea/mousearea-wheel-example.qml b/examples/quick/mousearea/mousearea-wheel-example.qml index 861639811c..44b9216285 100644 --- a/examples/quick/mousearea/mousearea-wheel-example.qml +++ b/examples/quick/mousearea/mousearea-wheel-example.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/mousearea/mousearea.qml b/examples/quick/mousearea/mousearea.qml index ecaf8a37eb..1540d85fdd 100644 --- a/examples/quick/mousearea/mousearea.qml +++ b/examples/quick/mousearea/mousearea.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/affectors.qml b/examples/quick/particles/affectors/affectors.qml index fa33a0e2b3..81240fed9b 100644 --- a/examples/quick/particles/affectors/affectors.qml +++ b/examples/quick/particles/affectors/affectors.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/GreyButton.qml b/examples/quick/particles/affectors/content/GreyButton.qml index c712741141..d78d913cf0 100644 --- a/examples/quick/particles/affectors/content/GreyButton.qml +++ b/examples/quick/particles/affectors/content/GreyButton.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/age.qml b/examples/quick/particles/affectors/content/age.qml index 4705084d52..ff5114a596 100644 --- a/examples/quick/particles/affectors/content/age.qml +++ b/examples/quick/particles/affectors/content/age.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/attractor.qml b/examples/quick/particles/affectors/content/attractor.qml index 2d5b232dea..7fbb6069b2 100644 --- a/examples/quick/particles/affectors/content/attractor.qml +++ b/examples/quick/particles/affectors/content/attractor.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/customaffector.qml b/examples/quick/particles/affectors/content/customaffector.qml index 84b621c3ae..71646bcf39 100644 --- a/examples/quick/particles/affectors/content/customaffector.qml +++ b/examples/quick/particles/affectors/content/customaffector.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/friction.qml b/examples/quick/particles/affectors/content/friction.qml index a9cb2c4fa9..1fa85ec2fe 100644 --- a/examples/quick/particles/affectors/content/friction.qml +++ b/examples/quick/particles/affectors/content/friction.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/gravity.qml b/examples/quick/particles/affectors/content/gravity.qml index d60263ab45..99b14f3b1f 100644 --- a/examples/quick/particles/affectors/content/gravity.qml +++ b/examples/quick/particles/affectors/content/gravity.qml @@ -1,12 +1,22 @@ /**************************************************************************** * -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/groupgoal.qml b/examples/quick/particles/affectors/content/groupgoal.qml index 3d67df98e2..6472a3b450 100644 --- a/examples/quick/particles/affectors/content/groupgoal.qml +++ b/examples/quick/particles/affectors/content/groupgoal.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/move.qml b/examples/quick/particles/affectors/content/move.qml index f5f6b30713..b33d7f4006 100644 --- a/examples/quick/particles/affectors/content/move.qml +++ b/examples/quick/particles/affectors/content/move.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/spritegoal.qml b/examples/quick/particles/affectors/content/spritegoal.qml index 24bff118e9..294f693221 100644 --- a/examples/quick/particles/affectors/content/spritegoal.qml +++ b/examples/quick/particles/affectors/content/spritegoal.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/turbulence.qml b/examples/quick/particles/affectors/content/turbulence.qml index a6fb92ae75..e58b3ede7f 100644 --- a/examples/quick/particles/affectors/content/turbulence.qml +++ b/examples/quick/particles/affectors/content/turbulence.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/content/wander.qml b/examples/quick/particles/affectors/content/wander.qml index e5e903d2b7..736fc1af76 100644 --- a/examples/quick/particles/affectors/content/wander.qml +++ b/examples/quick/particles/affectors/content/wander.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/affectors/doc/src/affectors.qdoc b/examples/quick/particles/affectors/doc/src/affectors.qdoc index aef6a8d336..9857a86241 100644 --- a/examples/quick/particles/affectors/doc/src/affectors.qdoc +++ b/examples/quick/particles/affectors/doc/src/affectors.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/particles/affectors/main.cpp b/examples/quick/particles/affectors/main.cpp index a32803a354..9e90217000 100644 --- a/examples/quick/particles/affectors/main.cpp +++ b/examples/quick/particles/affectors/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/customparticle/content/blurparticles.qml b/examples/quick/particles/customparticle/content/blurparticles.qml index 1d46de754c..f72b858895 100644 --- a/examples/quick/particles/customparticle/content/blurparticles.qml +++ b/examples/quick/particles/customparticle/content/blurparticles.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/customparticle/content/fragmentshader.qml b/examples/quick/particles/customparticle/content/fragmentshader.qml index b121873cfb..2b28da2ea1 100644 --- a/examples/quick/particles/customparticle/content/fragmentshader.qml +++ b/examples/quick/particles/customparticle/content/fragmentshader.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/customparticle/content/imagecolors.qml b/examples/quick/particles/customparticle/content/imagecolors.qml index 6ec50bb319..4ce995b6b4 100644 --- a/examples/quick/particles/customparticle/content/imagecolors.qml +++ b/examples/quick/particles/customparticle/content/imagecolors.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/customparticle/customparticle.qml b/examples/quick/particles/customparticle/customparticle.qml index 444f62d730..bfa6de8b4a 100644 --- a/examples/quick/particles/customparticle/customparticle.qml +++ b/examples/quick/particles/customparticle/customparticle.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/customparticle/doc/src/customparticle.qdoc b/examples/quick/particles/customparticle/doc/src/customparticle.qdoc index 1f10bf4dc7..a660d4b5a7 100644 --- a/examples/quick/particles/customparticle/doc/src/customparticle.qdoc +++ b/examples/quick/particles/customparticle/doc/src/customparticle.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/particles/customparticle/main.cpp b/examples/quick/particles/customparticle/main.cpp index 5426c33260..bf7fb4f065 100644 --- a/examples/quick/particles/customparticle/main.cpp +++ b/examples/quick/particles/customparticle/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/content/burstandpulse.qml b/examples/quick/particles/emitters/content/burstandpulse.qml index d6befb9f29..8bd19ed8ed 100644 --- a/examples/quick/particles/emitters/content/burstandpulse.qml +++ b/examples/quick/particles/emitters/content/burstandpulse.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/content/customemitter.qml b/examples/quick/particles/emitters/content/customemitter.qml index 401112b88d..aa8ca6b2f9 100644 --- a/examples/quick/particles/emitters/content/customemitter.qml +++ b/examples/quick/particles/emitters/content/customemitter.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/content/emitmask.qml b/examples/quick/particles/emitters/content/emitmask.qml index 63a263ce87..db13480e29 100644 --- a/examples/quick/particles/emitters/content/emitmask.qml +++ b/examples/quick/particles/emitters/content/emitmask.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/content/maximumemitted.qml b/examples/quick/particles/emitters/content/maximumemitted.qml index 052a380bd0..dd4dfdfbdd 100644 --- a/examples/quick/particles/emitters/content/maximumemitted.qml +++ b/examples/quick/particles/emitters/content/maximumemitted.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/content/shapeanddirection.qml b/examples/quick/particles/emitters/content/shapeanddirection.qml index f88ca285de..8d1659b099 100644 --- a/examples/quick/particles/emitters/content/shapeanddirection.qml +++ b/examples/quick/particles/emitters/content/shapeanddirection.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/content/trailemitter.qml b/examples/quick/particles/emitters/content/trailemitter.qml index 30b9dfcf39..fdb6180eb6 100644 --- a/examples/quick/particles/emitters/content/trailemitter.qml +++ b/examples/quick/particles/emitters/content/trailemitter.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/content/velocityfrommotion.qml b/examples/quick/particles/emitters/content/velocityfrommotion.qml index 9d101cd0e9..eee533a2fe 100644 --- a/examples/quick/particles/emitters/content/velocityfrommotion.qml +++ b/examples/quick/particles/emitters/content/velocityfrommotion.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/doc/src/emitters.qdoc b/examples/quick/particles/emitters/doc/src/emitters.qdoc index 2bc8371f0a..2ba7ceb0b9 100644 --- a/examples/quick/particles/emitters/doc/src/emitters.qdoc +++ b/examples/quick/particles/emitters/doc/src/emitters.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/particles/emitters/emitters.qml b/examples/quick/particles/emitters/emitters.qml index 21c7c2e472..83b9eacc7c 100644 --- a/examples/quick/particles/emitters/emitters.qml +++ b/examples/quick/particles/emitters/emitters.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/emitters/main.cpp b/examples/quick/particles/emitters/main.cpp index cbe63b3410..e2b3cf2026 100644 --- a/examples/quick/particles/emitters/main.cpp +++ b/examples/quick/particles/emitters/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/content/allatonce.qml b/examples/quick/particles/imageparticle/content/allatonce.qml index 1b115361d1..4b6c9b35cc 100644 --- a/examples/quick/particles/imageparticle/content/allatonce.qml +++ b/examples/quick/particles/imageparticle/content/allatonce.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/content/colored.qml b/examples/quick/particles/imageparticle/content/colored.qml index f97470c8a8..3452cad805 100644 --- a/examples/quick/particles/imageparticle/content/colored.qml +++ b/examples/quick/particles/imageparticle/content/colored.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/content/colortable.qml b/examples/quick/particles/imageparticle/content/colortable.qml index 66ccbcabeb..5f88c1a8b3 100644 --- a/examples/quick/particles/imageparticle/content/colortable.qml +++ b/examples/quick/particles/imageparticle/content/colortable.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/content/deformation.qml b/examples/quick/particles/imageparticle/content/deformation.qml index 593d61bbca..ce672c8fa3 100644 --- a/examples/quick/particles/imageparticle/content/deformation.qml +++ b/examples/quick/particles/imageparticle/content/deformation.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/content/rotation.qml b/examples/quick/particles/imageparticle/content/rotation.qml index e7c262614a..d118bb1d97 100644 --- a/examples/quick/particles/imageparticle/content/rotation.qml +++ b/examples/quick/particles/imageparticle/content/rotation.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/content/sharing.qml b/examples/quick/particles/imageparticle/content/sharing.qml index 09ed0e1c72..1018a8e8ba 100644 --- a/examples/quick/particles/imageparticle/content/sharing.qml +++ b/examples/quick/particles/imageparticle/content/sharing.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/content/sprites.qml b/examples/quick/particles/imageparticle/content/sprites.qml index 0853123a48..c8ffe6c0e5 100644 --- a/examples/quick/particles/imageparticle/content/sprites.qml +++ b/examples/quick/particles/imageparticle/content/sprites.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc b/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc index 40b9d223aa..6a71e1f5fd 100644 --- a/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc +++ b/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/particles/imageparticle/imageparticle.qml b/examples/quick/particles/imageparticle/imageparticle.qml index bc45c03dd4..a8dfa6a0c9 100644 --- a/examples/quick/particles/imageparticle/imageparticle.qml +++ b/examples/quick/particles/imageparticle/imageparticle.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/imageparticle/main.cpp b/examples/quick/particles/imageparticle/main.cpp index 0edc8a45bd..ff0764a730 100644 --- a/examples/quick/particles/imageparticle/main.cpp +++ b/examples/quick/particles/imageparticle/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/itemparticle/content/Delegate.qml b/examples/quick/particles/itemparticle/content/Delegate.qml index 5a18cbfddf..946b7b8748 100644 --- a/examples/quick/particles/itemparticle/content/Delegate.qml +++ b/examples/quick/particles/itemparticle/content/Delegate.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/itemparticle/content/Delegate2.qml b/examples/quick/particles/itemparticle/content/Delegate2.qml index dd74fd0c99..03465609d9 100644 --- a/examples/quick/particles/itemparticle/content/Delegate2.qml +++ b/examples/quick/particles/itemparticle/content/Delegate2.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/itemparticle/content/ExpandingDelegate.qml b/examples/quick/particles/itemparticle/content/ExpandingDelegate.qml index ee0bc8f926..9ffbc7f350 100644 --- a/examples/quick/particles/itemparticle/content/ExpandingDelegate.qml +++ b/examples/quick/particles/itemparticle/content/ExpandingDelegate.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/itemparticle/content/RssModel.qml b/examples/quick/particles/itemparticle/content/RssModel.qml deleted file mode 100644 index 166bca2919..0000000000 --- a/examples/quick/particles/itemparticle/content/RssModel.qml +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.XmlListModel 2.0 - -XmlListModel { - property string tags : "" - - function encodeTags(x) { return encodeURIComponent(x.replace(' ',',')); } - - source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+encodeTags(tags)+"&" : "") - query: "/feed/entry" - namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';" - - XmlRole { name: "title"; query: "title/string()" } - XmlRole { name: "content"; query: "content/string()" } - XmlRole { name: "hq"; query: "link[@rel='enclosure']/@href/string()" } -} diff --git a/examples/quick/particles/itemparticle/delegates.qml b/examples/quick/particles/itemparticle/delegates.qml index 663f3c31bb..0e9267214f 100644 --- a/examples/quick/particles/itemparticle/delegates.qml +++ b/examples/quick/particles/itemparticle/delegates.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/itemparticle/itemparticle.pro b/examples/quick/particles/itemparticle/itemparticle.pro new file mode 100644 index 0000000000..f5c0576b4a --- /dev/null +++ b/examples/quick/particles/itemparticle/itemparticle.pro @@ -0,0 +1,12 @@ +TEMPLATE = app + +QT += quick qml +SOURCES += main.cpp +RESOURCES += \ + ../images.qrc \ + ../../shared/shared.qrc \ + $$files("content/*") \ + $$files("*qml") + +target.path = $$[QT_INSTALL_EXAMPLES]/quick/particles/itemparticle +INSTALLS += target diff --git a/examples/quick/particles/itemparticle/main.cpp b/examples/quick/particles/itemparticle/main.cpp new file mode 100644 index 0000000000..da21f15be3 --- /dev/null +++ b/examples/quick/particles/itemparticle/main.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "../../shared/shared.h" +DECLARATIVE_EXAMPLE_MAIN(particleview) diff --git a/examples/quick/particles/itemparticle/particleview.qml b/examples/quick/particles/itemparticle/particleview.qml index f46e3ee44a..3b412e37e5 100644 --- a/examples/quick/particles/itemparticle/particleview.qml +++ b/examples/quick/particles/itemparticle/particleview.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,8 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtQuick.Particles 2.0 +import QtQuick 2.12 +import QtQuick.Particles 2.12 +import "shared" as Shared import "content/script.js" as Script import "content" @@ -86,7 +97,7 @@ Item { ImageParticle { system: sys groups: ["fireworks"] - source: "qrc:particleresources/star.png" + source: "qrc:///particleresources/star.png" color: "lightsteelblue" alpha: 0 colorVariation: 0 @@ -102,8 +113,13 @@ Item { Component { id: alertDelegate Rectangle { - width: 132 + color: "DarkSlateGray" + border.width: 1 + border.color: "LightSteelBlue" + width: 144 height: 132 + antialiasing: true + radius: 3 NumberAnimation on scale { running: true loops: 1 @@ -111,13 +127,14 @@ Item { to: 1 } Image { - source: "../asteroid/../images/rocket.png" + source: "qrc:///particles/images/rocket.png" anchors.centerIn: parent } Text { anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter text: "A new ship has arrived!" + color: "LightSteelBlue" } } } @@ -188,84 +205,97 @@ Item { } Item { x: -1000; y: -1000 //offscreen Repeater {//Load them here, add to system on completed - model: theModel + model: flickrModel delegate: theDelegate } } - RssModel {id: theModel; tags:"particle,particles"} + Shared.FlickrRssModel { + id: flickrModel + tags: "particle,particles" + } Component { id: theDelegate - Rectangle { - id: container - border.width: 2 - antialiasing: true - property real myRand: Math.random();//'depth' - z: Math.floor(myRand * 100) - scale: (myRand + 1.0)/2; - //TODO: Darken based on 'depth' + Image { + id: image + antialiasing: true; + source: thumbnail + cache: true + property real depth: Math.random() + property real darken: 0.75 + z: Math.floor(depth * 100) + scale: (depth + 1) / 2 + sourceSize { + width: root.width + height: root.height + } width: 132 height: 132 - //ItemParticle.onAttached: console.log("I'm in" + x + "," + y + ":" + opacity); - ItemParticle.onDetached: mp.take(container);//respawns - function manage() - { - if (state == "selected") { - console.log("Taking " + index); - mp.freeze(container); - } else { - console.log("Returning " +index); - mp.unfreeze(container); - } - } - Image { - id: img + fillMode: Image.PreserveAspectFit + Rectangle { + // Darken based on depth anchors.centerIn: parent + width: parent.paintedWidth + 1 + height: parent.paintedHeight + 1 + color: "black" + opacity: darken * (1 - depth) antialiasing: true; - source: "http://" + Script.getImagePath(content); cache: true - fillMode: Image.PreserveAspectFit; - width: parent.width-4; height: parent.height-4 - onStatusChanged: if (img.status == Image.Ready) { - loading.opacity = 0; - mp.take(container); - } } Text { anchors.bottom: parent.bottom - width: parent.width + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottomMargin: Math.max(parent.paintedWidth, parent.paintedHeight) - Math.min(parent.width, parent.height) + width: parent.paintedWidth - 4 horizontalAlignment: Text.AlignHCenter elide: Text.ElideRight text: title color: "black" } - MouseArea { - anchors.fill: parent - onClicked: container.state == "selected" ? container.state = "" : container.state = "selected" + ItemParticle.onDetached: mp.take(image); // respawns + onStatusChanged: if (image.status == Image.Ready) { + loading.opacity = 0; + mp.take(image); + } + function manage() + { + if (state == "selected") { + console.log("Taking " + index); + mp.freeze(image); + } else { + console.log("Returning " +index); + mp.unfreeze(image); + } + } + TapHandler { + gesturePolicy: TapHandler.ReleaseWithinBounds + onTapped: image.state = (image.state == "" ? "selected" : "") } states: State { name: "selected" ParentChange { - target: container + target: image parent: root - x: 0 - y: 0 } PropertyChanges { - target: container + target: image + source: media + x: 0 + y: 0 width: root.width height: root.height z: 101 opacity: 1 rotation: 0 + darken: 0 } } transitions: Transition { to: "selected" reversible: true SequentialAnimation { - ScriptAction {script: container.manage();} + ScriptAction { script: image.manage() } ParallelAnimation { - ParentAnimation {NumberAnimation { properties: "x,y" }}//Doesn't work, particles takes control of x,y instantly - NumberAnimation { properties: "width, height, z, rotation" } + ParentAnimation {NumberAnimation { properties: "x,y" }} + PropertyAnimation { properties: "width, height, z, rotation, darken"; easing.type: Easing.InOutQuad } } } } diff --git a/examples/quick/particles/particles.pro b/examples/quick/particles/particles.pro index 2ea61751fb..db9033a961 100644 --- a/examples/quick/particles/particles.pro +++ b/examples/quick/particles/particles.pro @@ -3,11 +3,11 @@ SUBDIRS += affectors \ customparticle \ emitters \ imageparticle \ + itemparticle \ system EXAMPLE_FILES = \ - images.qrc \ - itemparticle + images.qrc #Install shared images too qml.files = images diff --git a/examples/quick/particles/system/content/dynamiccomparison.qml b/examples/quick/particles/system/content/dynamiccomparison.qml index a2bbad4bff..c1d42863ee 100644 --- a/examples/quick/particles/system/content/dynamiccomparison.qml +++ b/examples/quick/particles/system/content/dynamiccomparison.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/system/content/dynamicemitters.qml b/examples/quick/particles/system/content/dynamicemitters.qml index f63f949dda..226e6de870 100644 --- a/examples/quick/particles/system/content/dynamicemitters.qml +++ b/examples/quick/particles/system/content/dynamicemitters.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/system/content/multiplepainters.qml b/examples/quick/particles/system/content/multiplepainters.qml index e43ed7b680..1f2dcb6214 100644 --- a/examples/quick/particles/system/content/multiplepainters.qml +++ b/examples/quick/particles/system/content/multiplepainters.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/system/content/startstop.qml b/examples/quick/particles/system/content/startstop.qml index 10ef7960bd..cf9ad3d79d 100644 --- a/examples/quick/particles/system/content/startstop.qml +++ b/examples/quick/particles/system/content/startstop.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/system/content/timedgroupchanges.qml b/examples/quick/particles/system/content/timedgroupchanges.qml index 9b505d43e7..9865d3294e 100644 --- a/examples/quick/particles/system/content/timedgroupchanges.qml +++ b/examples/quick/particles/system/content/timedgroupchanges.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/system/doc/src/system.qdoc b/examples/quick/particles/system/doc/src/system.qdoc index 2f4e712651..22382190d3 100644 --- a/examples/quick/particles/system/doc/src/system.qdoc +++ b/examples/quick/particles/system/doc/src/system.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/particles/system/main.cpp b/examples/quick/particles/system/main.cpp index 93a5788898..63a88412f5 100644 --- a/examples/quick/particles/system/main.cpp +++ b/examples/quick/particles/system/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/particles/system/system.qml b/examples/quick/particles/system/system.qml index 7572120277..569676d424 100644 --- a/examples/quick/particles/system/system.qml +++ b/examples/quick/particles/system/system.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/positioners/doc/src/positioners.qdoc b/examples/quick/positioners/doc/src/positioners.qdoc index 9d8827f65d..8200a14fb8 100644 --- a/examples/quick/positioners/doc/src/positioners.qdoc +++ b/examples/quick/positioners/doc/src/positioners.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/positioners/main.cpp b/examples/quick/positioners/main.cpp index 94a2792ddd..4233c4025c 100644 --- a/examples/quick/positioners/main.cpp +++ b/examples/quick/positioners/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/positioners/positioners-attachedproperties.qml b/examples/quick/positioners/positioners-attachedproperties.qml index e7fa59bb9a..af89543289 100644 --- a/examples/quick/positioners/positioners-attachedproperties.qml +++ b/examples/quick/positioners/positioners-attachedproperties.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/positioners/positioners-transitions.qml b/examples/quick/positioners/positioners-transitions.qml index 17fe41a7e2..fbaa05c81c 100644 --- a/examples/quick/positioners/positioners-transitions.qml +++ b/examples/quick/positioners/positioners-transitions.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/positioners/positioners.qml b/examples/quick/positioners/positioners.qml index 63a4d15fdc..b16df6858b 100644 --- a/examples/quick/positioners/positioners.qml +++ b/examples/quick/positioners/positioners.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/quick-accessibility/doc/src/accessibility.qdoc b/examples/quick/quick-accessibility/doc/src/accessibility.qdoc index 3b47753ba6..b31db0d313 100644 --- a/examples/quick/quick-accessibility/doc/src/accessibility.qdoc +++ b/examples/quick/quick-accessibility/doc/src/accessibility.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/quick-accessibility/main.cpp b/examples/quick/quick-accessibility/main.cpp index 099a41917b..46695ae066 100644 --- a/examples/quick/quick-accessibility/main.cpp +++ b/examples/quick/quick-accessibility/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/quick.pro b/examples/quick/quick.pro index 22dfff703e..0bb90e737b 100644 --- a/examples/quick/quick.pro +++ b/examples/quick/quick.pro @@ -10,6 +10,7 @@ SUBDIRS = quick-accessibility \ localstorage \ models \ views \ + tableview \ mousearea \ positioners \ righttoleft \ @@ -24,8 +25,8 @@ SUBDIRS = quick-accessibility \ imageresponseprovider \ window \ particles \ - shapes \ - demos + delegatechooser \ + shapes #OpenGL Support Required qtConfig(opengl(es1|es2)?) { @@ -37,7 +38,7 @@ qtConfig(opengl(es1|es2)?) { # Widget dependent examples qtHaveModule(widgets) { SUBDIRS += embeddedinwidgets - qtHaveModule(quickwidgets): SUBDIRS += quickwidgets + qtHaveModule(quickwidgets):qtConfig(opengl(es1|es2)?): SUBDIRS += quickwidgets } EXAMPLE_FILES = \ diff --git a/examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp b/examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp index 49c4450b89..139fcbae5c 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp +++ b/examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -228,7 +238,7 @@ void FbItemRenderer::setupVertexAttribs() QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions(); f->glEnableVertexAttribArray(0); f->glEnableVertexAttribArray(1); - f->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), 0); + f->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), nullptr); f->glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), reinterpret_cast<void *>(3 * sizeof(GLfloat))); m_logoVbo.release(); } diff --git a/examples/quick/quickwidgets/qquickviewcomparison/fbitem.h b/examples/quick/quickwidgets/qquickviewcomparison/fbitem.h index 85720f1c59..3a4c5a13c2 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/fbitem.h +++ b/examples/quick/quickwidgets/qquickviewcomparison/fbitem.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -54,9 +64,9 @@ class FbItemRenderer : public QQuickFramebufferObject::Renderer { public: FbItemRenderer(bool multisample); - void synchronize(QQuickFramebufferObject *item) Q_DECL_OVERRIDE; - void render() Q_DECL_OVERRIDE; - QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) Q_DECL_OVERRIDE; + void synchronize(QQuickFramebufferObject *item) override; + void render() override; + QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override; private: void ensureInit(); @@ -105,7 +115,7 @@ class FbItem : public QQuickFramebufferObject public: explicit FbItem(QQuickItem *parent = 0); - QQuickFramebufferObject::Renderer *createRenderer() const Q_DECL_OVERRIDE; + QQuickFramebufferObject::Renderer *createRenderer() const override; QVector3D eye() const { return m_eye; } void setEye(const QVector3D &v); diff --git a/examples/quick/quickwidgets/qquickviewcomparison/logo.cpp b/examples/quick/quickwidgets/qquickviewcomparison/logo.cpp index 05c6e4c1b5..b11c326034 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/logo.cpp +++ b/examples/quick/quickwidgets/qquickviewcomparison/logo.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/quickwidgets/qquickviewcomparison/logo.h b/examples/quick/quickwidgets/qquickviewcomparison/logo.h index 9ae2ca0725..6cb35a28c4 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/logo.h +++ b/examples/quick/quickwidgets/qquickviewcomparison/logo.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/quickwidgets/qquickviewcomparison/main.cpp b/examples/quick/quickwidgets/qquickviewcomparison/main.cpp index 7e45e42527..73db97eddb 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/main.cpp +++ b/examples/quick/quickwidgets/qquickviewcomparison/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -39,6 +49,8 @@ ****************************************************************************/ #include <QApplication> +#include <QCommandLineParser> +#include <QCommandLineOption> #include "mainwindow.h" @@ -48,8 +60,22 @@ int main(int argc, char **argv) QApplication app(argc, argv); - bool transparency = QCoreApplication::arguments().contains(QStringLiteral("--transparent")); - MainWindow widgetWindow(transparency); + QCoreApplication::setApplicationName("Qt QQuickView/QQuickWidget Comparison Example"); + QCoreApplication::setOrganizationName("QtProject"); + QCoreApplication::setApplicationVersion(QT_VERSION_STR); + QCommandLineParser parser; + parser.setApplicationDescription(QCoreApplication::applicationName()); + parser.addHelpOption(); + parser.addVersionOption(); + QCommandLineOption noRenderAlphaOption("no-render-alpha", "Do not render Alpha"); + parser.addOption(noRenderAlphaOption); + QCommandLineOption transparentOption("transparent", "Transparent window"); + parser.addOption(transparentOption); + + parser.process(app); + + const bool transparency = parser.isSet(transparentOption); + MainWindow widgetWindow(transparency, parser.isSet(noRenderAlphaOption)); if (transparency) { widgetWindow.setAttribute(Qt::WA_TranslucentBackground); widgetWindow.setAttribute(Qt::WA_NoSystemBackground, false); diff --git a/examples/quick/quickwidgets/qquickviewcomparison/mainwindow.cpp b/examples/quick/quickwidgets/qquickviewcomparison/mainwindow.cpp index ea6c7f2f9a..84e116dce6 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/mainwindow.cpp +++ b/examples/quick/quickwidgets/qquickviewcomparison/mainwindow.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -40,7 +50,6 @@ #include "mainwindow.h" #include "fbitem.h" -#include <QCoreApplication> #include <QVBoxLayout> #include <QGroupBox> #include <QRadioButton> @@ -48,10 +57,11 @@ #include <QLabel> #include <QQuickItem> -MainWindow::MainWindow(bool transparency) - : m_currentView(0), - m_currentRootObject(0), - m_transparent(transparency) +MainWindow::MainWindow(bool transparency, bool noRenderAlpha) + : m_currentView(nullptr), + m_currentRootObject(nullptr), + m_transparent(transparency), + m_noRenderAlpha(noRenderAlpha) { QVBoxLayout *layout = new QVBoxLayout; @@ -178,7 +188,7 @@ void MainWindow::updateView() if (m_currentRootObject) { m_currentRootObject->setProperty("currentText", text); m_currentRootObject->setProperty("multisample", m_checkboxMultiSample->isChecked()); - if (!QCoreApplication::arguments().contains(QStringLiteral("--no_render_alpha"))) + if (!m_noRenderAlpha) m_currentRootObject->setProperty("translucency", m_transparent); } diff --git a/examples/quick/quickwidgets/qquickviewcomparison/mainwindow.h b/examples/quick/quickwidgets/qquickviewcomparison/mainwindow.h index 5b86c93f38..d182b70960 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/mainwindow.h +++ b/examples/quick/quickwidgets/qquickviewcomparison/mainwindow.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -53,7 +63,7 @@ QT_FORWARD_DECLARE_CLASS(QLayout) class MainWindow : public QWidget { public: - MainWindow(bool transparency); + explicit MainWindow(bool transparency, bool noRenderAlpha); protected: void resizeEvent(QResizeEvent*); @@ -86,6 +96,7 @@ private: QSurfaceFormat m_format; bool m_transparent; + bool m_noRenderAlpha; }; #endif diff --git a/examples/quick/quickwidgets/qquickviewcomparison/test.qml b/examples/quick/quickwidgets/qquickviewcomparison/test.qml index 280beee92c..e142add084 100644 --- a/examples/quick/quickwidgets/qquickviewcomparison/test.qml +++ b/examples/quick/quickwidgets/qquickviewcomparison/test.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/quickwidgets/quickwidget/customgl.qml b/examples/quick/quickwidgets/quickwidget/customgl.qml index 81e33e1ac9..577f006bd7 100644 --- a/examples/quick/quickwidgets/quickwidget/customgl.qml +++ b/examples/quick/quickwidgets/quickwidget/customgl.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc b/examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc index 4b66dc33b5..9328c562b4 100644 --- a/examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc +++ b/examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/quickwidgets/quickwidget/fbitem.cpp b/examples/quick/quickwidgets/quickwidget/fbitem.cpp index cb3cc976fb..95ff2da2e0 100644 --- a/examples/quick/quickwidgets/quickwidget/fbitem.cpp +++ b/examples/quick/quickwidgets/quickwidget/fbitem.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -48,16 +58,16 @@ class FbRenderer : public QQuickFramebufferObject::Renderer { public: - FbRenderer() : c(0), dir(1) { } + FbRenderer() { } // The lifetime of the FBO and this class depends on how QQuickWidget // manages the scenegraph and context when it comes to showing and hiding // the widget. The actual behavior is proven by the debug prints. - ~FbRenderer() { + ~FbRenderer() override { qDebug("FbRenderer destroyed"); } - void render() { + void render() override { QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions(); f->glClearColor(c, 0, 0, 1); f->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); @@ -67,7 +77,7 @@ public: update(); } - QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) { + QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override { qDebug() << "Creating FBO" << size; QOpenGLFramebufferObjectFormat format; format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); @@ -75,8 +85,8 @@ public: } private: - float c; - int dir; + float c = 0; + int dir = 1; }; #endif diff --git a/examples/quick/quickwidgets/quickwidget/fbitem.h b/examples/quick/quickwidgets/quickwidget/fbitem.h index 59280eb3b8..7beb9874a5 100644 --- a/examples/quick/quickwidgets/quickwidget/fbitem.h +++ b/examples/quick/quickwidgets/quickwidget/fbitem.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/quickwidgets/quickwidget/main.cpp b/examples/quick/quickwidgets/quickwidget/main.cpp index 7cb35d7bcd..c54586c5de 100644 --- a/examples/quick/quickwidgets/quickwidget/main.cpp +++ b/examples/quick/quickwidgets/quickwidget/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -44,6 +54,9 @@ #include <QtWidgets> #include "fbitem.h" +static bool optMultipleSample = false; +static bool optCoreProfile = false; + class MainWindow : public QMainWindow { Q_OBJECT public: @@ -65,11 +78,11 @@ MainWindow::MainWindow() : m_quickWidget(new QQuickWidget) { QSurfaceFormat format; - if (QCoreApplication::arguments().contains(QStringLiteral("--coreprofile"))) { + if (optCoreProfile) { format.setVersion(4, 4); format.setProfile(QSurfaceFormat::CoreProfile); } - if (QCoreApplication::arguments().contains(QStringLiteral("--multisample"))) + if (optMultipleSample) format.setSamples(4); m_quickWidget->setFormat(format); @@ -184,6 +197,23 @@ int main(int argc, char **argv) { QApplication app(argc, argv); + QCoreApplication::setApplicationName("Qt QQuickWidget Example"); + QCoreApplication::setOrganizationName("QtProject"); + QCoreApplication::setApplicationVersion(QT_VERSION_STR); + QCommandLineParser parser; + parser.setApplicationDescription(QCoreApplication::applicationName()); + parser.addHelpOption(); + parser.addVersionOption(); + QCommandLineOption multipleSampleOption("multisample", "Multisampling"); + parser.addOption(multipleSampleOption); + QCommandLineOption coreProfileOption("coreprofile", "Use core profile"); + parser.addOption(coreProfileOption); + + parser.process(app); + + optMultipleSample = parser.isSet(multipleSampleOption); + optCoreProfile = parser.isSet(coreProfileOption); + qmlRegisterType<FbItem>("QuickWidgetExample", 1, 0, "FbItem"); MainWindow mainWindow; diff --git a/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml b/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml index 03b1114d20..5d3bb72fbe 100644 --- a/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml +++ b/examples/quick/quickwidgets/quickwidget/rotatingsquare.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/quickwidgets/quickwidget/rotatingsquaretab.qml b/examples/quick/quickwidgets/quickwidget/rotatingsquaretab.qml index 51c17b9ffb..116a8f8729 100644 --- a/examples/quick/quickwidgets/quickwidget/rotatingsquaretab.qml +++ b/examples/quick/quickwidgets/quickwidget/rotatingsquaretab.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/rendercontrol/cuberenderer.cpp b/examples/quick/rendercontrol/cuberenderer.cpp index 4651882542..f3ecfc2566 100644 --- a/examples/quick/rendercontrol/cuberenderer.cpp +++ b/examples/quick/rendercontrol/cuberenderer.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -50,10 +60,10 @@ CubeRenderer::CubeRenderer(QOffscreenSurface *offscreenSurface) : m_offscreenSurface(offscreenSurface), - m_context(0), - m_program(0), - m_vbo(0), - m_vao(0), + m_context(nullptr), + m_program(nullptr), + m_vbo(nullptr), + m_vao(nullptr), m_matrixLoc(0) { } @@ -170,7 +180,7 @@ void CubeRenderer::setupVertexAttribs() m_vbo->bind(); m_program->enableAttributeArray(0); m_program->enableAttributeArray(1); - m_context->functions()->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0); + m_context->functions()->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr); m_context->functions()->glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, (const void *)(36 * 3 * sizeof(GLfloat))); m_vbo->release(); diff --git a/examples/quick/rendercontrol/cuberenderer.h b/examples/quick/rendercontrol/cuberenderer.h index 58d5814650..c7655a3c8e 100644 --- a/examples/quick/rendercontrol/cuberenderer.h +++ b/examples/quick/rendercontrol/cuberenderer.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/rendercontrol/doc/src/rendercontrol.qdoc b/examples/quick/rendercontrol/doc/src/rendercontrol.qdoc index 0315aee738..026a6f5a09 100644 --- a/examples/quick/rendercontrol/doc/src/rendercontrol.qdoc +++ b/examples/quick/rendercontrol/doc/src/rendercontrol.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -28,6 +28,6 @@ /*! \title QQuickRenderControl Example \example rendercontrol - \brief Shows how to render a Qt Quick scene into a texture that is then used by a non-Quick based OpenGL renderer + \brief Shows how to render a Qt Quick scene into a texture that is then used by a non-Quick based OpenGL renderer. \image rendercontrol-example.jpg */ diff --git a/examples/quick/rendercontrol/main.cpp b/examples/quick/rendercontrol/main.cpp index 6442ad92b8..71903045cc 100644 --- a/examples/quick/rendercontrol/main.cpp +++ b/examples/quick/rendercontrol/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -39,6 +49,8 @@ ****************************************************************************/ #include <QGuiApplication> +#include <QCommandLineParser> +#include <QCommandLineOption> #include "window_singlethreaded.h" #include "window_multithreaded.h" @@ -46,8 +58,20 @@ int main(int argc, char **argv) { QGuiApplication app(argc, argv); + QCoreApplication::setApplicationName("Qt Render Control Example"); + QCoreApplication::setOrganizationName("QtProject"); + QCoreApplication::setApplicationVersion(QT_VERSION_STR); + QCommandLineParser parser; + parser.setApplicationDescription(QCoreApplication::applicationName()); + parser.addHelpOption(); + parser.addVersionOption(); + QCommandLineOption threadedOption("threaded", "Threaded Rendering"); + parser.addOption(threadedOption); + + parser.process(app); + QScopedPointer<QWindow> window; - if (QCoreApplication::arguments().contains(QLatin1String("--threaded"))) { + if (parser.isSet(threadedOption)) { qWarning("Using separate Qt Quick render thread"); window.reset(new WindowMultiThreaded); } else { diff --git a/examples/quick/rendercontrol/window_multithreaded.cpp b/examples/quick/rendercontrol/window_multithreaded.cpp index 013ee7c208..01d6b8b5b2 100644 --- a/examples/quick/rendercontrol/window_multithreaded.cpp +++ b/examples/quick/rendercontrol/window_multithreaded.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -77,13 +87,13 @@ static const QEvent::Type STOP = QEvent::Type(QEvent::User + 4); static const QEvent::Type UPDATE = QEvent::Type(QEvent::User + 5); QuickRenderer::QuickRenderer() - : m_context(0), - m_surface(0), - m_fbo(0), - m_window(0), - m_quickWindow(0), - m_renderControl(0), - m_cubeRenderer(0), + : m_context(nullptr), + m_surface(nullptr), + m_fbo(nullptr), + m_window(nullptr), + m_quickWindow(nullptr), + m_renderControl(nullptr), + m_cubeRenderer(nullptr), m_quit(false) { } @@ -152,10 +162,10 @@ void QuickRenderer::cleanup() m_renderControl->invalidate(); delete m_fbo; - m_fbo = 0; + m_fbo = nullptr; delete m_cubeRenderer; - m_cubeRenderer = 0; + m_cubeRenderer = nullptr; m_context->doneCurrent(); m_context->moveToThread(QCoreApplication::instance()->thread()); @@ -167,7 +177,7 @@ void QuickRenderer::ensureFbo() { if (m_fbo && m_fbo->size() != m_window->size() * m_window->devicePixelRatio()) { delete m_fbo; - m_fbo = 0; + m_fbo = nullptr; } if (!m_fbo) { @@ -217,15 +227,15 @@ class RenderControl : public QQuickRenderControl { public: RenderControl(QWindow *w) : m_window(w) { } - QWindow *renderWindow(QPoint *offset) Q_DECL_OVERRIDE; + QWindow *renderWindow(QPoint *offset) override; private: QWindow *m_window; }; WindowMultiThreaded::WindowMultiThreaded() - : m_qmlComponent(Q_NULLPTR), - m_rootItem(0), + : m_qmlComponent(nullptr), + m_rootItem(nullptr), m_quickInitialized(false), m_psrRequested(false) { diff --git a/examples/quick/rendercontrol/window_multithreaded.h b/examples/quick/rendercontrol/window_multithreaded.h index e8658c4a61..ded80a0064 100644 --- a/examples/quick/rendercontrol/window_multithreaded.h +++ b/examples/quick/rendercontrol/window_multithreaded.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -82,7 +92,7 @@ public: void aboutToQuit(); private: - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; void init(); void cleanup(); void ensureFbo(); @@ -110,11 +120,11 @@ public: ~WindowMultiThreaded(); protected: - void exposeEvent(QExposeEvent *e) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - bool event(QEvent *e) Q_DECL_OVERRIDE; + void exposeEvent(QExposeEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + bool event(QEvent *e) override; private slots: void run(); diff --git a/examples/quick/rendercontrol/window_singlethreaded.cpp b/examples/quick/rendercontrol/window_singlethreaded.cpp index bd4de9a7cb..ddbbfe4b52 100644 --- a/examples/quick/rendercontrol/window_singlethreaded.cpp +++ b/examples/quick/rendercontrol/window_singlethreaded.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -60,7 +70,7 @@ class RenderControl : public QQuickRenderControl { public: RenderControl(QWindow *w) : m_window(w) { } - QWindow *renderWindow(QPoint *offset) Q_DECL_OVERRIDE; + QWindow *renderWindow(QPoint *offset) override; private: QWindow *m_window; @@ -74,8 +84,8 @@ QWindow *RenderControl::renderWindow(QPoint *offset) } WindowSingleThreaded::WindowSingleThreaded() - : m_rootItem(0), - m_fbo(0), + : m_rootItem(nullptr), + m_fbo(nullptr), m_quickInitialized(false), m_quickReady(false), m_dpr(0) @@ -181,7 +191,7 @@ void WindowSingleThreaded::createFbo() void WindowSingleThreaded::destroyFbo() { delete m_fbo; - m_fbo = 0; + m_fbo = nullptr; } void WindowSingleThreaded::render() diff --git a/examples/quick/rendercontrol/window_singlethreaded.h b/examples/quick/rendercontrol/window_singlethreaded.h index 4736f036ad..44b79d9f51 100644 --- a/examples/quick/rendercontrol/window_singlethreaded.h +++ b/examples/quick/rendercontrol/window_singlethreaded.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -65,10 +75,10 @@ public: ~WindowSingleThreaded(); protected: - void exposeEvent(QExposeEvent *e) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE; + void exposeEvent(QExposeEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + void mousePressEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; private slots: void run(); diff --git a/examples/quick/righttoleft/doc/src/righttoleft.qdoc b/examples/quick/righttoleft/doc/src/righttoleft.qdoc index 5e6cd76b79..adc67de6f4 100644 --- a/examples/quick/righttoleft/doc/src/righttoleft.qdoc +++ b/examples/quick/righttoleft/doc/src/righttoleft.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/righttoleft/layoutdirection/layoutdirection.qml b/examples/quick/righttoleft/layoutdirection/layoutdirection.qml index b15433c5ca..4e3e93852c 100644 --- a/examples/quick/righttoleft/layoutdirection/layoutdirection.qml +++ b/examples/quick/righttoleft/layoutdirection/layoutdirection.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/righttoleft/layoutmirroring/layoutmirroring.qml b/examples/quick/righttoleft/layoutmirroring/layoutmirroring.qml index 11c7b9a95c..04d912eaa6 100644 --- a/examples/quick/righttoleft/layoutmirroring/layoutmirroring.qml +++ b/examples/quick/righttoleft/layoutmirroring/layoutmirroring.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/righttoleft/main.cpp b/examples/quick/righttoleft/main.cpp index e5ef4d5779..2b658a0a62 100644 --- a/examples/quick/righttoleft/main.cpp +++ b/examples/quick/righttoleft/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/righttoleft/righttoleft.qml b/examples/quick/righttoleft/righttoleft.qml index 62b8c8fddb..a9d8584835 100644 --- a/examples/quick/righttoleft/righttoleft.qml +++ b/examples/quick/righttoleft/righttoleft.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/righttoleft/textalignment/textalignment.qml b/examples/quick/righttoleft/textalignment/textalignment.qml index 36c56c7ae4..c5790027f2 100644 --- a/examples/quick/righttoleft/textalignment/textalignment.qml +++ b/examples/quick/righttoleft/textalignment/textalignment.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/customgeometry/beziercurve.cpp b/examples/quick/scenegraph/customgeometry/beziercurve.cpp index 750ff6aa3b..72fc7e6f1b 100644 --- a/examples/quick/scenegraph/customgeometry/beziercurve.cpp +++ b/examples/quick/scenegraph/customgeometry/beziercurve.cpp @@ -127,8 +127,8 @@ void BezierCurve::setSegmentCount(int count) //! [4] QSGNode *BezierCurve::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { - QSGGeometryNode *node = 0; - QSGGeometry *geometry = 0; + QSGGeometryNode *node = nullptr; + QSGGeometry *geometry = nullptr; if (!oldNode) { node = new QSGGeometryNode; diff --git a/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc b/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc index d0c4d5f9bb..959114b424 100644 --- a/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc +++ b/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/scenegraph/customgeometry/main.cpp b/examples/quick/scenegraph/customgeometry/main.cpp index bbbbf64c4c..6f3c24e87b 100644 --- a/examples/quick/scenegraph/customgeometry/main.cpp +++ b/examples/quick/scenegraph/customgeometry/main.cpp @@ -67,6 +67,6 @@ int main(int argc, char **argv) view.setSource(QUrl("qrc:///scenegraph/customgeometry/main.qml")); view.show(); - app.exec(); + return app.exec(); } //! [1] diff --git a/examples/quick/scenegraph/graph/doc/src/graph.qdoc b/examples/quick/scenegraph/graph/doc/src/graph.qdoc index e7c5d69efa..dbf3391209 100644 --- a/examples/quick/scenegraph/graph/doc/src/graph.qdoc +++ b/examples/quick/scenegraph/graph/doc/src/graph.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/scenegraph/graph/graph.cpp b/examples/quick/scenegraph/graph/graph.cpp index 6048a1032c..ccf98ef813 100644 --- a/examples/quick/scenegraph/graph/graph.cpp +++ b/examples/quick/scenegraph/graph/graph.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -93,7 +103,7 @@ QSGNode *Graph::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) if (rect.isEmpty()) { delete n; - return 0; + return nullptr; } if (!n) { diff --git a/examples/quick/scenegraph/graph/graph.h b/examples/quick/scenegraph/graph/graph.h index ce63aa2702..a1a00cb6dc 100644 --- a/examples/quick/scenegraph/graph/graph.h +++ b/examples/quick/scenegraph/graph/graph.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/graph/gridnode.cpp b/examples/quick/scenegraph/graph/gridnode.cpp index ad5da1e872..f2b4ca3cf8 100644 --- a/examples/quick/scenegraph/graph/gridnode.cpp +++ b/examples/quick/scenegraph/graph/gridnode.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/graph/gridnode.h b/examples/quick/scenegraph/graph/gridnode.h index fdc4967b8c..fa892d9169 100644 --- a/examples/quick/scenegraph/graph/gridnode.h +++ b/examples/quick/scenegraph/graph/gridnode.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/graph/linenode.cpp b/examples/quick/scenegraph/graph/linenode.cpp index 992e2d44c9..cb7f1c8e7f 100644 --- a/examples/quick/scenegraph/graph/linenode.cpp +++ b/examples/quick/scenegraph/graph/linenode.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -56,29 +66,29 @@ class LineShader : public QSGSimpleMaterialShader<LineMaterial> QSG_DECLARE_SIMPLE_SHADER(LineShader, LineMaterial) public: - LineShader() : id_color(-1), id_spread(-1), id_size(-1) { + LineShader() { setShaderSourceFile(QOpenGLShader::Vertex, ":/scenegraph/graph/shaders/line.vsh"); setShaderSourceFile(QOpenGLShader::Fragment, ":/scenegraph/graph/shaders/line.fsh"); } - QList<QByteArray> attributes() const { return QList<QByteArray>() << "pos" << "t"; } + QList<QByteArray> attributes() const override { return QList<QByteArray>() << "pos" << "t"; } - void updateState(const LineMaterial *m, const LineMaterial *) { + void updateState(const LineMaterial *m, const LineMaterial *) override { program()->setUniformValue(id_color, m->color); program()->setUniformValue(id_spread, m->spread); program()->setUniformValue(id_size, m->size); } - void resolveUniforms() { + void resolveUniforms() override { id_spread = program()->uniformLocation("spread"); id_size = program()->uniformLocation("size"); id_color = program()->uniformLocation("color"); } private: - int id_color; - int id_spread; - int id_size; + int id_color = -1; + int id_spread = -1; + int id_size = -1; }; struct LineVertex { diff --git a/examples/quick/scenegraph/graph/linenode.h b/examples/quick/scenegraph/graph/linenode.h index eeee13be67..e1c818a1d5 100644 --- a/examples/quick/scenegraph/graph/linenode.h +++ b/examples/quick/scenegraph/graph/linenode.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/graph/main.cpp b/examples/quick/scenegraph/graph/main.cpp index 86fd20b106..2406457ab5 100644 --- a/examples/quick/scenegraph/graph/main.cpp +++ b/examples/quick/scenegraph/graph/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/graph/main.qml b/examples/quick/scenegraph/graph/main.qml index a6b0f97bec..e3e23d760e 100644 --- a/examples/quick/scenegraph/graph/main.qml +++ b/examples/quick/scenegraph/graph/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/graph/noisynode.cpp b/examples/quick/scenegraph/graph/noisynode.cpp index 834151599b..de5a616da2 100644 --- a/examples/quick/scenegraph/graph/noisynode.cpp +++ b/examples/quick/scenegraph/graph/noisynode.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -40,6 +50,7 @@ #include "noisynode.h" +#include <QtCore/QRandomGenerator> #include <QtQuick/QSGSimpleMaterialShader> #include <QtQuick/QSGTexture> #include <QtQuick/QQuickWindow> @@ -61,14 +72,14 @@ class NoisyShader : public QSGSimpleMaterialShader<NoisyMaterial> QSG_DECLARE_SIMPLE_SHADER(NoisyShader, NoisyMaterial) public: - NoisyShader() : id_color(-1), id_texture(-1), id_textureSize(-1) { + NoisyShader() { setShaderSourceFile(QOpenGLShader::Vertex, ":/scenegraph/graph/shaders/noisy.vsh"); setShaderSourceFile(QOpenGLShader::Fragment, ":/scenegraph/graph/shaders/noisy.fsh"); } - QList<QByteArray> attributes() const { return QList<QByteArray>() << "aVertex" << "aTexCoord"; } + QList<QByteArray> attributes() const override { return QList<QByteArray>() << "aVertex" << "aTexCoord"; } - void updateState(const NoisyMaterial *m, const NoisyMaterial *) { + void updateState(const NoisyMaterial *m, const NoisyMaterial *) override { // Set the color program()->setUniformValue(id_color, m->color); @@ -82,7 +93,7 @@ public: program()->setUniformValue(id_textureSize, QSizeF(1.0 / s.width(), 1.0 / s.height())); } - void resolveUniforms() { + void resolveUniforms() override { id_texture = program()->uniformLocation("texture"); id_textureSize = program()->uniformLocation("textureSize"); id_color = program()->uniformLocation("color"); @@ -92,9 +103,9 @@ public: } private: - int id_color; - int id_texture; - int id_textureSize; + int id_color = -1; + int id_texture = -1; + int id_textureSize = -1; }; NoisyNode::NoisyNode(QQuickWindow *window) @@ -103,7 +114,7 @@ NoisyNode::NoisyNode(QQuickWindow *window) QImage image(NOISE_SIZE, NOISE_SIZE, QImage::Format_RGB32); uint *data = (uint *) image.bits(); for (int i=0; i<NOISE_SIZE * NOISE_SIZE; ++i) { - uint g = rand() & 0xff; + uint g = QRandomGenerator::global()->bounded(0xff); data[i] = 0xff000000 | (g << 16) | (g << 8) | g; } diff --git a/examples/quick/scenegraph/graph/noisynode.h b/examples/quick/scenegraph/graph/noisynode.h index 03c6dba593..eb7d835432 100644 --- a/examples/quick/scenegraph/graph/noisynode.h +++ b/examples/quick/scenegraph/graph/noisynode.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/graph/shaders/line.fsh b/examples/quick/scenegraph/graph/shaders/line.fsh index 5d38c46d4d..77e05a2d15 100644 --- a/examples/quick/scenegraph/graph/shaders/line.fsh +++ b/examples/quick/scenegraph/graph/shaders/line.fsh @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -44,7 +54,7 @@ uniform lowp float spread; varying lowp float vT; -#define PI 3.14159265359 +#define PI 3.14159265358979323846 void main(void) { diff --git a/examples/quick/scenegraph/graph/shaders/line.vsh b/examples/quick/scenegraph/graph/shaders/line.vsh index cd90ac3a42..4f00ab9e5d 100644 --- a/examples/quick/scenegraph/graph/shaders/line.vsh +++ b/examples/quick/scenegraph/graph/shaders/line.vsh @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/graph/shaders/noisy.fsh b/examples/quick/scenegraph/graph/shaders/noisy.fsh index 30b0def932..14ea675360 100644 --- a/examples/quick/scenegraph/graph/shaders/noisy.fsh +++ b/examples/quick/scenegraph/graph/shaders/noisy.fsh @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -45,7 +55,7 @@ uniform lowp vec4 color; varying highp vec2 vTexCoord; varying lowp vec2 vShadeCoord; -#define PI 3.14159265359 +#define PI 3.14159265358979323846 void main() { diff --git a/examples/quick/scenegraph/graph/shaders/noisy.vsh b/examples/quick/scenegraph/graph/shaders/noisy.vsh index f9bc7a8fa2..1f89dbcc29 100644 --- a/examples/quick/scenegraph/graph/shaders/noisy.vsh +++ b/examples/quick/scenegraph/graph/shaders/noisy.vsh @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc b/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc index 983acaf4f1..3d4f4443e9 100644 --- a/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc +++ b/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/scenegraph/openglunderqml/squircle.cpp b/examples/quick/scenegraph/openglunderqml/squircle.cpp index b7082892b8..d6f6b327f2 100644 --- a/examples/quick/scenegraph/openglunderqml/squircle.cpp +++ b/examples/quick/scenegraph/openglunderqml/squircle.cpp @@ -57,7 +57,7 @@ //! [7] Squircle::Squircle() : m_t(0) - , m_renderer(0) + , m_renderer(nullptr) { connect(this, &QQuickItem::windowChanged, this, &Squircle::handleWindowChanged); } @@ -95,7 +95,7 @@ void Squircle::cleanup() { if (m_renderer) { delete m_renderer; - m_renderer = 0; + m_renderer = nullptr; } } diff --git a/examples/quick/scenegraph/rendernode/customrenderitem.cpp b/examples/quick/scenegraph/rendernode/customrenderitem.cpp index 27c55bf86d..8f248e2ecb 100644 --- a/examples/quick/scenegraph/rendernode/customrenderitem.cpp +++ b/examples/quick/scenegraph/rendernode/customrenderitem.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/rendernode/customrenderitem.h b/examples/quick/scenegraph/rendernode/customrenderitem.h index 43b0b00ed5..a0ac3468e4 100644 --- a/examples/quick/scenegraph/rendernode/customrenderitem.h +++ b/examples/quick/scenegraph/rendernode/customrenderitem.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/rendernode/d3d12renderer.cpp b/examples/quick/scenegraph/rendernode/d3d12renderer.cpp index 9916769241..df0e29eb67 100644 --- a/examples/quick/scenegraph/rendernode/d3d12renderer.cpp +++ b/examples/quick/scenegraph/rendernode/d3d12renderer.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/rendernode/d3d12renderer.h b/examples/quick/scenegraph/rendernode/d3d12renderer.h index 1d2726819f..ec4b5f85e8 100644 --- a/examples/quick/scenegraph/rendernode/d3d12renderer.h +++ b/examples/quick/scenegraph/rendernode/d3d12renderer.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -45,7 +55,7 @@ #if QT_CONFIG(d3d12) -class QQuickItem; +QT_FORWARD_DECLARE_CLASS(QQuickItem) #include <d3d12.h> #include <wrl/client.h> diff --git a/examples/quick/scenegraph/rendernode/main.cpp b/examples/quick/scenegraph/rendernode/main.cpp index 3e1714313e..21419abfc9 100644 --- a/examples/quick/scenegraph/rendernode/main.cpp +++ b/examples/quick/scenegraph/rendernode/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,6 +48,8 @@ ** ****************************************************************************/ +#include <QCommandLineParser> +#include <QCommandLineOption> #include <QGuiApplication> #include <QQuickView> #include "customrenderitem.h" @@ -50,7 +62,19 @@ int main(int argc, char **argv) QQuickView view; - if (QCoreApplication::arguments().contains(QStringLiteral("--multisample"))) { + QCoreApplication::setApplicationName("Qt Scene Graph Render Node Example"); + QCoreApplication::setOrganizationName("QtProject"); + QCoreApplication::setApplicationVersion(QT_VERSION_STR); + QCommandLineParser parser; + parser.setApplicationDescription(QCoreApplication::applicationName()); + parser.addHelpOption(); + parser.addVersionOption(); + QCommandLineOption multipleSampleOption("multisample", "Multisampling"); + parser.addOption(multipleSampleOption); + + parser.process(app); + + if (parser.isSet(multipleSampleOption)) { QSurfaceFormat fmt; fmt.setSamples(4); view.setFormat(fmt); diff --git a/examples/quick/scenegraph/rendernode/main.qml b/examples/quick/scenegraph/rendernode/main.qml index 7c8d82181f..d0ba4a4669 100644 --- a/examples/quick/scenegraph/rendernode/main.qml +++ b/examples/quick/scenegraph/rendernode/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/rendernode/openglrenderer.cpp b/examples/quick/scenegraph/rendernode/openglrenderer.cpp index c84867797d..3c68830db6 100644 --- a/examples/quick/scenegraph/rendernode/openglrenderer.cpp +++ b/examples/quick/scenegraph/rendernode/openglrenderer.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/rendernode/openglrenderer.h b/examples/quick/scenegraph/rendernode/openglrenderer.h index ea2bbcbc38..ac640405c5 100644 --- a/examples/quick/scenegraph/rendernode/openglrenderer.h +++ b/examples/quick/scenegraph/rendernode/openglrenderer.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -51,6 +61,8 @@ class QQuickItem; class QOpenGLShaderProgram; class QOpenGLBuffer; +QT_END_NAMESPACE + class OpenGLRenderNode : public QSGRenderNode { public: @@ -73,8 +85,6 @@ private: QOpenGLBuffer *m_vbo = nullptr; }; -QT_END_NAMESPACE - #endif // opengl #endif diff --git a/examples/quick/scenegraph/rendernode/softwarerenderer.cpp b/examples/quick/scenegraph/rendernode/softwarerenderer.cpp index f4ee976705..0a0ec4b485 100644 --- a/examples/quick/scenegraph/rendernode/softwarerenderer.cpp +++ b/examples/quick/scenegraph/rendernode/softwarerenderer.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -88,7 +98,7 @@ void SoftwareRenderNode::render(const RenderState *renderState) QSGRenderNode::StateFlags SoftwareRenderNode::changedStates() const { - return 0; + return nullptr; } QSGRenderNode::RenderingFlags SoftwareRenderNode::flags() const diff --git a/examples/quick/scenegraph/rendernode/softwarerenderer.h b/examples/quick/scenegraph/rendernode/softwarerenderer.h index e91ca92d88..cc2aaf7ed3 100644 --- a/examples/quick/scenegraph/rendernode/softwarerenderer.h +++ b/examples/quick/scenegraph/rendernode/softwarerenderer.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/sgengine/main.cpp b/examples/quick/scenegraph/sgengine/main.cpp index eae92d3e2a..a4dd3a6b72 100644 --- a/examples/quick/scenegraph/sgengine/main.cpp +++ b/examples/quick/scenegraph/sgengine/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/sgengine/window.cpp b/examples/quick/scenegraph/sgengine/window.cpp index 759bbf1fcd..6f22510a81 100644 --- a/examples/quick/scenegraph/sgengine/window.cpp +++ b/examples/quick/scenegraph/sgengine/window.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -48,6 +58,7 @@ #include <QScreen> #include <QVariantAnimation> #include <QOpenGLFunctions> +#include <QRandomGenerator> class Item { public: @@ -61,9 +72,9 @@ public: transformNode->appendChildNode(textureNode); parentNode->appendChildNode(transformNode); - int duration = qrand() / float(RAND_MAX) * 400 + 800; - rotAnimation.setStartValue(qrand() / float(RAND_MAX) * 720 - 180); - rotAnimation.setEndValue(qrand() / float(RAND_MAX) * 720 - 180); + int duration = QRandomGenerator::global()->generateDouble() * 400 + 800; + rotAnimation.setStartValue(QRandomGenerator::global()->generateDouble() * 720 - 180); + rotAnimation.setEndValue(QRandomGenerator::global()->generateDouble() * 720 - 180); rotAnimation.setDuration(duration); rotAnimation.start(); @@ -171,9 +182,9 @@ void Window::addItems() QSGTexture *textures[] = { m_smileTexture.data(), m_qtTexture.data() }; for (int i = 0; i < 50; ++i) { QSGTexture *tex = textures[i%2]; - QPointF fromPos(-tex->textureSize().width(), qrand() / float(RAND_MAX) * (height() - tex->textureSize().height())); - QPointF toPos(width(), qrand() / float(RAND_MAX) * height() * 1.5 - height() * 0.25); - m_items.append(QSharedPointer<Item>(new Item(m_sgRootNode.data(), tex, fromPos, toPos))); + QPointF fromPos(-tex->textureSize().width(), QRandomGenerator::global()->generateDouble() * (height() - tex->textureSize().height())); + QPointF toPos(width(), QRandomGenerator::global()->generateDouble() * height() * 1.5 - height() * 0.25); + m_items.append(QSharedPointer<Item>::create(m_sgRootNode.data(), tex, fromPos, toPos)); } update(); } diff --git a/examples/quick/scenegraph/sgengine/window.h b/examples/quick/scenegraph/sgengine/window.h index 3557218e80..1b27467b06 100644 --- a/examples/quick/scenegraph/sgengine/window.h +++ b/examples/quick/scenegraph/sgengine/window.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/shared/logorenderer.cpp b/examples/quick/scenegraph/shared/logorenderer.cpp index 8eb2d44c1e..0c34fb4402 100644 --- a/examples/quick/scenegraph/shared/logorenderer.cpp +++ b/examples/quick/scenegraph/shared/logorenderer.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -41,7 +51,7 @@ #include "logorenderer.h" #include <QPainter> #include <QPaintEngine> -#include <math.h> +#include <qmath.h> LogoRenderer::LogoRenderer() { @@ -166,7 +176,7 @@ void LogoRenderer::createGeometry() extrude(x4, y4, y4, x4); extrude(y4, x4, y3, x3); - const qreal Pi = 3.14159f; + const qreal Pi = M_PI; const int NumSectors = 100; for (int i = 0; i < NumSectors; ++i) { diff --git a/examples/quick/scenegraph/shared/logorenderer.h b/examples/quick/scenegraph/shared/logorenderer.h index 3e4764c7b8..6e7c4b897f 100644 --- a/examples/quick/scenegraph/shared/logorenderer.h +++ b/examples/quick/scenegraph/shared/logorenderer.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc b/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc index d6eb711929..67ca2d8dbd 100644 --- a/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc +++ b/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/scenegraph/simplematerial/simplematerial.cpp b/examples/quick/scenegraph/simplematerial/simplematerial.cpp index 96c08aff04..6773b6fb5a 100644 --- a/examples/quick/scenegraph/simplematerial/simplematerial.cpp +++ b/examples/quick/scenegraph/simplematerial/simplematerial.cpp @@ -87,7 +87,7 @@ class Shader : public QSGSimpleMaterialShader<State> //! [2] //! [3] public: - const char *vertexShader() const { + const char *vertexShader() const override { return "attribute highp vec4 aVertex; \n" "attribute highp vec2 aTexCoord; \n" @@ -99,7 +99,7 @@ public: "}"; } - const char *fragmentShader() const { + const char *fragmentShader() const override { return "uniform lowp float qt_Opacity; \n" "uniform lowp vec4 color; \n" @@ -110,17 +110,17 @@ public: "}"; } //! [3] //! [4] - QList<QByteArray> attributes() const + QList<QByteArray> attributes() const override { return QList<QByteArray>() << "aVertex" << "aTexCoord"; } //! [4] //! [5] - void updateState(const State *state, const State *) + void updateState(const State *state, const State *) override { program()->setUniformValue(id_color, state->color); } //! [5] //! [6] - void resolveUniforms() + void resolveUniforms() override { id_color = program()->uniformLocation("color"); } @@ -184,7 +184,7 @@ private: //! [8] //! [9] public: - QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *) + QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *) override { ColorNode *n = static_cast<ColorNode *>(node); if (!node) diff --git a/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc b/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc index d0a73e4e8c..c1c830338b 100644 --- a/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc +++ b/examples/quick/scenegraph/textureinsgnode/doc/src/textureinsgnode.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp b/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp index c6c9c32671..8ba5bddb2a 100644 --- a/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp +++ b/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -54,12 +64,12 @@ public: logo.initialize(); } - void render() { + void render() override { logo.render(); update(); } - QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) { + QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override { QOpenGLFramebufferObjectFormat format; format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); format.setSamples(4); diff --git a/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.h b/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.h index 5ab80bb9eb..e1a9ce22c8 100644 --- a/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.h +++ b/examples/quick/scenegraph/textureinsgnode/fboinsgrenderer.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/textureinsgnode/main.cpp b/examples/quick/scenegraph/textureinsgnode/main.cpp index d9c81da218..8eececc0aa 100644 --- a/examples/quick/scenegraph/textureinsgnode/main.cpp +++ b/examples/quick/scenegraph/textureinsgnode/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/textureinsgnode/main.qml b/examples/quick/scenegraph/textureinsgnode/main.qml index fe145b0f05..92fa99e847 100644 --- a/examples/quick/scenegraph/textureinsgnode/main.qml +++ b/examples/quick/scenegraph/textureinsgnode/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -64,7 +74,7 @@ Item { uniform highp vec2 pixelSize; varying highp vec2 qt_TexCoord0; void main() { - highp vec2 tc = sign(sin(3.14152 * qt_TexCoord0 * pixelSize)); + highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize)); if (tc.x != tc.y) gl_FragColor = color1; else diff --git a/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc b/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc index c94ddbe096..b8446ec212 100644 --- a/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc +++ b/examples/quick/scenegraph/textureinthread/doc/src/textureinthread.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/scenegraph/textureinthread/error.qml b/examples/quick/scenegraph/textureinthread/error.qml index ae769305e1..6c300af808 100644 --- a/examples/quick/scenegraph/textureinthread/error.qml +++ b/examples/quick/scenegraph/textureinthread/error.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/textureinthread/main.cpp b/examples/quick/scenegraph/textureinthread/main.cpp index 61d1c5e6dc..7a46f25390 100644 --- a/examples/quick/scenegraph/textureinthread/main.cpp +++ b/examples/quick/scenegraph/textureinthread/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/textureinthread/main.qml b/examples/quick/scenegraph/textureinthread/main.qml index 9108f0281d..eefee92f15 100644 --- a/examples/quick/scenegraph/textureinthread/main.qml +++ b/examples/quick/scenegraph/textureinthread/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -64,7 +74,7 @@ Item { uniform highp vec2 pixelSize; varying highp vec2 qt_TexCoord0; void main() { - highp vec2 tc = sign(sin(3.14152 * qt_TexCoord0 * pixelSize)); + highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize)); if (tc.x != tc.y) gl_FragColor = color1; else diff --git a/examples/quick/scenegraph/textureinthread/threadrenderer.cpp b/examples/quick/scenegraph/textureinthread/threadrenderer.cpp index 95fd377dcf..c364d0b7dd 100644 --- a/examples/quick/scenegraph/textureinthread/threadrenderer.cpp +++ b/examples/quick/scenegraph/textureinthread/threadrenderer.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -64,11 +74,11 @@ class RenderThread : public QThread Q_OBJECT public: RenderThread(const QSize &size) - : surface(0) - , context(0) - , m_renderFbo(0) - , m_displayFbo(0) - , m_logoRenderer(0) + : surface(nullptr) + , context(nullptr) + , m_renderFbo(nullptr) + , m_displayFbo(nullptr) + , m_logoRenderer(nullptr) , m_size(size) { ThreadRenderer::threads << this; @@ -146,7 +156,7 @@ public: TextureNode(QQuickWindow *window) : m_id(0) , m_size(0, 0) - , m_texture(0) + , m_texture(nullptr) , m_window(window) { // Our texture node must have a texture, so use the default 0 texture. @@ -155,7 +165,7 @@ public: setFiltering(QSGTexture::Linear); } - ~TextureNode() + ~TextureNode() override { delete m_texture; } @@ -214,7 +224,7 @@ private: }; ThreadRenderer::ThreadRenderer() - : m_renderThread(0) + : m_renderThread(nullptr) { setFlag(ItemHasContents, true); m_renderThread = new RenderThread(QSize(512, 512)); @@ -254,7 +264,7 @@ QSGNode *ThreadRenderer::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData * current->makeCurrent(window()); QMetaObject::invokeMethod(this, "ready"); - return 0; + return nullptr; } if (!node) { diff --git a/examples/quick/scenegraph/textureinthread/threadrenderer.h b/examples/quick/scenegraph/textureinthread/threadrenderer.h index c8fc3596d7..8442041bf8 100644 --- a/examples/quick/scenegraph/textureinthread/threadrenderer.h +++ b/examples/quick/scenegraph/textureinthread/threadrenderer.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/threadedanimation/spinner.cpp b/examples/quick/scenegraph/threadedanimation/spinner.cpp index 7b4281aafc..c19354b3f5 100644 --- a/examples/quick/scenegraph/threadedanimation/spinner.cpp +++ b/examples/quick/scenegraph/threadedanimation/spinner.cpp @@ -66,8 +66,8 @@ public: , m_spinning(false) , m_window(window) { - connect(window, &QQuickWindow::beforeRendering, this, &SpinnerNode::maybeRotate); - connect(window, &QQuickWindow::frameSwapped, this, &SpinnerNode::maybeUpdate); + connect(window, &QQuickWindow::beforeRendering, this, &SpinnerNode::maybeRotate, Qt::DirectConnection); + connect(window, &QQuickWindow::frameSwapped, this, &SpinnerNode::maybeUpdate, Qt::DirectConnection); QImage image(":/scenegraph/threadedanimation/spinner.png"); m_texture = window->createTextureFromImage(image); @@ -78,7 +78,7 @@ public: appendChildNode(textureNode); } - ~SpinnerNode() { + ~SpinnerNode() override { delete m_texture; } @@ -96,6 +96,9 @@ public slots: matrix.rotate(m_rotation, 0, 0, 1); matrix.translate(-32, -32); setMatrix(matrix); + + // If we're inside a QQuickWidget, this call is necessary to ensure the widget gets updated. + m_window->update(); } } diff --git a/examples/quick/scenegraph/twotextureproviders/doc/src/twotextureproviders.qdoc b/examples/quick/scenegraph/twotextureproviders/doc/src/twotextureproviders.qdoc index fb9e7a8031..ad0eb849e3 100644 --- a/examples/quick/scenegraph/twotextureproviders/doc/src/twotextureproviders.qdoc +++ b/examples/quick/scenegraph/twotextureproviders/doc/src/twotextureproviders.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2014 Gunnar Sletta <gunnar@sletta.org> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/scenegraph/twotextureproviders/main.cpp b/examples/quick/scenegraph/twotextureproviders/main.cpp index 8c4362cd88..a5d23b6adc 100644 --- a/examples/quick/scenegraph/twotextureproviders/main.cpp +++ b/examples/quick/scenegraph/twotextureproviders/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2014 Gunnar Sletta <gunnar@sletta.org> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/scenegraph/twotextureproviders/main.qml b/examples/quick/scenegraph/twotextureproviders/main.qml index af07f9badd..296df766a1 100644 --- a/examples/quick/scenegraph/twotextureproviders/main.qml +++ b/examples/quick/scenegraph/twotextureproviders/main.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2014 Gunnar Sletta <gunnar@sletta.org> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -61,7 +71,7 @@ Item { uniform highp vec2 pixelSize; varying highp vec2 qt_TexCoord0; void main() { - highp vec2 tc = sign(sin(3.14152 * qt_TexCoord0 * pixelSize)); + highp vec2 tc = sign(sin(3.14159265358979323846 * qt_TexCoord0 * pixelSize)); if (tc.x != tc.y) gl_FragColor = color1; else diff --git a/examples/quick/scenegraph/twotextureproviders/xorblender.cpp b/examples/quick/scenegraph/twotextureproviders/xorblender.cpp index 0dd035ffea..8d7597addf 100644 --- a/examples/quick/scenegraph/twotextureproviders/xorblender.cpp +++ b/examples/quick/scenegraph/twotextureproviders/xorblender.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2014 Gunnar Sletta <gunnar@sletta.org> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -67,7 +77,7 @@ class XorBlendShader : public QSGSimpleMaterialShader<XorBlendState> QSG_DECLARE_SIMPLE_SHADER(XorBlendShader, XorBlendState) public: - const char *vertexShader() const { + const char *vertexShader() const override { return "attribute highp vec4 aVertex; \n" "attribute highp vec2 aTexCoord; \n" @@ -79,7 +89,7 @@ public: "}"; } - const char *fragmentShader() const { + const char *fragmentShader() const override { return "uniform lowp float qt_Opacity; \n" "uniform lowp sampler2D uSource1; \n" @@ -92,11 +102,11 @@ public: "}"; } - QList<QByteArray> attributes() const { + QList<QByteArray> attributes() const override { return QList<QByteArray>() << "aVertex" << "aTexCoord"; } - void updateState(const XorBlendState *state, const XorBlendState *) { + void updateState(const XorBlendState *state, const XorBlendState *) override { QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions(); // We bind the textures in inverse order so that we leave the updateState // function with GL_TEXTURE0 as the active texture unit. This is maintain @@ -108,7 +118,7 @@ public: state->texture1->bind(); } - void resolveUniforms() { + void resolveUniforms() override { // The texture units never change, only the texturess we bind to them so // we set these once and for all here. program()->setUniformValue("uSource1", 0); // GL_TEXTURE0 @@ -139,8 +149,8 @@ public: // Set up material so it is all set for later.. m_material = XorBlendShader::createMaterial(); - m_material->state()->texture1 = 0; - m_material->state()->texture2 = 0; + m_material->state()->texture1 = nullptr; + m_material->state()->texture2 = nullptr; m_material->setFlag(QSGMaterial::Blending); m_node.setMaterial(m_material); m_node.setFlag(QSGNode::OwnsMaterial); @@ -155,7 +165,7 @@ public: connect(m_provider2.data(), &QSGTextureProvider::textureChanged, this, &XorNode::textureChange, Qt::DirectConnection); } - void preprocess() { + void preprocess() override { XorBlendState *state = m_material->state(); // Update the textures from the providers, calling into QSGDynamicTexture if required if (m_provider1) { @@ -204,8 +214,8 @@ private: XorBlender::XorBlender(QQuickItem *parent) : QQuickItem(parent) - , m_source1(0) - , m_source2(0) + , m_source1(nullptr) + , m_source2(nullptr) , m_source1Changed(false) , m_source2Changed(false) { @@ -246,7 +256,7 @@ QSGNode *XorBlender::updatePaintNode(QSGNode *old, UpdatePaintNodeData *) } if (abort) { delete old; - return 0; + return nullptr; } XorNode *node = static_cast<XorNode *>(old); @@ -254,7 +264,7 @@ QSGNode *XorBlender::updatePaintNode(QSGNode *old, UpdatePaintNodeData *) // If the sources have changed, recreate the nodes if (m_source1Changed || m_source2Changed) { delete node; - node = 0; + node = nullptr; m_source1Changed = false; m_source2Changed = false; } diff --git a/examples/quick/scenegraph/twotextureproviders/xorblender.h b/examples/quick/scenegraph/twotextureproviders/xorblender.h index 156265e154..94132f09fb 100644 --- a/examples/quick/scenegraph/twotextureproviders/xorblender.h +++ b/examples/quick/scenegraph/twotextureproviders/xorblender.h @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2014 Gunnar Sletta <gunnar@sletta.org> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/shadereffects/doc/src/shadereffects.qdoc b/examples/quick/shadereffects/doc/src/shadereffects.qdoc index 7b1d68ebb5..8cb4024da2 100644 --- a/examples/quick/shadereffects/doc/src/shadereffects.qdoc +++ b/examples/quick/shadereffects/doc/src/shadereffects.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/shadereffects/main.cpp b/examples/quick/shadereffects/main.cpp index 7d08cf6608..9f649e2f94 100644 --- a/examples/quick/shadereffects/main.cpp +++ b/examples/quick/shadereffects/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/shapes/content/pathitemtigers.qml b/examples/quick/shapes/content/clippedtigers.qml index c55efdc403..c55efdc403 100644 --- a/examples/quick/shapes/content/pathitemtigers.qml +++ b/examples/quick/shapes/content/clippedtigers.qml diff --git a/examples/quick/shapes/content/pathiteminteract.qml b/examples/quick/shapes/content/interactive.qml index 55a1d16299..55a1d16299 100644 --- a/examples/quick/shapes/content/pathiteminteract.qml +++ b/examples/quick/shapes/content/interactive.qml diff --git a/examples/quick/shapes/content/item10.qml b/examples/quick/shapes/content/item10.qml index cb2444fe4b..e91342c2fe 100644 --- a/examples/quick/shapes/content/item10.qml +++ b/examples/quick/shapes/content/item10.qml @@ -66,7 +66,18 @@ Rectangle { ShapePath { strokeWidth: 4 strokeColor: "black" - fillColor: "lightBlue" + fillGradient: ConicalGradient { + id: conGrad + centerX: 100; centerY: 75 + NumberAnimation on angle { from: 0; to: 360; duration: 10000; loops: Animation.Infinite } + GradientStop { position: 0; color: "#00000000" } + GradientStop { position: 0.10; color: "#ffe0cc73" } + GradientStop { position: 0.17; color: "#ffc6a006" } + GradientStop { position: 0.46; color: "#ff600659" } + GradientStop { position: 0.72; color: "#ff0680ac" } + GradientStop { position: 0.92; color: "#ffb9d9e6" } + GradientStop { position: 1.00; color: "#00000000" } + } startX: 50; startY: 100 PathCubic { @@ -154,4 +165,10 @@ Rectangle { } } } + + Text { + anchors.right: parent.right + anchors.top: parent.top + text: "Conical gradient angle: " + Math.round(conGrad.angle) + } } diff --git a/examples/quick/shapes/content/item11.qml b/examples/quick/shapes/content/item11.qml index 0cfe73d5c9..bdd08339e3 100644 --- a/examples/quick/shapes/content/item11.qml +++ b/examples/quick/shapes/content/item11.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.9 +import QtQuick 2.11 import QtQuick.Shapes 1.0 Rectangle { @@ -100,11 +100,15 @@ Rectangle { strokeWidth: 20 capStyle: ShapePath.RoundCap - startX: 20; startY: 50 - PathArc { - x: 20; y: 90 + PathAngleArc { + centerX: 65; centerY: 95 radiusX: 45; radiusY: 45 - useLargeArc: true + startAngle: -180 + SequentialAnimation on sweepAngle { + loops: Animation.Infinite + NumberAnimation { to: 360; duration: 2000 } + NumberAnimation { to: 0; duration: 2000 } + } } } } diff --git a/examples/quick/shapes/content/item3.qml b/examples/quick/shapes/content/item3.qml new file mode 100644 index 0000000000..4274f260f3 --- /dev/null +++ b/examples/quick/shapes/content/item3.qml @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQuick module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Shapes 1.0 + +Rectangle { + color: "lightGray" + Shape { + width: 200 + height: 150 + anchors.centerIn: parent + ShapePath { + strokeWidth: 4 + strokeColor: "red" + fillGradient: RadialGradient { + centerX: 100; centerY: 100; centerRadius: 100 + SequentialAnimation on focalRadius { + loops: Animation.Infinite + NumberAnimation { from: 1; to: 20; duration: 2000 } + NumberAnimation { from: 20; to: 1; duration: 2000 } + } + SequentialAnimation on focalX { + loops: Animation.Infinite + NumberAnimation { from: 50; to: 150; duration: 3000 } + NumberAnimation { from: 150; to: 50; duration: 3000 } + } + SequentialAnimation on focalY { + loops: Animation.Infinite + NumberAnimation { from: 50; to: 150; duration: 1000 } + NumberAnimation { from: 150; to: 50; duration: 1000 } + } + GradientStop { position: 0; color: "#ffffff" } + GradientStop { position: 0.11; color: "#f9ffa0" } + GradientStop { position: 0.13; color: "#f9ff99" } + GradientStop { position: 0.14; color: "#f3ff86" } + GradientStop { position: 0.49; color: "#93b353" } + GradientStop { position: 0.87; color: "#264619" } + GradientStop { position: 0.96; color: "#0c1306" } + GradientStop { position: 1; color: "#000000" } + } + fillColor: "blue" // ignored with the gradient set + strokeStyle: ShapePath.DashLine + dashPattern: [ 1, 4 ] + startX: 20; startY: 20 + PathLine { x: 180; y: 130 } + PathLine { x: 20; y: 130 } + PathLine { x: 20; y: 20 } + } + } +} diff --git a/examples/quick/shapes/content/pathitem.qml b/examples/quick/shapes/content/main.qml index 0933aa79b2..8efa47d30b 100644 --- a/examples/quick/shapes/content/pathitem.qml +++ b/examples/quick/shapes/content/main.qml @@ -51,15 +51,15 @@ import QtQuick 2.0 Item { - width: 1024 - height: 768 + width: 1280 + height: 720 LauncherList { anchors.fill: parent Component.onCompleted: { - addExample("Shape Gallery", "Simple path rendering examples", Qt.resolvedUrl("pathitemgallery.qml")) - addExample("Interactive Shape", "Dynamic, interactive path rendering examples", Qt.resolvedUrl("pathiteminteract.qml")) - addExample("Super- and multisampling", "Improving quality", Qt.resolvedUrl("pathitemsampling.qml")) - addExample("Clip My Tiger!", "Clip examples, a.k.a. What Not To Do", Qt.resolvedUrl("pathitemtigers.qml")) + addExample("Shape Gallery", "Simple path rendering examples", Qt.resolvedUrl("shapegallery.qml")) + addExample("Interactive Shape", "Dynamic, interactive path rendering examples", Qt.resolvedUrl("interactive.qml")) + addExample("Super- and multisampling", "Improving quality", Qt.resolvedUrl("sampling.qml")) + addExample("Clip My Tiger!", "Clip examples, a.k.a. What Not To Do", Qt.resolvedUrl("clippedtigers.qml")) } } } diff --git a/examples/quick/shapes/content/pathitemsampling.qml b/examples/quick/shapes/content/sampling.qml index 6b651f8a1d..6b651f8a1d 100644 --- a/examples/quick/shapes/content/pathitemsampling.qml +++ b/examples/quick/shapes/content/sampling.qml diff --git a/examples/quick/shapes/content/pathitemgallery.qml b/examples/quick/shapes/content/shapegallery.qml index 3b418639ee..86445e25c2 100644 --- a/examples/quick/shapes/content/pathitemgallery.qml +++ b/examples/quick/shapes/content/shapegallery.qml @@ -68,7 +68,7 @@ Rectangle { id: pathGalleryModel ListElement { name: "Stroke and fill" - shapeUrl: "item1.qml" + shapeUrl: "tapableTriangle.qml" } ListElement { name: "Stroke or fill only" @@ -83,6 +83,10 @@ Rectangle { shapeUrl: "item5.qml" } ListElement { + name: "Radial gradient" + shapeUrl: "item3.qml" + } + ListElement { name: "Fill rules" shapeUrl: "item6.qml" } @@ -180,7 +184,7 @@ Rectangle { color: "darkBlue" font.pointSize: 12 property variant rendererStrings: [ "Unknown", "Generic (QtGui triangulator)", "GL_NV_path_rendering", "Software (QPainter)" ] - text: "Active Shape backend: " + rendererStrings[dummyShape.renderer] + text: "Active Shape backend: " + rendererStrings[dummyShape.rendererType] SequentialAnimation on opacity { NumberAnimation { from: 1; to: 0; duration: 5000 } PauseAnimation { duration: 5000 } diff --git a/examples/quick/shapes/content/item1.qml b/examples/quick/shapes/content/tapableTriangle.qml index 9328979324..22ed577bcb 100644 --- a/examples/quick/shapes/content/item1.qml +++ b/examples/quick/shapes/content/tapableTriangle.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -48,15 +48,21 @@ ** ****************************************************************************/ -import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick 2.12 +import QtQuick.Shapes 1.12 Rectangle { - color: "lightGray" + width: 120 + height: 120 + color: th.pressed ? "steelBlue" : "lightGray" + containmentMask: ctr + + TapHandler { id: th } Shape { id: ctr anchors.fill: parent + containsMode: Shape.FillContains ShapePath { strokeColor: "red" diff --git a/examples/quick/shapes/content/tiger.qml b/examples/quick/shapes/content/tiger.qml index 50cb103d50..317ec88b31 100644 --- a/examples/quick/shapes/content/tiger.qml +++ b/examples/quick/shapes/content/tiger.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -48,13 +48,12 @@ ** ****************************************************************************/ -import QtQuick 2.9 -import QtQuick.Shapes 1.0 +import QtQuick 2.12 +import QtQuick.Shapes 1.12 Shape { asynchronous: true - - anchors.fill: parent + width: 494; height: 510 ShapePath { fillColor: "#ffffff" @@ -3616,4 +3615,100 @@ Shape { PathMove { x: 20.5; y: 344.5 } PathCubic { control1X: 20.5; control1Y: 344.5; control2X: 22; control2Y: 333.5; x: 10.5; y: 346.5 } } + + Shape { + x: -184; y: -144; width: parent.width; height: parent.height + opacity: tapHandler.pressed ? 1 : 0 + containsMode: Shape.FillContains + + TapHandler { id: tapHandler } + + ShapePath { + strokeColor: "red" + strokeWidth: 4 + fillColor: "transparent" + PathSvg { path: "m 325.03711,0.5 + c -26.61408,6.4494547 -49.95197,2.1018066 -76.21132,1.0771669 + -22.26577,7.6817151 -47.96405,9.3627181 -65.67832,25.8497861 + -15.74718,12.80008 -41.1564,19.605644 -45.74903,40.600391 + -12.46933,17.76181 -25.36105,35.720146 -29.20117,57.999996 + -18.709864,3.10961 -16.347355,30.83801 -22.385143,46.675 + -6.848711,11.2677 11.07278,24.69174 -8.514666,27.97383 + -10.266901,5.61543 -12.859313,28.96588 -13.732346,5.78143 + 0.940083,-11.53398 -13.486195,-38.30626 -16.81701,-34.20231 + 14.608079,7.8234 21.299281,50.52979 11.380052,48.14418 + -3.406456,-15.12428 -26.181106,-38.29457 -31.849471,-35.62945 + 16.851912,6.41472 35.569884,31.75215 28.172486,47.93115 + -7.906485,-15.42757 -37.758959,-35.53783 -44.275447,-31.28685 + 18.975831,1.7428 37.986009,20.68109 42.87115,37.14427 C + 42.279655,225.774 9.879724,213.57795 4.7080253,219.04989 + 20.780803,212.57418 55.055919,239.88547 49.602579,241.25683 + 38.186641,230.40078 6.6930104,222.77983 2.5752529,228.41774 c + 13.6045481,-8.33065 49.4437901,14.89041 43.5525671,14.2358 + -9.759981,-7.96123 -43.5842921,7.36937 -17.554974,-1.20248 + 9.464499,-3.73452 40.555672,12.80659 16.398749,5.14121 + -9.1987,-7.28225 -39.0013156,3.37352 -14.121965,-2.12828 + 13.244874,-0.0206 35.758428,14.62706 10.562447,6.42228 + -10.780465,-8.4873 -47.8282254,11.10651 -21.027329,-0.003 + 11.640859,-4.82877 52.615601,10.74471 24.234828,8.2659 + -10.695834,-7.03902 -42.9384162,8.93905 -34.227854,5.58373 + 9.077539,-8.56443 49.068801,-5.28097 43.06838,0.45546 + -10.900893,-0.7118 -27.449619,17.27258 -10.00187,3.46526 + 15.705191,-9.18198 18.344231,9.31645 1.10807,8.73907 + -9.908444,1.77856 -21.108189,20.66671 -7.974821,4.92019 + 15.750746,-14.10374 34.01348,2.07267 9.796961,8.69337 + -8.17128,5.49929 -12.642664,19.13654 -3.994573,4.19708 + 9.044753,-8.7077 23.850399,-13.64552 21.404959,4.02329 + 12.509737,17.12562 51.158782,11.0442 45.106112,43.34009 + -0.65006,10.05318 -3.79228,13.95389 1.62128,14.30064 + -4.30913,8.82737 -14.652714,37.9591 2.92144,17.46024 + 7.37972,-3.68333 -7.62399,16.24161 -7.98007,23.83761 + -9.336865,18.77418 19.74873,-18.55943 6.62229,5.46195 + 5.46464,-3.7389 36.23886,-19.41901 14.78167,0.58987 + -8.59505,4.55644 29.29441,-2.99423 8.95489,6.47134 -9.22562,5.54437 + -24.09765,26.79976 -11.73274,22.20385 -0.81685,5.4936 + -1.58629,21.47626 2.34158,9.14886 1.61237,14.67029 + -2.38384,25.22225 12.26908,15.1741 -4.40761,8.01039 + -8.23679,36.91214 5.12235,17.92578 1.53454,2.99551 9.37569,3.1726 + 7.15304,14.93579 3.51234,-11.31873 18.4607,-29.83809 + 12.36869,-6.48005 -0.22629,16.26174 5.44303,-7.24791 + 6.56926,10.49819 12.45412,28.9931 3.40908,-41.89883 + 17.52051,-9.19238 3.23093,11.1924 6.53006,29.46941 7.55984,5.1249 + 15.37236,-19.52583 4.09776,20.07416 12.64063,1.48215 + 18.11247,-24.55068 -8.92586,38.39355 6.73828,6.62225 + 4.55353,-6.91007 15.35028,-38.88977 12.55806,-13.78666 + 1.05309,27.02664 11.54743,-24.40259 12.40657,6.86306 + -1.72561,13.28253 11.85393,-24.15909 13.85568,-1.38002 + 3.12455,8.33539 8.76536,26.46432 8.73882,5.09231 3.57025,-10.37352 + -16.025,-37.75672 0.20707,-22.5788 -1.2458,-14.17213 + -2.38918,-16.90145 10.85489,-6.71468 -16.57629,-17.22152 + 0.19706,-26.08949 5.7751,-19.14889 -14.91681,-16.1674 + 19.74174,7.19334 2.31875,-9.86869 -4.32508,-15.23278 + 27.25228,29.12341 20.27514,18.81172 -11.97527,-18.92603 + -17.96305,-45.80333 11.70099,-51.52566 17.19069,-9.57351 + 31.17452,21.93154 38.50541,1.56304 16.26048,-4.6633 + 22.3749,38.26516 24.86349,9.11316 5.94153,-9.9731 30.14313,6.97379 + 36.34294,4.75012 7.07435,18.27732 8.06778,14.78971 11.04264,3.86016 + 2.73754,-15.85945 28.7269,10.06391 28.09146,25.96561 3.00672,2.4754 + 6.55025,-22.10264 11.23552,-14.43872 2.84155,-11.4823 + -3.28976,-27.88574 4.24895,-25.5189 -0.61494,-11.53957 + 22.83611,0.11011 10.64648,-15.28756 -6.5587,-21.38598 + 9.32959,-3.0159 13.5107,-4.69375 -1.38592,-16.74533 + -8.66673,-31.83316 -1.90087,-41.0875 2.39623,-15.14303 + -12.50533,-44.45478 -4.70573,-48.49375 15.08472,3.42779 + -20.39159,-42.17451 -1.69776,-40.85728 24.07272,21.63552 + -3.65989,-30.10299 2.27233,-33.17152 16.90643,17.53071 + -12.7383,-38.42821 6.79531,-21.57013 -4.50946,-21.08135 + -2.53357,-37.43561 -15.5535,-55.59527 -11.0035,-12.40086 + -1.87775,-7.12745 1.34831,-8.11755 C 468.27562,118.9774 + 451.40746,102.656 430.98897,92.119168 439.06192,78.203836 + 455.88012,60.123881 457.38638,40.337815 463.2373,23.183067 + 450.82861,4.7342783 435.04883,22.626367 409.5188,28.206712 + 386.3569,24.131269 365.63904,8.0954152 352.788,2.8857182 + 338.88892,0.40735091 325.03711,0.5 Z m -219.0625,357.04297 + -0.97656,0.88476 z" + } + } + } } + diff --git a/examples/quick/shapes/doc/images/qml-shapes-example.png b/examples/quick/shapes/doc/images/qml-shapes-example.png Binary files differnew file mode 100644 index 0000000000..055fc244ea --- /dev/null +++ b/examples/quick/shapes/doc/images/qml-shapes-example.png diff --git a/examples/quick/demos/samegame/doc/src/samegame.qdoc b/examples/quick/shapes/doc/src/shapes.qdoc index 107a869bff..46c1f930d3 100644 --- a/examples/quick/demos/samegame/doc/src/samegame.qdoc +++ b/examples/quick/shapes/doc/src/shapes.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,28 +20,20 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ - /*! - \title Qt Quick Demo - Same Game - \ingroup qtquickdemos - \example demos/samegame - \brief A QML implementation of the popular puzzle game by Kuniaki Moribe. - - \e{Same Game} demonstrates a QML game with custom types and logic written in - JavaScript. The game uses various \l{Qt Quick} features such as - particles, animation, and loading images. + \title Qt Quick Examples - Shapes + \example shapes + \image qml-shapes-example.png + \brief A Qt Quick example demonstrating the use of shape items. + \ingroup qtquickexamples - \image qtquick-demo-samegame-med-1.png - \image qtquick-demo-samegame-med-2.png - - For more details about different parts of the example, see - \l{QML Advanced Tutorial}. + This example demonstrates the usage of the \l Shape type in Qt Quick. Shapes + allow efficiently rendering stroked and filled lines, curves, and arcs in Qt + Quick scenes. \include examples-run.qdocinc - - \sa {QML Applications} */ diff --git a/examples/quick/shapes/main.cpp b/examples/quick/shapes/main.cpp index 3a81c4da05..60f6c98f42 100644 --- a/examples/quick/shapes/main.cpp +++ b/examples/quick/shapes/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,4 +48,4 @@ ** ****************************************************************************/ #include "../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(pathitem/pathitem) +DECLARATIVE_EXAMPLE_MAIN(shapes/main) diff --git a/examples/quick/shapes/shapes.pro b/examples/quick/shapes/shapes.pro index 1b953f56ca..ff6fa422fb 100644 --- a/examples/quick/shapes/shapes.pro +++ b/examples/quick/shapes/shapes.pro @@ -3,14 +3,15 @@ TEMPLATE = app QT += quick qml SOURCES += main.cpp RESOURCES += shapes.qrc -OTHER_FILES += content/pathitem.qml \ - content/pathitemgallery.qml \ - content/pathiteminteract.qml \ - content/pathitemsampling.qml \ - content/pathitemtigers.qml \ +OTHER_FILES += content/main.qml \ + content/shapegallery.qml \ + content/interactive.qml \ + content/sampling.qml \ + content/clippedtigers.qml \ content/tiger.qml \ - content/item1.qml \ + content/tapableTriangle.qml \ content/item2.qml \ + content/item3.qml \ content/item4.qml \ content/item5.qml \ content/item6.qml \ diff --git a/examples/quick/shapes/shapes.qrc b/examples/quick/shapes/shapes.qrc index 533ba090bc..e03c0e8a0a 100644 --- a/examples/quick/shapes/shapes.qrc +++ b/examples/quick/shapes/shapes.qrc @@ -1,19 +1,20 @@ <RCC> - <qresource prefix="/pathitem"> + <qresource prefix="/shapes"> <file alias="LauncherList.qml">../shared/LauncherList.qml</file> <file alias="SimpleLauncherDelegate.qml">../shared/SimpleLauncherDelegate.qml</file> <file alias="images/next.png">../shared/images/next.png</file> <file alias="images/back.png">../shared/images/back.png</file> <file alias="images/slider_handle.png">../shared/images/slider_handle.png</file> <file alias="Slider.qml">../shared/Slider.qml</file> - <file alias="pathitem.qml">content/pathitem.qml</file> - <file alias="pathitemgallery.qml">content/pathitemgallery.qml</file> - <file alias="pathiteminteract.qml">content/pathiteminteract.qml</file> - <file alias="pathitemsampling.qml">content/pathitemsampling.qml</file> - <file alias="pathitemtigers.qml">content/pathitemtigers.qml</file> + <file alias="main.qml">content/main.qml</file> + <file alias="shapegallery.qml">content/shapegallery.qml</file> + <file alias="interactive.qml">content/interactive.qml</file> + <file alias="sampling.qml">content/sampling.qml</file> + <file alias="clippedtigers.qml">content/clippedtigers.qml</file> <file alias="tiger.qml">content/tiger.qml</file> - <file alias="item1.qml">content/item1.qml</file> + <file alias="tapableTriangle.qml">content/tapableTriangle.qml</file> <file alias="item2.qml">content/item2.qml</file> + <file alias="item3.qml">content/item3.qml</file> <file alias="item4.qml">content/item4.qml</file> <file alias="item5.qml">content/item5.qml</file> <file alias="item6.qml">content/item6.qml</file> diff --git a/examples/quick/shared/Button.qml b/examples/quick/shared/Button.qml index aa78668be2..ce7dad717f 100644 --- a/examples/quick/shared/Button.qml +++ b/examples/quick/shared/Button.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.12 import QtQuick.Window 2.1 Item { @@ -47,8 +57,8 @@ Item { property alias text: buttonLabel.text property alias label: buttonLabel signal clicked - property alias containsMouse: mouseArea.containsMouse - property alias pressed: mouseArea.pressed + property alias containsMouse: hoverHandler.hovered + property alias pressed: tapHandler.pressed implicitHeight: Math.max(Screen.pixelDensity * 7, buttonLabel.implicitHeight * 1.2) implicitWidth: Math.max(Screen.pixelDensity * 11, buttonLabel.implicitWidth * 1.3) height: implicitHeight @@ -61,7 +71,7 @@ Item { anchors.fill: parent color: palette.button gradient: Gradient { - GradientStop { position: 0.0; color: mouseArea.pressed ? Qt.darker(palette.button, 1.3) : palette.button } + GradientStop { position: 0.0; color: tapHandler.pressed ? Qt.darker(palette.button, 1.3) : palette.button } GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) } } antialiasing: true @@ -70,11 +80,12 @@ Item { border.width: 1 } - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: container.clicked() - hoverEnabled: true + TapHandler { + id: tapHandler + onTapped: container.clicked(); + } + HoverHandler { + id: hoverHandler } Text { diff --git a/examples/quick/shared/CheckBox.qml b/examples/quick/shared/CheckBox.qml index 9026021956..7b1588d2d9 100644 --- a/examples/quick/shared/CheckBox.qml +++ b/examples/quick/shared/CheckBox.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.12 Item { id: root @@ -48,7 +58,7 @@ Item { height: implicitHeight property alias text: label.text property bool checked - property alias pressed: mouseArea.pressed + property alias pressed: tapHandler.pressed property alias row: row signal clicked @@ -61,7 +71,7 @@ Item { Rectangle { id: frame gradient: Gradient { - GradientStop { position: 0.0; color: mouseArea.pressed ? Qt.darker(palette.button, 1.3) : palette.button } + GradientStop { position: 0.0; color: tapHandler.pressed ? Qt.darker(palette.button, 1.3) : palette.button } GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) } } height: label.implicitHeight * 1.5 @@ -86,10 +96,9 @@ Item { anchors.verticalCenter: frame.verticalCenter } } - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { + TapHandler { + id: tapHandler + onTapped: { parent.checked = !parent.checked parent.clicked() } diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/EditableButton.qml b/examples/quick/shared/FlickrRssModel.qml index 35df4107eb..cee4022bf0 100644 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/EditableButton.qml +++ b/examples/quick/shared/FlickrRssModel.qml @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtQml module of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage @@ -48,47 +48,39 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.12 -Item { - id: container +ListModel { + id: flickrImages + property string tags : "" + readonly property string queryUrl : "http://api.flickr.com/services/feeds/photos_public.gne?" - property string label - signal clicked - - width: textInput.width + 70 ; height: textInput.height + 18 - - BorderImage { - anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } - source: 'images/box-shadow.png'; - border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 + function encodeParams(x) { + return encodeURIComponent(x.replace(" ",",")); } - - Image { anchors.fill: parent; source: "images/cardboard.png"; antialiasing: true } - - TextInput { - id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent - Keys.onReturnPressed: { - container.label = textInput.text - container.focus = true - } - Keys.onEnterPressed: { - container.label = textInput.text - container.focus = true - } - Keys.onEscapePressed: { - textInput.text = container.label - container.focus = true + function fetchImages(format) { + var requestURL = queryUrl + (tags ? "tags="+encodeParams(tags)+"&" : "") + "format=" + format + "&nojsoncallback=1"; + var xhr = new XMLHttpRequest; + xhr.onreadystatechange = function() { + if (xhr.readyState === XMLHttpRequest.DONE) { + var jsonText = xhr.responseText; + var objArray = JSON.parse(jsonText.replace(/\'/g,"'")) + if (objArray.errors !== undefined) + console.log(lCategory, "Error fetching tweets: " + imageItems.errors[0].message) + else { + for (var key in objArray.items) { + var rssItem = objArray.items[key]; + var jsonObject = "{ \"title\": \"" + rssItem.title +"\",\"media\": \"" + rssItem.media.m + "\", \"thumbnail\": \"" + rssItem.media.m.replace(/\_m\.jpg/,"_s.jpg") +"\"}" + flickrImages.append(JSON.parse(jsonObject)); + } + } + } } + xhr.open("GET", requestURL, true); + xhr.send(); } - - Rectangle { - anchors.fill: container; border.color: "steelblue"; border.width: 4 - color: "transparent"; visible: textInput.focus; antialiasing: true - } - - MouseArea { - anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } - onClicked: { textInput.forceActiveFocus(); Qt.inputMethod.show(); } + Component.onCompleted: { + fetchImages("json"); } } + diff --git a/examples/quick/shared/Label.qml b/examples/quick/shared/Label.qml index ea4bef5415..acbffb8dfa 100644 --- a/examples/quick/shared/Label.qml +++ b/examples/quick/shared/Label.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/shared/LauncherList.qml b/examples/quick/shared/LauncherList.qml index ba9ee6c5d2..fe44cf3634 100644 --- a/examples/quick/shared/LauncherList.qml +++ b/examples/quick/shared/LauncherList.qml @@ -1,13 +1,23 @@ /**************************************************************************** ** ** Copyright (C) 2017 Crimson AS <info@crimson.no> -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,7 +48,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.12 Rectangle { property int activePageCount: 0 @@ -47,10 +57,12 @@ Rectangle { //function used to add to model A) to enforce scheme B) to allow Qt.resolveUrl in url assignments color: "#eee" - function addExample(name, desc, url) - { + function addExample(name, desc, url) { myModel.append({"name":name, "description":desc, "url":url}) } + function showExample(url) { + pageComponent.createObject(pageContainer, { exampleUrl: url }).show() + } // The container rectangle here is used to give a nice "feel" when // transitioning into an example. @@ -62,10 +74,7 @@ Rectangle { id: launcherList clip: true delegate: SimpleLauncherDelegate{ - onClicked: { - var page = pageComponent.createObject(pageContainer, { exampleUrl: url }) - page.show() - } + onClicked: showExample(url) } model: ListModel {id:myModel} anchors.fill: parent @@ -87,9 +96,8 @@ Rectangle { width: parent.width height: parent.height - bar.height color: "white" - MouseArea{ + TapHandler { //Eats mouse events - anchors.fill: parent } Loader{ focus: true @@ -97,8 +105,6 @@ Rectangle { anchors.fill: parent } - x: -width - function show() { showAnim.start() } @@ -214,29 +220,27 @@ Rectangle { anchors.left: parent.left anchors.leftMargin: 16 - MouseArea { - id: mouse - hoverEnabled: true - anchors.centerIn: parent - width: 38 - height: 31 - anchors.verticalCenterOffset: -1 + TapHandler { + id: tapHandler enabled: activePageCount > 0 - onClicked: { + onTapped: { pageContainer.children[pageContainer.children.length - 1].exit() } - Rectangle { - anchors.fill: parent - opacity: mouse.pressed ? 1 : 0 - Behavior on opacity { NumberAnimation{ duration: 100 }} - gradient: Gradient { - GradientStop { position: 0 ; color: "#22000000" } - GradientStop { position: 0.2 ; color: "#11000000" } - } - border.color: "darkgray" - antialiasing: true - radius: 4 + } + Rectangle { + anchors.centerIn: back + width: 38 + height: 31 + anchors.verticalCenterOffset: -1 + opacity: tapHandler.pressed ? 1 : 0 + Behavior on opacity { NumberAnimation{ duration: 100 }} + gradient: Gradient { + GradientStop { position: 0 ; color: "#22000000" } + GradientStop { position: 0.2 ; color: "#11000000" } } + border.color: "darkgray" + antialiasing: true + radius: 4 } } } diff --git a/examples/quick/shared/SimpleLauncherDelegate.qml b/examples/quick/shared/SimpleLauncherDelegate.qml index a9f7cb9f83..75aecf262c 100644 --- a/examples/quick/shared/SimpleLauncherDelegate.qml +++ b/examples/quick/shared/SimpleLauncherDelegate.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -37,7 +47,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.12 Rectangle { id: container @@ -79,12 +89,14 @@ Rectangle { implicitHeight: col.height height: implicitHeight width: buttonLabel.width + 20 + property alias containsMouse: hoverHandler.hovered - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: container.clicked() - hoverEnabled: true + TapHandler { + id: tapHandler + onTapped: container.clicked() + } + HoverHandler { + id: hoverHandler } Column { diff --git a/examples/quick/shared/Slider.qml b/examples/quick/shared/Slider.qml index 28f92446d0..cdda86e39e 100644 --- a/examples/quick/shared/Slider.qml +++ b/examples/quick/shared/Slider.qml @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.12 Item { id: slider @@ -57,18 +57,26 @@ Item { property real min: 0 property real max: 1 - property real value: min + (max - min) * mousearea.value + property real value: min + (max - min) * dragHandler.value property real init: min+(max-min)/2 property string name: "Slider" property color color: "#0066cc" property real minLabelWidth: 44 + DragHandler { + id: dragHandler + target: handle + xAxis.minimum: Math.round(-handle.width / 2 + 3) + xAxis.maximum: Math.round(foo.width - handle.width/2 - 3) + property real value: (handle.x - xAxis.minimum) / (xAxis.maximum - xAxis.minimum) + } + Component.onCompleted: setValue(init) function setValue(v) { if (min < max) handle.x = Math.round( v / (max - min) * - (mousearea.drag.maximumX - mousearea.drag.minimumX) - + mousearea.drag.minimumX); + (dragHandler.xAxis.maximum - dragHandler.xAxis.minimum) + + dragHandler.xAxis.minimum); } Rectangle { id:sliderName @@ -112,16 +120,6 @@ Item { id: handle source: "images/slider_handle.png" anchors.verticalCenter: parent.verticalCenter - MouseArea { - id: mousearea - anchors.fill: parent - anchors.margins: -4 - drag.target: parent - drag.axis: Drag.XAxis - drag.minimumX: Math.round(-handle.width / 2 + 3) - drag.maximumX: Math.round(foo.width - handle.width/2 - 3) - property real value: (handle.x - drag.minimumX) / (drag.maximumX - drag.minimumX) - } } } } diff --git a/examples/quick/shared/TabSet.qml b/examples/quick/shared/TabSet.qml index 2ae2993b03..9e2759c3ec 100644 --- a/examples/quick/shared/TabSet.qml +++ b/examples/quick/shared/TabSet.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.12 import QtQuick.Window 2.1 Item { @@ -90,9 +100,8 @@ Item { elide: Text.ElideRight font.bold: tabWidget.current == index } - MouseArea { - anchors.fill: parent - onClicked: tabWidget.current = index + TapHandler { + onTapped: tabWidget.current = index } } } diff --git a/examples/quick/shared/TextField.qml b/examples/quick/shared/TextField.qml index 7c822a10b0..05e048011a 100644 --- a/examples/quick/shared/TextField.qml +++ b/examples/quick/shared/TextField.qml @@ -1,12 +1,22 @@ /***************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick.Dialogs module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h index ae04667c8f..18e7ff056b 100644 --- a/examples/quick/shared/shared.h +++ b/examples/quick/shared/shared.h @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -67,11 +77,6 @@ if (view.status() == QQuickView::Error)\ return -1;\ view.setResizeMode(QQuickView::SizeRootObjectToView);\ - if (QGuiApplication::platformName() == QLatin1String("qnx") || \ - QGuiApplication::platformName() == QLatin1String("eglfs")) {\ - view.showFullScreen();\ - } else {\ - view.show();\ - }\ + view.show();\ return app.exec();\ } diff --git a/examples/quick/shared/shared.qrc b/examples/quick/shared/shared.qrc index 89b3ff757e..cce683f8a3 100644 --- a/examples/quick/shared/shared.qrc +++ b/examples/quick/shared/shared.qrc @@ -1,5 +1,6 @@ <RCC> <qresource prefix="/shared"> + <file>FlickrRssModel.qml</file> <file>LauncherList.qml</file> <file>SimpleLauncherDelegate.qml</file> <file>Button.qml</file> diff --git a/examples/quick/tableview/gameoflife/doc/images/gameoflife.png b/examples/quick/tableview/gameoflife/doc/images/gameoflife.png Binary files differnew file mode 100644 index 0000000000..252dda2e11 --- /dev/null +++ b/examples/quick/tableview/gameoflife/doc/images/gameoflife.png diff --git a/examples/quick/tableview/gameoflife/doc/src/gameoflife.qdoc b/examples/quick/tableview/gameoflife/doc/src/gameoflife.qdoc new file mode 100644 index 0000000000..069513636a --- /dev/null +++ b/examples/quick/tableview/gameoflife/doc/src/gameoflife.qdoc @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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. +** $QT_END_LICENSE$ +** +****************************************************************************/ +/*! + \title Qt Quick TableView examples - Conway’s Game of Life + \example tableview/gameoflife + \brief The \e{Conway’s Game of Life} example shows how the QML TableView + type can be used to display a C++ model that the user can pan around. + + \image gameoflife.png + \ingroup qtquickexamples + + \include examples-run.qdocinc + + \section1 The QML User Interface + + \snippet tableview/gameoflife/main.qml tableview + The example uses the TableView component to display a grid of cells. Each + of these cells is drawn on the screen by the TableView’s delegate, which is + a Rectangle QML component. We read the cell’s value and we change it + using \c{model.value} when the user clicks it. + + \snippet tableview/gameoflife/main.qml scroll + When the application starts, the TableView is scrolled to its center + by using its \c{contentX} and \c{contentY} properties to update the scroll + position, and the \c{contentWidth} and \c{contentHeight} to compute where + the view should be scrolled to. + + \snippet tableview/gameoflife/main.qml model + The model that we use is a custom C++ class that we register + in the QML system: + \snippet tableview/gameoflife/main.cpp registertype + + \section1 The C++ Model + + \snippet tableview/gameoflife/gameoflifemodel.h modelclass + The \c{GameOfLifeModel} class extends QAbstractTableModel so it can be + used as the model of our TableView component. Therefore, it needs to + implement some functions so the TableView component can interact with + the model. As you can see in the \c private part of the class, the model + uses a fixed-size array to store the current state of all the cells. + + \snippet tableview/gameoflife/gameoflifemodel.cpp modelsize + Here, the \c rowCount and \c columnCount methods are implemented so + the TableView component can know the size of the table. It simply returns + the values of the \c width and \c height constants. + + \snippet tableview/gameoflife/gameoflifemodel.cpp read + This method is called when the TableView component requests some data from + the model. In our example, we only have one piece of data by cell: whether + it is alive or not. This information is represented by the \c CellRole value + of the \c Roles enum in our C++ code; this corresponds to the \c value + property in the QML code (the link between these two is made by the + \c{roleNames()} function of our C++ class). + + The \c GameOfLifeModel class can identify which cell was the data requested + from with the \c index parameter, which is a QModelIndex that contains + a row and a column. + + \section1 Updating the Data + + \snippet tableview/gameoflife/gameoflifemodel.cpp write + The \c setData method is called when a property’s value is set from the + QML interface: in our example, it toggles a cell’s state when it is clicked. + In the same way as the \c{data()} function does, this method receives an + \c index and a \c role parameter. Additionally, the new value is passed + as a QVariant, that we convert to a boolean using the \c toBool function. + + When we update the internal state of our model object, we need to emit a + \c dataChanged signal to tell the TableView component that it needs to update the + displayed data. In this case, only the cell that was clicked is affected, thus + the range of the table that has to be updated begins and ends at the cell’s index. + + \snippet tableview/gameoflife/gameoflifemodel.cpp update + This function can be called directly from the QML code, because it contains the + Q_INVOKABLE macro in its definition. It plays an iteration of the game, either when + the user clicks the \e{Next} button or when the Timer emits a \c{triggered()} signal. + + Following the \e{Conway’s Game of Life} rules, a new state is computed for each + cell depending on the current state of its neighbors. When the new state has + been computed for the whole grid, it replaces the current state and a + \e dataChanged signal is emitted for the whole table. + + \snippet tableview/gameoflife/gameoflifemodel.cpp loader + When the application opens, a pattern is loaded to demonstrate how + \e{Conway’s Game of Life} works. These two functions load the file where + the pattern is stored and parse it. As in the \c nextStep function, a + \c dataChanged signal is emitted for the whole table once the pattern + has been fully loaded. +*/ diff --git a/examples/quick/tableview/gameoflife/gameoflife.pro b/examples/quick/tableview/gameoflife/gameoflife.pro new file mode 100644 index 0000000000..98050b0d79 --- /dev/null +++ b/examples/quick/tableview/gameoflife/gameoflife.pro @@ -0,0 +1,16 @@ +TEMPLATE = app + +QT += quick qml +SOURCES += \ + main.cpp \ + gameoflifemodel.cpp + +RESOURCES += \ + main.qml \ + gosperglidergun.cells + +target.path = $$[QT_INSTALL_EXAMPLES]/quick/tableview/gameoflife +INSTALLS += target + +HEADERS += \ + gameoflifemodel.h diff --git a/examples/quick/tableview/gameoflife/gameoflifemodel.cpp b/examples/quick/tableview/gameoflife/gameoflifemodel.cpp new file mode 100644 index 0000000000..32765f87a8 --- /dev/null +++ b/examples/quick/tableview/gameoflife/gameoflifemodel.cpp @@ -0,0 +1,214 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "gameoflifemodel.h" +#include <QFile> +#include <QTextStream> +#include <QRect> + +GameOfLifeModel::GameOfLifeModel(QObject *parent) + : QAbstractTableModel(parent) +{ + clear(); +} + +//! [modelsize] +int GameOfLifeModel::rowCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return 0; + + return height; +} + +int GameOfLifeModel::columnCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return 0; + + return width; +} +//! [modelsize] + +//! [read] +QVariant GameOfLifeModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid() || role != CellRole) + return QVariant(); + + return QVariant(m_currentState[cellIndex({index.column(), index.row()})]); +} +//! [read] + +//! [write] +bool GameOfLifeModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + if (role != CellRole || data(index, role) == value) + return false; + + m_currentState[cellIndex({index.column(), index.row()})] = value.toBool(); + emit dataChanged(index, index, {role}); + + return true; +} +//! [write] + +Qt::ItemFlags GameOfLifeModel::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + return Qt::NoItemFlags; + + return Qt::ItemIsEditable; +} + +//! [update] +void GameOfLifeModel::nextStep() +{ + StateContainer newValues; + + for (std::size_t i = 0; i < size; ++i) { + bool currentState = m_currentState[i]; + + int cellNeighborsCount = this->cellNeighborsCount(cellCoordinatesFromIndex(static_cast<int>(i))); + + newValues[i] = currentState == true + ? cellNeighborsCount == 2 || cellNeighborsCount == 3 + : cellNeighborsCount == 3; + } + + m_currentState = std::move(newValues); + + emit dataChanged(index(0, 0), index(height - 1, width - 1), {CellRole}); +} +//! [update] + +//! [loader] +bool GameOfLifeModel::loadFile(const QString &fileName) +{ + QFile file(fileName); + if (!file.open(QIODevice::ReadOnly)) + return false; + + QTextStream in(&file); + loadPattern(in.readAll()); + + return true; +} + +void GameOfLifeModel::loadPattern(const QString &plainText) +{ + clear(); + + QStringList rows = plainText.split("\n"); + QSize patternSize(0, rows.count()); + for (QString row : rows) { + if (row.size() > patternSize.width()) + patternSize.setWidth(row.size()); + } + + QPoint patternLocation((width - patternSize.width()) / 2, (height - patternSize.height()) / 2); + + for (int y = 0; y < patternSize.height(); ++y) { + const QString line = rows[y]; + + for (int x = 0; x < line.length(); ++x) { + QPoint cellPosition(x + patternLocation.x(), y + patternLocation.y()); + m_currentState[cellIndex(cellPosition)] = line[x] == 'O'; + } + } + + emit dataChanged(index(0, 0), index(height - 1, width - 1), {CellRole}); +} +//! [loader] + +void GameOfLifeModel::clear() +{ + m_currentState.fill(false); + emit dataChanged(index(0, 0), index(height - 1, width - 1), {CellRole}); +} + +int GameOfLifeModel::cellNeighborsCount(const QPoint &cellCoordinates) const +{ + int count = 0; + + for (int x = -1; x <= 1; ++x) { + for (int y = -1; y <= 1; ++y) { + if (x == 0 && y == 0) + continue; + + const QPoint neighborPosition { cellCoordinates.x() + x, cellCoordinates.y() + y }; + if (!areCellCoordinatesValid(neighborPosition)) + continue; + + if (m_currentState[cellIndex(neighborPosition)]) + ++count; + + if (count > 3) + return count; + } + } + + return count; +} + +bool GameOfLifeModel::areCellCoordinatesValid(const QPoint &coordinates) +{ + return QRect(0, 0, width, height).contains(coordinates); +} + +QPoint GameOfLifeModel::cellCoordinatesFromIndex(int cellIndex) +{ + return {cellIndex % width, cellIndex / width}; +} + +std::size_t GameOfLifeModel::cellIndex(const QPoint &coordinates) +{ + return std::size_t(coordinates.y() * width + coordinates.x()); +} diff --git a/examples/quick/tableview/gameoflife/gameoflifemodel.h b/examples/quick/tableview/gameoflife/gameoflifemodel.h new file mode 100644 index 0000000000..3ea1469861 --- /dev/null +++ b/examples/quick/tableview/gameoflife/gameoflifemodel.h @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GAMEOFLIFEMODEL_H +#define GAMEOFLIFEMODEL_H + +#include <array> +#include <QAbstractTableModel> +#include <QPoint> + +//! [modelclass] +class GameOfLifeModel : public QAbstractTableModel +{ + Q_OBJECT + + Q_ENUMS(Roles) +public: + enum Roles { + CellRole + }; + + QHash<int, QByteArray> roleNames() const override { + return { + { CellRole, "value" } + }; + } + + explicit GameOfLifeModel(QObject *parent = nullptr); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex &index, const QVariant &value, + int role = Qt::EditRole) override; + + Qt::ItemFlags flags(const QModelIndex &index) const override; + + Q_INVOKABLE void nextStep(); + Q_INVOKABLE bool loadFile(const QString &fileName); + Q_INVOKABLE void loadPattern(const QString &plainText); + Q_INVOKABLE void clear(); + +private: + static constexpr int width = 256; + static constexpr int height = 256; + static constexpr int size = width * height; + + using StateContainer = std::array<bool, size>; + StateContainer m_currentState; + + int cellNeighborsCount(const QPoint &cellCoordinates) const; + static bool areCellCoordinatesValid(const QPoint &coordinates); + static QPoint cellCoordinatesFromIndex(int cellIndex); + static std::size_t cellIndex(const QPoint &coordinates); +}; +//! [modelclass] + +#endif // GAMEOFLIFEMODEL_H diff --git a/examples/quick/tableview/gameoflife/gosperglidergun.cells b/examples/quick/tableview/gameoflife/gosperglidergun.cells new file mode 100644 index 0000000000..50aaadf3d5 --- /dev/null +++ b/examples/quick/tableview/gameoflife/gosperglidergun.cells @@ -0,0 +1,9 @@ +........................O +......................O.O +............OO......OO............OO +...........O...O....OO............OO +OO........O.....O...OO +OO........O...O.OO....O.O +..........O.....O.......O +...........O...O +............OO diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/RssModel.qml b/examples/quick/tableview/gameoflife/main.cpp index 5808090250..5101880b06 100644 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/RssModel.qml +++ b/examples/quick/tableview/gameoflife/main.cpp @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtQml module of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage @@ -48,19 +48,23 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtQuick.XmlListModel 2.0 +#include <QGuiApplication> +#include <QQmlApplicationEngine> +#include <gameoflifemodel.h> -XmlListModel { - property string tags : "" +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication app(argc, argv); + QQmlApplicationEngine engine; - function encodeTags(x) { return encodeURIComponent(x.replace(' ',',')); } + //! [registertype] + qmlRegisterType<GameOfLifeModel>("GameOfLifeModel", 1, 0, "GameOfLifeModel"); + //! [registertype] - source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+encodeTags(tags)+"&" : "") - query: "/feed/entry" - namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';" + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; - XmlRole { name: "title"; query: "title/string()" } - XmlRole { name: "content"; query: "content/string()" } - XmlRole { name: "hq"; query: "link[@rel='enclosure']/@href/string()" } + return app.exec(); } diff --git a/examples/quick/tableview/gameoflife/main.qml b/examples/quick/tableview/gameoflife/main.qml new file mode 100644 index 0000000000..90be69b9c0 --- /dev/null +++ b/examples/quick/tableview/gameoflife/main.qml @@ -0,0 +1,154 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Window 2.3 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.3 +import GameOfLifeModel 1.0 + +ApplicationWindow { + id: root + visible: true + width: 760 + height: 810 + minimumWidth: 475 + minimumHeight: 300 + + color: "#09102B" + title: qsTr("Conway’s Game of Life") + + //! [tableview] + TableView { + id: tableView + anchors.fill: parent + + rowSpacing: 1 + columnSpacing: 1 + + ScrollBar.horizontal: ScrollBar {} + ScrollBar.vertical: ScrollBar {} + + delegate: Rectangle { + id: cell + implicitWidth: 15 + implicitHeight: 15 + + color: model.value ? "#f3f3f4" : "#b5b7bf" + + MouseArea { + anchors.fill: parent + onClicked: model.value = !model.value + } + } + //! [tableview] + + //! [model] + model: GameOfLifeModel { + id: gameOfLifeModel + } + //! [model] + + //! [scroll] + contentX: (contentWidth - width) / 2; + contentY: (contentHeight - height) / 2; + //! [scroll] + } + + footer: Rectangle { + signal nextStep + + id: footer + height: 50 + color: "#F3F3F4" + + RowLayout { + anchors.centerIn: parent + + //! [next] + Button { + text: qsTr("Next") + onClicked: gameOfLifeModel.nextStep() + } + //! [next] + + Item { + width: 50 + } + + Slider { + id: slider + x: 245 + y: 17 + from: 0 + to: 1 + value: 0.9 + } + + Button { + text: timer.running ? "❙❙" : "▶️" + onClicked: timer.running = !timer.running + } + } + + Timer { + id: timer + interval: 1000 - (980 * slider.value) + running: true + repeat: true + + onTriggered: gameOfLifeModel.nextStep() + } + } + + Component.onCompleted: { + gameOfLifeModel.loadFile(":/gosperglidergun.cells"); + } +} diff --git a/examples/quick/tableview/pixelator/doc/images/qt-pixelator.png b/examples/quick/tableview/pixelator/doc/images/qt-pixelator.png Binary files differnew file mode 100644 index 0000000000..a6c4a3b40b --- /dev/null +++ b/examples/quick/tableview/pixelator/doc/images/qt-pixelator.png diff --git a/examples/quick/tableview/pixelator/doc/src/pixelator.qdoc b/examples/quick/tableview/pixelator/doc/src/pixelator.qdoc new file mode 100644 index 0000000000..9e199a5347 --- /dev/null +++ b/examples/quick/tableview/pixelator/doc/src/pixelator.qdoc @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** 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. +** $QT_END_LICENSE$ +** +****************************************************************************/ +/*! + \title Qt Quick TableViews examples - Pixelator + \example tableview/pixelator + \brief The Pixelator example shows how a QML TableView and a delegate + can be used for custom table models. + + \image qt-pixelator.png + \ingroup qtquickexamples + + \include examples-run.qdocinc + + \snippet tableview/pixelator/imagemodel.h model + + We only require a simple, read-only table model. Thus, we need to implement + functions to indicate the dimensions of the image and supply data to the + TableView. + We use the \l{The Property System}{Qt Property System} and a source property + as \c QString to set the path of the image. + + \snippet tableview/pixelator/imagemodel.cpp setsource + + Here we load the image when the source path is set. + When the source path has changed, we need to call \c beginResetModel() before. + After the image has been loaded, we need to call \c endResetModel(). + + \snippet tableview/pixelator/imagemodel.cpp rowcolcount + + The row and column count is set to image height and width, respectively. + + \snippet tableview/pixelator/imagemodel.cpp data + + This overloaded function allows us to access the pixel data from the image. + When we call this function with the display role, we return the pixel's + gray value. + + \snippet tableview/pixelator/main.cpp registertype + + We need to register our model in the QML type system to be able to use it + from the QML side. + + \snippet tableview/pixelator/main.qml pixelcomponent + + Each pixel in the \c TableView is displayed via a delegate component. + It contains an item that has an implicit height and width defining the + cell size of the table. + It also has a property for the gray value of the pixel that is retrieved + from the model. + + \snippet tableview/pixelator/main.qml rectshape + + Inside the \c Item, there is a rounded \c Rectangle with the size and + radius according to the pixel's gray value. + + \snippet tableview/pixelator/main.qml interaction + + For a little bit of interaction, we place a \c MouseArea inside the \c Item + and change the Rectangle's color on mouse over. + + \snippet tableview/pixelator/main.qml animation + + The \c Rectangle also has a short color animation to fade between the + colors when it is changed. + + \snippet tableview/pixelator/main.qml tableview + + The \c TableView spans over the whole window and has an instance of our + custom \c ImageModel attached. + +*/ diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/Button.qml b/examples/quick/tableview/pixelator/imagemodel.cpp index cd575f6d99..827204bc06 100644 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/Button.qml +++ b/examples/quick/tableview/pixelator/imagemodel.cpp @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtQml module of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage @@ -48,34 +48,61 @@ ** ****************************************************************************/ -import QtQuick 2.0 +#include "imagemodel.h" -Item { - id: container +ImageModel::ImageModel(QObject *parent) + : QAbstractTableModel(parent) +{ +} - property alias label: labelText.text - property color tint: "transparent" - signal clicked +QString ImageModel::source() const +{ + return m_source; +} - width: labelText.width + 70 ; height: labelText.height + 18 +//! [setsource] +void ImageModel::setSource(const QString &source) +{ + if (m_source == source) + return; - BorderImage { - anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } - source: 'images/box-shadow.png' - border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 - } + beginResetModel(); + m_source = source; + m_image.load(m_source); + endResetModel(); +} +//! [setsource] - Image { anchors.fill: parent; source: "images/cardboard.png"; antialiasing: true } +//! [rowcolcount] +int ImageModel::rowCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return 0; + return m_image.height(); +} + +int ImageModel::columnCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return 0; + return m_image.width(); +} +//! [rowcolcount] - Rectangle { - anchors.fill: container; color: container.tint; visible: container.tint != "" - opacity: 0.25 - } - Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent } +//! [data] +QVariant ImageModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid() || role != Qt::DisplayRole) + return QVariant(); + return qGray(m_image.pixel(index.column(), index.row())); +} +//! [data] - MouseArea { - anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } - onClicked: container.clicked() - } +QVariant ImageModel::headerData(int /* section */, Qt::Orientation /* orientation */, + int role) const +{ + if (role == Qt::SizeHintRole) + return QSize(1, 1); + return QVariant(); } diff --git a/examples/quick/tableview/pixelator/imagemodel.h b/examples/quick/tableview/pixelator/imagemodel.h new file mode 100644 index 0000000000..bf0ec90da4 --- /dev/null +++ b/examples/quick/tableview/pixelator/imagemodel.h @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef IMAGEMODEL_H +#define IMAGEMODEL_H + +#include <QAbstractTableModel> +#include <QImage> + +//! [model] +class ImageModel : public QAbstractTableModel +{ + Q_OBJECT + Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged) +public: + ImageModel(QObject *parent = nullptr); + + QString source() const; + void setSource(const QString &source); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + + QVariant headerData(int /* section */, Qt::Orientation /* orientation */, + int role) const override; + +signals: + void sourceChanged(); + +private: + QString m_source; + QImage m_image; +}; +//! [model] + +#endif // IMAGEMODEL_H diff --git a/examples/quick/demos/photoviewer/main.cpp b/examples/quick/tableview/pixelator/main.cpp index a269a61dcb..c57039556a 100644 --- a/examples/quick/demos/photoviewer/main.cpp +++ b/examples/quick/tableview/pixelator/main.cpp @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtQml module of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage @@ -50,19 +50,22 @@ #include <QGuiApplication> #include <QQmlApplicationEngine> -#include <QTranslator> -#include <QDebug> + +#include "imagemodel.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); - QTranslator qtTranslator; - qtTranslator.load("qml_" + QLocale::system().name(), ":/i18n/"); - app.installTranslator(&qtTranslator); - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); + + //! [registertype] + qmlRegisterType<ImageModel>("ImageModel", 1, 0, "ImageModel"); + //! [registertype] + + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; return app.exec(); } diff --git a/examples/quick/tableview/pixelator/main.qml b/examples/quick/tableview/pixelator/main.qml new file mode 100644 index 0000000000..38a25f439f --- /dev/null +++ b/examples/quick/tableview/pixelator/main.qml @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.12 + +import QtQuick.Window 2.12 + +import ImageModel 1.0 + +Window { + visible: true + width: 900 + height: 900 + title: qsTr("TableView Pixelator") + + //! [pixelcomponent] + Component { + id: pixelDelegate + + Item { + readonly property real gray: model.display / 255.0 + readonly property real size: 16 + + implicitWidth: size + implicitHeight: size + //! [pixelcomponent] + + //! [rectshape] + Rectangle { + id: rect + anchors.centerIn: parent + color: "#09102b" + radius: size - gray * size + implicitWidth: radius + implicitHeight: radius + //! [rectshape] + + //! [animation] + ColorAnimation on color { + id: colorAnimation + running: false + to: "#41cd52" + duration: 1500 + } + //! [animation] + } + + //! [interaction] + MouseArea { + anchors.fill: parent + hoverEnabled: true + onEntered: rect.color = "#cecfd5" + onExited: colorAnimation.start() + } + //! [interaction] + } + } + + //! [tableview] + TableView { + id: tableView + anchors.fill: parent + model: ImageModel { + source: ":/qt.png" + } + + delegate: pixelDelegate + } + //! [tableview] +} diff --git a/examples/quick/tableview/pixelator/pixelator.pro b/examples/quick/tableview/pixelator/pixelator.pro new file mode 100644 index 0000000000..6c863cb304 --- /dev/null +++ b/examples/quick/tableview/pixelator/pixelator.pro @@ -0,0 +1,11 @@ +TEMPLATE = app + +QT += quick qml +HEADERS += imagemodel.h +SOURCES += main.cpp \ + imagemodel.cpp + +RESOURCES += qt.png main.qml + +target.path = $$[QT_INSTALL_EXAMPLES]/quick/tableview/pixelator +INSTALLS += target diff --git a/examples/quick/tableview/pixelator/qt.png b/examples/quick/tableview/pixelator/qt.png Binary files differnew file mode 100644 index 0000000000..e3301c4a02 --- /dev/null +++ b/examples/quick/tableview/pixelator/qt.png diff --git a/examples/quick/tableview/tableview.pro b/examples/quick/tableview/tableview.pro new file mode 100644 index 0000000000..4177ef91fb --- /dev/null +++ b/examples/quick/tableview/tableview.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + gameoflife \ + pixelator diff --git a/examples/quick/text/doc/src/text.qdoc b/examples/quick/text/doc/src/text.qdoc index ea6a786e8a..d8bd8d349a 100644 --- a/examples/quick/text/doc/src/text.qdoc +++ b/examples/quick/text/doc/src/text.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/text/fonts/availableFonts.qml b/examples/quick/text/fonts/availableFonts.qml index ad00810b49..ea3bff22b8 100644 --- a/examples/quick/text/fonts/availableFonts.qml +++ b/examples/quick/text/fonts/availableFonts.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/fonts/banner.qml b/examples/quick/text/fonts/banner.qml index 0fcb470bda..961e750d56 100644 --- a/examples/quick/text/fonts/banner.qml +++ b/examples/quick/text/fonts/banner.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/fonts/fonts.qml b/examples/quick/text/fonts/fonts.qml index 43641e2fba..d356e00417 100644 --- a/examples/quick/text/fonts/fonts.qml +++ b/examples/quick/text/fonts/fonts.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/fonts/hello.qml b/examples/quick/text/fonts/hello.qml index c6638275d4..b12641464c 100644 --- a/examples/quick/text/fonts/hello.qml +++ b/examples/quick/text/fonts/hello.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/imgtag/TextWithImage.qml b/examples/quick/text/imgtag/TextWithImage.qml index 5af074ea0a..1cb65e739d 100644 --- a/examples/quick/text/imgtag/TextWithImage.qml +++ b/examples/quick/text/imgtag/TextWithImage.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/imgtag/imgtag.qml b/examples/quick/text/imgtag/imgtag.qml index 59fa88516e..1790853de2 100644 --- a/examples/quick/text/imgtag/imgtag.qml +++ b/examples/quick/text/imgtag/imgtag.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/main.cpp b/examples/quick/text/main.cpp index 4ef05d3d30..e55b3fa739 100644 --- a/examples/quick/text/main.cpp +++ b/examples/quick/text/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/styledtext-layout.qml b/examples/quick/text/styledtext-layout.qml index 82e5ab039d..fe7b40b89b 100644 --- a/examples/quick/text/styledtext-layout.qml +++ b/examples/quick/text/styledtext-layout.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/text.qml b/examples/quick/text/text.qml index d434cf7f24..f97a4e62de 100644 --- a/examples/quick/text/text.qml +++ b/examples/quick/text/text.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/text/textselection/textselection.qml b/examples/quick/text/textselection/textselection.qml index 9b3cddfd9b..0e979c28a4 100644 --- a/examples/quick/text/textselection/textselection.qml +++ b/examples/quick/text/textselection/textselection.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/textureprovider/Label.qml b/examples/quick/textureprovider/Label.qml index 46ef201fc7..3df456fa05 100644 --- a/examples/quick/textureprovider/Label.qml +++ b/examples/quick/textureprovider/Label.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/textureprovider/etcprovider.cpp b/examples/quick/textureprovider/etcprovider.cpp index de8eb12366..65960169e2 100644 --- a/examples/quick/textureprovider/etcprovider.cpp +++ b/examples/quick/textureprovider/etcprovider.cpp @@ -137,7 +137,7 @@ void EtcTexture::bind() #endif QOpenGLContext *ctx = QOpenGLContext::currentContext(); - Q_ASSERT(ctx != 0); + Q_ASSERT(ctx != nullptr); ctx->functions()->glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES, m_size.width(), m_size.height(), 0, (m_paddedSize.width() * m_paddedSize.height()) >> 1, @@ -166,10 +166,10 @@ public: QSize m_size; QSize m_paddedSize; - QSize textureSize() const { return m_size; } - int textureByteCount() const { return m_data.size(); } + QSize textureSize() const override { return m_size; } + int textureByteCount() const override { return m_data.size(); } - QSGTexture *createTexture(QQuickWindow *) const { + QSGTexture *createTexture(QQuickWindow *) const override { EtcTexture *texture = new EtcTexture; texture->m_data = m_data; texture->m_size = m_size; @@ -181,7 +181,7 @@ public: QQuickTextureFactory *EtcProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize) { Q_UNUSED(requestedSize); - QEtcTextureFactory *ret = 0; + QEtcTextureFactory *ret = nullptr; size->setHeight(0); size->setWidth(0); @@ -199,7 +199,7 @@ QQuickTextureFactory *EtcProvider::requestTexture(const QString &id, QSize *size ret = new QEtcTextureFactory; ret->m_data = file.readAll(); if (!ret->m_data.isEmpty()) { - ETCHeader *pETCHeader = NULL; + ETCHeader *pETCHeader = nullptr; pETCHeader = (ETCHeader *)ret->m_data.data(); size->setHeight(getHeight(pETCHeader)); size->setWidth(getWidth(pETCHeader)); @@ -209,7 +209,7 @@ QQuickTextureFactory *EtcProvider::requestTexture(const QString &id, QSize *size } else { delete ret; - ret = 0; + ret = nullptr; } } diff --git a/examples/quick/textureprovider/main.cpp b/examples/quick/textureprovider/main.cpp index ea4f73127d..658620bc82 100644 --- a/examples/quick/textureprovider/main.cpp +++ b/examples/quick/textureprovider/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -48,6 +58,10 @@ int main(int argc, char* argv[]) QGuiApplication app(argc,argv); QQuickView view; + /* + NOTE: ETC compressed textures in PKM files are supported out-of-the-box since Qt 5.10. + However, we retain this example to show how custom texture providers can be integrated. + */ EtcProvider *provider = new EtcProvider(); provider->setBaseUrl(QUrl("qrc:///textureprovider/")); view.engine()->addImageProvider("etc", provider); diff --git a/examples/quick/textureprovider/textureprovider.qml b/examples/quick/textureprovider/textureprovider.qml index dc1946d755..b8cfe31397 100644 --- a/examples/quick/textureprovider/textureprovider.qml +++ b/examples/quick/textureprovider/textureprovider.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/threading/doc/src/threading.qdoc b/examples/quick/threading/doc/src/threading.qdoc index 9e591524e9..f5e5139916 100644 --- a/examples/quick/threading/doc/src/threading.qdoc +++ b/examples/quick/threading/doc/src/threading.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -45,7 +45,7 @@ Inside the worker thread, the ListModel is synchronized once the data is finished loading: - \snippet threading/threadedlistmodel/dataloader.js 0 + \snippet threading/threadedlistmodel/dataloader.mjs 0 \section1 WorkerScript @@ -60,7 +60,7 @@ \snippet threading/workerscript/workerscript.qml 0 The workerscript then is free to take a really long time to calculate it: - \snippet threading/workerscript/workerscript.js 0 + \snippet threading/workerscript/workerscript.mjs 0 When it's done, the result returns to the main scene via the WorkerScript type: diff --git a/examples/quick/threading/main.cpp b/examples/quick/threading/main.cpp index 38bb8d93f5..75b6cab482 100644 --- a/examples/quick/threading/main.cpp +++ b/examples/quick/threading/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/threading/threadedlistmodel/dataloader.js b/examples/quick/threading/threadedlistmodel/dataloader.js deleted file mode 100644 index a6370e0af4..0000000000 --- a/examples/quick/threading/threadedlistmodel/dataloader.js +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// ![0] -WorkerScript.onMessage = function(msg) { - if (msg.action == 'appendCurrentTime') { - var data = {'time': new Date().toTimeString()}; - msg.model.append(data); - msg.model.sync(); // updates the changes to the list - } -} -// ![0] diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/ProgressBar.qml b/examples/quick/threading/threadedlistmodel/dataloader.mjs index 73f7f10ace..86a4424dbc 100644 --- a/examples/quick/demos/photoviewer/PhotoViewerCore/ProgressBar.qml +++ b/examples/quick/threading/threadedlistmodel/dataloader.mjs @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtQml module of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage @@ -48,19 +48,12 @@ ** ****************************************************************************/ -import QtQuick 2.0 - -Item { - id: container - - property real progress: 0 - - Behavior on opacity { NumberAnimation { duration: 600 } } - - Rectangle { anchors.fill: parent; color: "black"; opacity: 0.5 } - - Rectangle { - id: fill; color: "white"; height: container.height - width: container.width * container.progress +// ![0] +WorkerScript.onMessage = function(msg) { + if (msg.action == 'appendCurrentTime') { + var data = {'time': new Date().toTimeString()}; + msg.model.append(data); + msg.model.sync(); // updates the changes to the list } } +// ![0] diff --git a/examples/quick/threading/threadedlistmodel/doc/src/threadedlistmodel.qdoc b/examples/quick/threading/threadedlistmodel/doc/src/threadedlistmodel.qdoc index 7e0a46139a..12596cfdac 100644 --- a/examples/quick/threading/threadedlistmodel/doc/src/threadedlistmodel.qdoc +++ b/examples/quick/threading/threadedlistmodel/doc/src/threadedlistmodel.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/threading/threadedlistmodel/threadedlistmodel.qmlproject b/examples/quick/threading/threadedlistmodel/threadedlistmodel.qmlproject index 578e691289..361f4ba0d3 100644 --- a/examples/quick/threading/threadedlistmodel/threadedlistmodel.qmlproject +++ b/examples/quick/threading/threadedlistmodel/threadedlistmodel.qmlproject @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/threading/threadedlistmodel/timedisplay.qml b/examples/quick/threading/threadedlistmodel/timedisplay.qml index ce09890db9..5ad901c676 100644 --- a/examples/quick/threading/threadedlistmodel/timedisplay.qml +++ b/examples/quick/threading/threadedlistmodel/timedisplay.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -56,7 +66,7 @@ Rectangle { WorkerScript { id: worker - source: "dataloader.js" + source: "dataloader.mjs" } // ![0] diff --git a/examples/quick/threading/threading.qml b/examples/quick/threading/threading.qml index 4fe725d460..674e4a4bc6 100644 --- a/examples/quick/threading/threading.qml +++ b/examples/quick/threading/threading.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/threading/threading.qrc b/examples/quick/threading/threading.qrc index 6d15b7ef71..5dc6dff443 100644 --- a/examples/quick/threading/threading.qrc +++ b/examples/quick/threading/threading.qrc @@ -2,9 +2,9 @@ <qresource prefix="/threading"> <file>threading.qml</file> <file>threadedlistmodel/timedisplay.qml</file> - <file>threadedlistmodel/dataloader.js</file> + <file>threadedlistmodel/dataloader.mjs</file> <file>workerscript/Spinner.qml</file> - <file>workerscript/workerscript.js</file> + <file>workerscript/workerscript.mjs</file> <file>workerscript/workerscript.qml</file> </qresource> </RCC> diff --git a/examples/quick/threading/workerscript/Spinner.qml b/examples/quick/threading/workerscript/Spinner.qml index 66e16b37df..9c70090dba 100644 --- a/examples/quick/threading/workerscript/Spinner.qml +++ b/examples/quick/threading/workerscript/Spinner.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/threading/workerscript/workerscript.js b/examples/quick/threading/workerscript/workerscript.mjs index bb15816d54..9953958086 100644 --- a/examples/quick/threading/workerscript/workerscript.js +++ b/examples/quick/threading/workerscript/workerscript.mjs @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/threading/workerscript/workerscript.qml b/examples/quick/threading/workerscript/workerscript.qml index 32f727581b..735cc8d1f1 100644 --- a/examples/quick/threading/workerscript/workerscript.qml +++ b/examples/quick/threading/workerscript/workerscript.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -46,7 +56,7 @@ Rectangle { //! [1] WorkerScript { id: myWorker - source: "workerscript.js" + source: "workerscript.mjs" onMessage: { if (messageObject.row == rowSpinner.value && messageObject.column == columnSpinner.value){ //Not an old result diff --git a/examples/quick/threading/workerscript/workerscript.qmlproject b/examples/quick/threading/workerscript/workerscript.qmlproject index b17bf39be0..6ab433e63b 100644 --- a/examples/quick/threading/workerscript/workerscript.qmlproject +++ b/examples/quick/threading/workerscript/workerscript.qmlproject @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc b/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc index e66d5c5654..8526a9d58f 100644 --- a/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc +++ b/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/touchinteraction/flickable/basic-flickable.qml b/examples/quick/touchinteraction/flickable/basic-flickable.qml index 3a0312547b..45e835bf45 100644 --- a/examples/quick/touchinteraction/flickable/basic-flickable.qml +++ b/examples/quick/touchinteraction/flickable/basic-flickable.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/flickable/content/Panel.qml b/examples/quick/touchinteraction/flickable/content/Panel.qml index 1c17c4aeb8..21f8fc8afd 100644 --- a/examples/quick/touchinteraction/flickable/content/Panel.qml +++ b/examples/quick/touchinteraction/flickable/content/Panel.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/flickable/corkboards.qml b/examples/quick/touchinteraction/flickable/corkboards.qml index 738651ee5b..afb5dd309c 100644 --- a/examples/quick/touchinteraction/flickable/corkboards.qml +++ b/examples/quick/touchinteraction/flickable/corkboards.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/main.cpp b/examples/quick/touchinteraction/main.cpp index c326d5790b..5dda8e7ed7 100644 --- a/examples/quick/touchinteraction/main.cpp +++ b/examples/quick/touchinteraction/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/multipointtouch/bearwhack.qml b/examples/quick/touchinteraction/multipointtouch/bearwhack.qml index 7bf3758f52..49bd0b9db8 100644 --- a/examples/quick/touchinteraction/multipointtouch/bearwhack.qml +++ b/examples/quick/touchinteraction/multipointtouch/bearwhack.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml b/examples/quick/touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml index 376d9cecd4..5750ffcad1 100644 --- a/examples/quick/touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml +++ b/examples/quick/touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml b/examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml index 297399567d..3db9eaf1e5 100644 --- a/examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml +++ b/examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml b/examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml index 509a7ac2d0..4c201720d9 100644 --- a/examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml +++ b/examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/multipointtouch/multiflame.qml b/examples/quick/touchinteraction/multipointtouch/multiflame.qml index a83b9d7cc7..514d583044 100644 --- a/examples/quick/touchinteraction/multipointtouch/multiflame.qml +++ b/examples/quick/touchinteraction/multipointtouch/multiflame.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/pincharea/flickresize.qml b/examples/quick/touchinteraction/pincharea/flickresize.qml index b81cacecf1..65db04693d 100644 --- a/examples/quick/touchinteraction/pincharea/flickresize.qml +++ b/examples/quick/touchinteraction/pincharea/flickresize.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/touchinteraction/touchinteraction.qml b/examples/quick/touchinteraction/touchinteraction.qml index 2ffb5135c2..a95867b6c1 100644 --- a/examples/quick/touchinteraction/touchinteraction.qml +++ b/examples/quick/touchinteraction/touchinteraction.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview1/PetsModel.qml b/examples/quick/tutorials/dynamicview/dynamicview1/PetsModel.qml index 580c9ad1bb..e9ffcc3cfd 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview1/PetsModel.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview1/PetsModel.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml b/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml index c6dd802493..60167aa813 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview1/dynamicview.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview2/PetsModel.qml b/examples/quick/tutorials/dynamicview/dynamicview2/PetsModel.qml index f72b6f7183..bc8751f00a 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview2/PetsModel.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview2/PetsModel.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview2/dynamicview.qml b/examples/quick/tutorials/dynamicview/dynamicview2/dynamicview.qml index fc01d7ffc9..2c67c46df2 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview2/dynamicview.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview2/dynamicview.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview3/PetsModel.qml b/examples/quick/tutorials/dynamicview/dynamicview3/PetsModel.qml index f72b6f7183..bc8751f00a 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview3/PetsModel.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview3/PetsModel.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml b/examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml index 40789d4dea..6c64ee2893 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview3/dynamicview.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview4/ListSelector.qml b/examples/quick/tutorials/dynamicview/dynamicview4/ListSelector.qml index 1ee158c068..b58a704303 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview4/ListSelector.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview4/ListSelector.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview4/PetsModel.qml b/examples/quick/tutorials/dynamicview/dynamicview4/PetsModel.qml index f72b6f7183..bc8751f00a 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview4/PetsModel.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview4/PetsModel.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml b/examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml index cb5ff1cce1..327ca0cea7 100644 --- a/examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml +++ b/examples/quick/tutorials/dynamicview/dynamicview4/dynamicview.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -175,7 +185,7 @@ Rectangle { //![1] items.includeByDefault: false //![5] - groups: VisualDataGroup { + groups: DelegateModelGroup { id: unsortedItems name: "unsorted" diff --git a/examples/quick/tutorials/gettingStartedQml/core/Button.qml b/examples/quick/tutorials/gettingStartedQml/core/Button.qml deleted file mode 100644 index 14f1767b93..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/core/Button.qml +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - // Identifier of the item - id: button - - // These properties act as constants, useable outside this QML file - property int buttonHeight: 75 - property int buttonWidth: 150 - - // Attaches to the Text element's text content - property string label - property color textColor: buttonLabel.color - - // The color highlight when the mouse hovers on the rectangle - property color onHoverColor: "lightsteelblue" - property color borderColor: "transparent" - - // buttonColor is set to the button's main color - property color buttonColor: "lightblue" - - property real labelSize: 14 - // Set appearance properties - radius: 6 - antialiasing: true - border.width: 2 - border.color: borderColor - width: buttonWidth - height: buttonHeight - - Text { - id: buttonLabel - anchors.centerIn: parent - text: label // Bind the text to the parent's text - color: "#DCDCCC" - font.pointSize: labelSize - } - - // buttonClick() is callable and a signal handler, - // onButtonClick is automatically created - signal buttonClick() - - // Define the clickable area to be the whole rectangle - MouseArea { - id: buttonMouseArea - anchors.fill: parent // Stretch the area to the parent's dimension - onClicked: buttonClick() - - // If true, then onEntered and onExited called if mouse hovers in the mouse area - // If false, a button must be clicked to detect the mouse hover - hoverEnabled: true - - // Display a border if the mouse hovers on the button mouse area - onEntered: parent.border.color = onHoverColor - //Remove the border if the mouse exits the button mouse area - onExited: parent.border.color = borderColor - } - - // Change the color of the button when pressed - color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor - // Animate the color whenever the color property changes - Behavior on color { ColorAnimation { duration: 55 } } - - // Scale the button when pressed - scale: buttonMouseArea.pressed ? 1.1 : 1.0 - // Animate the scale property change - Behavior on scale { NumberAnimation { duration: 55 } } -} diff --git a/examples/quick/tutorials/gettingStartedQml/core/EditMenu.qml b/examples/quick/tutorials/gettingStartedQml/core/EditMenu.qml deleted file mode 100644 index 7db5e8a106..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/core/EditMenu.qml +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: editMenu - width: 1000; height: 480 - color: "powderblue" - property color buttonBorderColor: "#7A8182" - property color buttonFillColor: "#61BDCACD" - property string menuName:"Edit" - - gradient: Gradient { - GradientStop { position: 0.0; color: "#6A7570" } - GradientStop { position: 1.0; color: Qt.darker("#6A7570") } - } - - Rectangle { - id: actionContainer - color: "transparent" - anchors.centerIn: parent - width: parent.width - height: parent.height / 5 - - Row { - anchors.centerIn: parent - spacing: parent.width / 9 - Button { - id: loadButton - buttonColor: buttonFillColor - label: "Copy" - labelSize: 16 - borderColor: buttonBorderColor - height: actionContainer.height - width: actionContainer.width / 6 - onButtonClick: textArea.copy() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor, 1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor, 1.3) } - } - } - - Button { - id: saveButton - height: actionContainer.height - width: actionContainer.width / 6 - buttonColor: buttonFillColor - label: "Paste" - borderColor: buttonBorderColor - labelSize: 16 - onButtonClick: textArea.paste() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor, 1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor, 1.3) } - } - } - - Button { - id: exitButton - label: "Select All" - height: actionContainer.height - width: actionContainer.width/6 - labelSize: 16 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - onButtonClick: textArea.selectAll() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor, 1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor, 1.3) } - } - } - } - } -} diff --git a/examples/quick/tutorials/gettingStartedQml/core/FileDialog.qml b/examples/quick/tutorials/gettingStartedQml/core/FileDialog.qml deleted file mode 100644 index a8e2160590..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/core/FileDialog.qml +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 - -Rectangle { - id: dialog - width: 200 - height: 200 * partition - color: "transparent" - - signal selectChanged() - signal notifyRefresh() - onNotifyRefresh: dirView.model = directory.files - - property string selectedFile - property int selectedIndex: 0 - - Rectangle { - id: dirBox - radius: 10 - antialiasing: true - anchors.centerIn: parent - height: parent.height -15 - width: parent.width - 30 - - Rectangle { - id: header - height: parent.height * 0.1 - width: parent.width - radius: 3 - antialiasing: true - z: 1 - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.98;color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#0e1B20" } - } - Text { - height: header.height - anchors.centerIn: header - text: "files:" - color: "lightblue" - font.weight: Font.Light - font.italic: true - } - } - - GridView { - id: dirView - width: parent.width - height: parent.height * 0.9 - anchors.top: header.bottom - cellWidth: 100 - cellHeight: 75 - model: directory.files - delegate: dirDelegate - clip: true - highlightMoveDuration: 40 - } - - Component { - id: dirDelegate - - Rectangle { - id: file - color: "transparent" - width: dirView.cellWidth - height: dirView.cellHeight - - Text { - id: fileName - width: parent.width - anchors.centerIn: parent - text: name - color: "#BDCACD" - font.weight: dirView.currentIndex == index ? Font.DemiBold : Font.Normal - font.pointSize: dirView.currentIndex == index ? 12 : 10 - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - } - - Rectangle { - id: selection - width: parent.width - height: parent.height - anchors.centerIn: parent - radius: 10 - antialiasing: true - scale: dirView.currentIndex == index ? 1 : 0.5 - opacity: dirView.currentIndex == index ? 1 : 0 - - Text { - id: overlay - width: parent.width - anchors.centerIn: parent - text: name - color: "#696167" - font.weight: Font.DemiBold - font.pointSize: 12 - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - } - - Behavior on opacity { NumberAnimation{ duration: 45 } } - Behavior on scale { NumberAnimation{ duration: 45 } } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter("lightsteelblue", 1.25) } - GradientStop { position: 0.67; color: Qt.darker("lightsteelblue", 1.30) } - } - border.color: "lightsteelblue" - border.width: 1 - } - - MouseArea { - id: fileMouseArea - anchors.fill: parent - hoverEnabled: true - - onClicked: { - dirView.currentIndex = index - selectedFile = directory.files[index].name - selectChanged() - } - onEntered: { - fileName.color = "lightsteelblue" - fileName.font.weight = Font.DemiBold - } - onExited: { - fileName.font.weight = Font.Normal - fileName.color = "#BDCACD" - } - } - } - } - - gradient: Gradient { - GradientStop { position: 0.0; color: "#A5333333" } - GradientStop { position: 1.0; color: "#03333333" } - } - } -} diff --git a/examples/quick/tutorials/gettingStartedQml/core/FileMenu.qml b/examples/quick/tutorials/gettingStartedQml/core/FileMenu.qml deleted file mode 100644 index b43232d57b..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/core/FileMenu.qml +++ /dev/null @@ -1,245 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import FileDialog 1.0 - -Rectangle { - id: fileMenu - height: 480 - width: 1000 - property color buttonBorderColor: "#7F8487" - property color buttonFillColor: "#8FBDCACD" - property string fileContent: directory.fileContent - - // menuName is accessible from outside this QML file - property string menuName: "File" - - // Used to divide the screen into parts - property real partition: 1 / 3 - - color: "#6C646A" - gradient: Gradient { - GradientStop { position: 0.0; color: "#6C646A" } - GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") } - } - - Directory { - id: directory - filename: textInput.text - onDirectoryChanged: fileDialog.notifyRefresh() - } - - Rectangle { - id: actionContainer - - // Make this rectangle invisible - color: "transparent" - anchors.left: parent.left - - // The height is a good proportion that creates more space at the - // top of the column of buttons - width: fileMenu.width * partition - height: fileMenu.height - - Column { - anchors.centerIn: parent - spacing: parent.height / 32 - - Button { - id: saveButton - label: "Save" - borderColor: buttonBorderColor - buttonColor: buttonFillColor - width: actionContainer.width / 1.3 - height: actionContainer.height / 8 - labelSize: 24 - onButtonClick: { - directory.fileContent = textArea.textContent - directory.filename = textInput.text - directory.saveFile() - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - - Button { - id: loadButton - width: actionContainer.width / 1.3 - height: actionContainer.height / 8 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - label: "Load" - labelSize: 24 - onButtonClick: { - directory.filename = textInput.text - directory.loadFile() - textArea.textContent = directory.fileContent - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - Button { - id: newButton - width: actionContainer.width / 1.3 - height: actionContainer.height / 8 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - label: "New" - labelSize: 24 - onButtonClick: { - textArea.textContent = "" - textInput.text = "" - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - Rectangle{ - id: space - width: actionContainer.width/ 1.3 - height: actionContainer.height / 16 - color: "transparent" - } - Button { - id: exitButton - width: actionContainer.width / 1.3 - height: actionContainer.height / 8 - label: "Exit" - labelSize: 24 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - onButtonClick: Qt.quit() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - } - } - - Rectangle { - id: dialogContainer - - width: 2 * fileMenu.width * partition - height: fileMenu.height - anchors.right: parent.right - color: "transparent" - - Column { - anchors.centerIn: parent - spacing: parent.height / 640 - FileDialog { - id: fileDialog - height: 2 * dialogContainer.height * partition - width: dialogContainer.width - onSelectChanged: textInput.text = selectedFile - } - - Rectangle { - id: lowerPartition - height: dialogContainer.height * partition - width: dialogContainer.width - color: "transparent" - - Rectangle { - id: nameField - - gradient: Gradient{ - GradientStop { position: 0.0; color: "#806F6F6F" } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - - radius: 10 - anchors { centerIn: parent; leftMargin: 15; rightMargin: 15; topMargin: 15 } - height: parent.height - 15 - width: parent.width - 20 - border { color:"#4A4A4A"; width: 1 } - - TextInput { - id: textInput - z: 2 - anchors { bottom: parent.bottom; topMargin: 10; horizontalCenter: parent.horizontalCenter } - width: parent.width - 10 - height: parent.height - 10 - font.pointSize: 40 - color: "lightsteelblue" - focus: true - } - - Text { - id: textInstruction - anchors.centerIn: parent - text: "Select file name and press Save or Load" - font { pointSize: 11; weight: Font.Light; italic: true } - color: "lightblue" - z: 2 - opacity: (textInput.text == "") ? 1 : 0 - } - - Text { - id: fieldLabel - anchors { top: parent.top; left: parent.left } - text: " file name: " - font { pointSize: 11; weight: Font.Light; italic: true } - color: "lightblue" - z: 2 - } - - MouseArea { - anchors.centerIn: parent - width: nameField.width - height: nameField.height - onClicked: { - textInput.text = "" - textInput.focus = true - textInput.forceFocus() - } - } - } - } - } - } -} diff --git a/examples/quick/tutorials/gettingStartedQml/core/MenuBar.qml b/examples/quick/tutorials/gettingStartedQml/core/MenuBar.qml deleted file mode 100644 index 58845e7b38..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/core/MenuBar.qml +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQml.Models 2.1 - -Rectangle { - id: menuBar - width: 1000; height: 300 - color: "transparent" - property color fileColor: "plum" - property color editColor: "powderblue" - - property real partition: 1 / 10 - - Column { - anchors.fill: parent - z: 1 - - // Container for the header and the buttons - Rectangle { - id: labelList - height: menuBar.height * partition - width: menuBar.width - color: "beige" - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.98;color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#0e1B20" } - } - - Text { - height: parent.height - anchors { right: labelRow.left; verticalCenter: parent.bottom } - text: "menu: " - color: "lightblue" - font { weight: Font.Light; italic: true } - } - - // Row displays its children in a vertical row - Row { - id: labelRow - anchors.centerIn: parent - spacing: 40 - - Button { - id: fileButton - width: 50; height: 20 - label: "File" - buttonColor: menuListView.currentIndex == 0 ? fileColor : Qt.darker(fileColor, 1.5) - scale: menuListView.currentIndex == 0 ? 1.25 : 1 - labelSize: menuListView.currentIndex == 0 ? 16 : 12 - radius: 1 - - // On a button click, change the list's currently selected item to FileMenu - onButtonClick: menuListView.currentIndex = 0 - - gradient: Gradient { - GradientStop { position: 0.0; color: fileColor } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - } - - Button { - id: editButton - width: 50; height: 20 - buttonColor : menuListView.currentIndex == 1 ? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9) - scale: menuListView.currentIndex == 1 ? 1.25 : 1 - label: "Edit" - radius: 1 - labelSize: menuListView.currentIndex == 1 ? 16 : 12 - - //on a button click, change the list's currently selected item to EditMenu - onButtonClick: menuListView.currentIndex = 1 - gradient: Gradient { - GradientStop { position: 0.0; color: editColor } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - } - } - } - - // A ListView will display a model according to a delegate - ListView { - id: menuListView - width: menuBar.width - height: 9 * menuBar.height * partition - - // The model contains the data - model: menuListModel - - //control the movement of the menu switching - snapMode: ListView.SnapOneItem - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 5000 - highlightFollowsCurrentItem: true - highlightMoveDuration: 240 - highlightRangeMode: ListView.StrictlyEnforceRange - } - } - - // A list of visual items that already have delegates handling their display - ObjectModel { - id: menuListModel - - FileMenu { - id: fileMenu - width: menuListView.width - height: menuListView.height - color: fileColor - } - EditMenu { - color: editColor - width: menuListView.width - height: menuListView.height - } - } -} diff --git a/examples/quick/tutorials/gettingStartedQml/core/TextArea.qml b/examples/quick/tutorials/gettingStartedQml/core/TextArea.qml deleted file mode 100644 index c4e2ccd1da..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/core/TextArea.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: textArea - - function paste() { textEdit.paste() } - function copy() { textEdit.copy() } - function selectAll() { textEdit.selectAll() } - - width: 400; height: 400 - - property color fontColor: "white" - property alias textContent: textEdit.text - - Flickable { - id: flickArea - width: parent.width - height: parent.height - anchors.fill: parent - - boundsBehavior: Flickable.StopAtBounds - flickableDirection: Flickable.HorizontalFlick - interactive: true - - // Move the content coordinates to make the text area - // visible when scrolled with keyboard strokes - function ensureVisible(r) { - if (contentX >= r.x) - contentX = r.x; - else if (contentX + width <= r.x + r.width) - contentX = r.x + r.width - width; - if (contentY >= r.y) - contentY = r.y; - else if (contentY + height <= r.y + r.height) - contentY = r.y + r.height - height; - } - - TextEdit { - id: textEdit - anchors.fill: parent - width: parent.width - height: parent.height - color: fontColor - focus: true - wrapMode: TextEdit.Wrap - font.pointSize: 10 - onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle) - selectByMouse: true - } - } -} diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp b/examples/quick/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp deleted file mode 100644 index 26ea32c4ff..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "dialogPlugin.h" -#include "directory.h" -#include "file.h" -#include <QtQml> - -void DialogPlugin::registerTypes(const char *uri) -{ - // Register the class Directory into QML as a "Directory" type version 1.0 - // @uri FileDialog - qmlRegisterType<Directory>(uri, 1, 0, "Directory"); - qmlRegisterType<File>(uri, 1, 0, "File"); -} diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/dialogPlugin.h b/examples/quick/tutorials/gettingStartedQml/filedialog/dialogPlugin.h deleted file mode 100644 index c6a4e22c09..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/dialogPlugin.h +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DIALOGPLUGIN_H -#define DIALOGPLUGIN_H - -#include <QtQml/QQmlExtensionPlugin> - -class DialogPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.QmlExtensionPlugin.FileDialog") - public: - //registerTypes is inherited from QQmlExtensionPlugin - void registerTypes(const char *uri); - -}; - -#endif - diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/directory.cpp b/examples/quick/tutorials/gettingStartedQml/filedialog/directory.cpp deleted file mode 100644 index 8150ee59f8..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/directory.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "directory.h" -#include <QDebug> - -/* - Directory constructor - - Initialize the saves directory and creates the file list -*/ -Directory::Directory(QObject *parent) : QObject(parent) -{ - m_dir.cd(QDir::currentPath()); - - // Go to the saved directory. if not found, create it - m_saveDir = "saves"; - if (m_dir.cd(m_saveDir) == 0) { - m_dir.mkdir(m_saveDir); - m_dir.cd(m_saveDir); - } - m_filterList << "*.txt"; - - refresh(); -} - -/* - Directory::filesCount - Returns the number of files -*/ -int Directory::filesCount() const -{ - return m_fileList.size(); -} - -/* - Function to append data into list property -*/ -void appendFiles(QQmlListProperty<File> *property, File *file) -{ - Q_UNUSED(property) - Q_UNUSED(file) - // Do nothing. can't add to a directory using this method -} - -/* - Function called to retrieve file in the list using an index -*/ -File* fileAt(QQmlListProperty<File> *property, int index) -{ - return static_cast< QList<File *> *>(property->data)->at(index); -} - -/* - Returns the number of files in the list -*/ -int filesSize(QQmlListProperty<File> *property) -{ - return static_cast< QList<File *> *>(property->data)->size(); -} - -/* - Function called to empty the list property contents -*/ -void clearFilesPtr(QQmlListProperty<File> *property) -{ - return static_cast< QList<File *> *>(property->data)->clear(); -} - -/* - Returns the list of files as a QQmlListProperty. -*/ -QQmlListProperty<File> Directory::files() -{ - refresh(); - return QQmlListProperty<File>(this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr); -} - -/* - Return the name of the currently selected file. -*/ -QString Directory::filename() const -{ - return currentFile.name(); -} - -/* - Return the file's content as a string. -*/ -QString Directory::fileContent() const -{ - return m_fileContent; -} - -/* - Set the file name of the current file. -*/ -void Directory::setFilename(const QString &str) -{ - if (str != currentFile.name()) { - currentFile.setName(str); - emit filenameChanged(); - } -} - -/* - Set the content of the file as a string. -*/ -void Directory::setFileContent(const QString &str) -{ - if (str != m_fileContent) { - m_fileContent = str; - emit fileContentChanged(); - } -} - -/* - Called from QML to save the file using the filename and content. - Makes sure that the file has a .txt extension. -*/ -void Directory::saveFile() -{ - if (currentFile.name().size() == 0) { - qWarning() << "Cannot save file, empty filename."; - return; - } - - QString extendedName = currentFile.name(); - if (!currentFile.name().endsWith(".txt")) { - extendedName.append(".txt"); - } - - QFile file(m_dir.filePath(extendedName)); - if (file.open(QFile::WriteOnly | QFile::Truncate)) { - QTextStream outStream(&file); - outStream << m_fileContent; - } - - file.close(); - refresh(); - emit directoryChanged(); -} - -/* - Load the contents of a file. - Only loads files with a .txt extension -*/ -void Directory::loadFile() -{ - m_fileContent.clear(); - QString extendedName = currentFile.name(); - if (!currentFile.name().endsWith(".txt")) { - extendedName.append(".txt"); - } - - QFile file( m_dir.filePath(extendedName)); - if (file.open(QFile::ReadOnly )) { - QTextStream inStream(&file); - QString line; - - do { - line = inStream.read(75); - m_fileContent.append(line); - } while (!line .isNull()); - } - file.close(); -} - -/* - Reloads the content of the files list. This is to ensure - that the newly created files are added onto the list. -*/ -void Directory::refresh() -{ - m_dirFiles = m_dir.entryList(m_filterList, QDir::Files, QDir::Name); - m_fileList.clear(); - - File * file; - for (int i = 0; i < m_dirFiles.size(); i ++) { - file = new File(); - - if (m_dirFiles.at(i).endsWith(".txt")) { - QString name = m_dirFiles.at(i); - file->setName(name.remove(".txt", Qt::CaseSensitive)); - } else { - file->setName(m_dirFiles.at(i)); - } - m_fileList.append(file); - } -} diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/directory.h b/examples/quick/tutorials/gettingStartedQml/filedialog/directory.h deleted file mode 100644 index 713bb2a1f9..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/directory.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DIRECTORY_H -#define DIRECTORY_H - -#include "file.h" - -#include <QDir> -#include <QStringList> -#include <QTextStream> -#include <QQmlListProperty> -#include <QObject> - -class Directory : public QObject { - Q_OBJECT - - // Number of files in the directory - Q_PROPERTY(int filesCount READ filesCount) - - // List property containing file names as QString - Q_PROPERTY(QQmlListProperty<File> files READ files CONSTANT) - - // File name of the text file to read/write - Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged) - - // Text content of the file - Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged) - -public: - Directory(QObject *parent = 0); - - // Properties' read functions - int filesCount() const; - QString filename() const; - QString fileContent() const; - QQmlListProperty<File> files(); - - // Properties' write functions - void setFilename(const QString &str); - void setFileContent(const QString &str); - - // Accessible from QML - Q_INVOKABLE void saveFile(); - Q_INVOKABLE void loadFile(); - -signals: - void directoryChanged(); - void filenameChanged(); - void fileContentChanged(); - -private: - QDir m_dir; - QStringList m_dirFiles; - File currentFile; - QString m_saveDir; - QStringList m_filterList; - - // Contains the file data in QString format - QString m_fileContent; - - // Registered to QML in a plugin. Accessible from QML as a property of Directory - QList<File *> m_fileList; - - // Refresh content of the directory - void refresh(); -}; - -#endif diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/file.cpp b/examples/quick/tutorials/gettingStartedQml/filedialog/file.cpp deleted file mode 100644 index 23f57dc7b8..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/file.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "file.h" - -File::File(QObject *parent) : QObject(parent) -{ -} - -QString File::name() const -{ - return m_name; -} - -void File::setName(const QString &str) -{ - if (str != m_name) { - m_name = str; - emit nameChanged(); - } -} diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/file.h b/examples/quick/tutorials/gettingStartedQml/filedialog/file.h deleted file mode 100644 index 4347bcb1dc..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/file.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FILE_H -#define FILE_H - -#include <QObject> -#include <QString> - -class File : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - -public: - File(QObject *parent = 0); - - QString name() const; - void setName(const QString &str); - -signals: - void nameChanged(); - -private: - QString m_name; -}; - -#endif diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/filedialog.pro b/examples/quick/tutorials/gettingStartedQml/filedialog/filedialog.pro deleted file mode 100644 index 8f8f4549aa..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/filedialog.pro +++ /dev/null @@ -1,28 +0,0 @@ -TEMPLATE = lib -CONFIG += plugin -QT += qml - -DESTDIR += ../imports/FileDialog -OBJECTS_DIR = tmp -MOC_DIR = tmp - -TARGET = filedialogplugin - -HEADERS += \ - directory.h \ - file.h \ - dialogPlugin.h - -SOURCES += \ - directory.cpp \ - file.cpp \ - dialogPlugin.cpp - -EXAMPLE_FILES += qmldir - -# Copy the qmldir file to the same folder as the plugin binary -cpqmldir.files = $$PWD/qmldir -cpqmldir.path = $$DESTDIR -COPIES += cpqmldir - -CONFIG += install_ok # Do not cargo-cult this! diff --git a/examples/quick/tutorials/gettingStartedQml/filedialog/qmldir b/examples/quick/tutorials/gettingStartedQml/filedialog/qmldir deleted file mode 100644 index fbcd5f7fd3..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/filedialog/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -module FileDialog -plugin filedialogplugin diff --git a/examples/quick/tutorials/gettingStartedQml/gettingStartedQml.pro b/examples/quick/tutorials/gettingStartedQml/gettingStartedQml.pro deleted file mode 100644 index 725ff3bbac..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/gettingStartedQml.pro +++ /dev/null @@ -1,11 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = \ - filedialog\ - -EXAMPLE_FILES = \ - core \ - images \ - parts \ - pics \ - texteditor.qmlproject \ - texteditor.qml diff --git a/examples/quick/tutorials/gettingStartedQml/images/arrow.png b/examples/quick/tutorials/gettingStartedQml/images/arrow.png Binary files differdeleted file mode 100644 index 20ee200f5f..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/images/arrow.png +++ /dev/null diff --git a/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_editmenu.png b/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_editmenu.png Binary files differdeleted file mode 100644 index 27feed5e82..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_editmenu.png +++ /dev/null diff --git a/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_filemenu.png b/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_filemenu.png Binary files differdeleted file mode 100644 index 4d8f9f22b2..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_filemenu.png +++ /dev/null diff --git a/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_newfile.png b/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_newfile.png Binary files differdeleted file mode 100644 index 680acfe839..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/pics/qml-texteditor5_newfile.png +++ /dev/null diff --git a/examples/quick/tutorials/gettingStartedQml/texteditor.qml b/examples/quick/tutorials/gettingStartedQml/texteditor.qml deleted file mode 100644 index 167c3fdb52..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/texteditor.qml +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the QtQml module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "core" - -Rectangle { - id: screen - width: 1000; height: 1000 - property int partition: height / 3 - state: "DRAWER_CLOSED" - - // Item 1: MenuBar on the top portion of the screen - MenuBar { - id: menuBar - height: screen.partition - width: screen.width - z: 1 - } - - //Item 2: The editable text area - TextArea { - id: textArea - y: drawer.height - color: "#3F3F3F" - fontColor: "#DCDCCC" - height: partition * 2 - width: parent.width - } - - // Item 3: The drawer handle - Rectangle { - id: drawer - height:15; width: parent.width - border.color : "#6A6D6A" - border.width: 1 - z: 1 - - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.77; color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#6A6D6A" } - } - - Image { - id: arrowIcon - source: "images/arrow.png" - anchors.horizontalCenter: parent.horizontalCenter - - Behavior { NumberAnimation { property: "rotation"; easing.type: Easing.OutExpo } } - } - - MouseArea { - id: drawerMouseArea - anchors.fill: parent - hoverEnabled: true - onEntered: parent.border.color = Qt.lighter("#6A6D6A") - onExited: parent.border.color = "#6A6D6A" - onClicked: { - if (screen.state == "DRAWER_CLOSED") - screen.state = "DRAWER_OPEN" - else if (screen.state == "DRAWER_OPEN") - screen.state = "DRAWER_CLOSED" - } - } - } - -//! [states] - states: [ - State { - name: "DRAWER_OPEN" - PropertyChanges { target: menuBar; y: 0 } - PropertyChanges { target: textArea; y: partition + drawer.height } - PropertyChanges { target: drawer; y: partition } - PropertyChanges { target: arrowIcon; rotation: 180 } - }, - State { - name: "DRAWER_CLOSED" - PropertyChanges { target: menuBar; y: -height; } - PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height } - PropertyChanges { target: drawer; y: 0 } - PropertyChanges { target: arrowIcon; rotation: 0 } - } - ] -//! [states] - -//! [transitions] - transitions: [ - Transition { - to: "*" - NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type: Easing.OutExpo } - NumberAnimation { target: menuBar; properties: "y"; duration: 100; easing.type: Easing.OutExpo } - NumberAnimation { target: drawer; properties: "y"; duration: 100; easing.type: Easing.OutExpo } - } - ] -//! [transitions] -} diff --git a/examples/quick/tutorials/gettingStartedQml/texteditor.qmlproject b/examples/quick/tutorials/gettingStartedQml/texteditor.qmlproject deleted file mode 100644 index 72bdcdea73..0000000000 --- a/examples/quick/tutorials/gettingStartedQml/texteditor.qmlproject +++ /dev/null @@ -1,20 +0,0 @@ -import QmlProject 1.0 - -Project { - mainFile: "texteditor.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - - JavaScriptFiles { - directory: "." - } - - ImageFiles { - directory: "." - } - - importPaths: ["./imports"] -} diff --git a/examples/quick/tutorials/helloworld/Cell.qml b/examples/quick/tutorials/helloworld/Cell.qml index 8c4d5e2a2d..33b9bf9935 100644 --- a/examples/quick/tutorials/helloworld/Cell.qml +++ b/examples/quick/tutorials/helloworld/Cell.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/helloworld/tutorial1.qml b/examples/quick/tutorials/helloworld/tutorial1.qml index 960c7903b4..73cdd7911b 100644 --- a/examples/quick/tutorials/helloworld/tutorial1.qml +++ b/examples/quick/tutorials/helloworld/tutorial1.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/helloworld/tutorial2.qml b/examples/quick/tutorials/helloworld/tutorial2.qml index a28b2c3c43..8b13b28c58 100644 --- a/examples/quick/tutorials/helloworld/tutorial2.qml +++ b/examples/quick/tutorials/helloworld/tutorial2.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/helloworld/tutorial3.qml b/examples/quick/tutorials/helloworld/tutorial3.qml index 9309a49837..8c40b40e1a 100644 --- a/examples/quick/tutorials/helloworld/tutorial3.qml +++ b/examples/quick/tutorials/helloworld/tutorial3.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame1/Block.qml b/examples/quick/tutorials/samegame/samegame1/Block.qml index 85984cb465..eac8e93810 100644 --- a/examples/quick/tutorials/samegame/samegame1/Block.qml +++ b/examples/quick/tutorials/samegame/samegame1/Block.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame1/Button.qml b/examples/quick/tutorials/samegame/samegame1/Button.qml index 0f678c1606..ddab89e56d 100644 --- a/examples/quick/tutorials/samegame/samegame1/Button.qml +++ b/examples/quick/tutorials/samegame/samegame1/Button.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame1/samegame.qml b/examples/quick/tutorials/samegame/samegame1/samegame.qml index e8c5ff7a58..68a1921da7 100644 --- a/examples/quick/tutorials/samegame/samegame1/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame1/samegame.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame2/Block.qml b/examples/quick/tutorials/samegame/samegame2/Block.qml index 369e46de3b..12cc0ea043 100644 --- a/examples/quick/tutorials/samegame/samegame2/Block.qml +++ b/examples/quick/tutorials/samegame/samegame2/Block.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame2/Button.qml b/examples/quick/tutorials/samegame/samegame2/Button.qml index 1d40677a30..77921772d2 100644 --- a/examples/quick/tutorials/samegame/samegame2/Button.qml +++ b/examples/quick/tutorials/samegame/samegame2/Button.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame2/samegame.qml b/examples/quick/tutorials/samegame/samegame2/samegame.qml index 8c35c80080..2c68fcf155 100644 --- a/examples/quick/tutorials/samegame/samegame2/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame2/samegame.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame3/Block.qml b/examples/quick/tutorials/samegame/samegame3/Block.qml index 7b2f1fb42a..d49bf89727 100644 --- a/examples/quick/tutorials/samegame/samegame3/Block.qml +++ b/examples/quick/tutorials/samegame/samegame3/Block.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame3/Button.qml b/examples/quick/tutorials/samegame/samegame3/Button.qml index 1d40677a30..77921772d2 100644 --- a/examples/quick/tutorials/samegame/samegame3/Button.qml +++ b/examples/quick/tutorials/samegame/samegame3/Button.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame3/Dialog.qml b/examples/quick/tutorials/samegame/samegame3/Dialog.qml index 0546159893..94e708f9cf 100644 --- a/examples/quick/tutorials/samegame/samegame3/Dialog.qml +++ b/examples/quick/tutorials/samegame/samegame3/Dialog.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame3/samegame.qml b/examples/quick/tutorials/samegame/samegame3/samegame.qml index 20f87d028d..a84cc67146 100644 --- a/examples/quick/tutorials/samegame/samegame3/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame3/samegame.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/quick/tutorials/samegame/samegame4/content/BoomBlock.qml index 67bc65769c..6ab2679744 100644 --- a/examples/quick/tutorials/samegame/samegame4/content/BoomBlock.qml +++ b/examples/quick/tutorials/samegame/samegame4/content/BoomBlock.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame4/content/Button.qml b/examples/quick/tutorials/samegame/samegame4/content/Button.qml index 1d40677a30..77921772d2 100644 --- a/examples/quick/tutorials/samegame/samegame4/content/Button.qml +++ b/examples/quick/tutorials/samegame/samegame4/content/Button.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame4/content/Dialog.qml b/examples/quick/tutorials/samegame/samegame4/content/Dialog.qml index e6c2cec3bb..5663add8ad 100644 --- a/examples/quick/tutorials/samegame/samegame4/content/Dialog.qml +++ b/examples/quick/tutorials/samegame/samegame4/content/Dialog.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/samegame/samegame4/samegame.qml b/examples/quick/tutorials/samegame/samegame4/samegame.qml index a4bcaee7d9..2bfdca9bd6 100644 --- a/examples/quick/tutorials/samegame/samegame4/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame4/samegame.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/tutorials/tutorials.pro b/examples/quick/tutorials/tutorials.pro index fd6117b2d0..429e77ace2 100644 --- a/examples/quick/tutorials/tutorials.pro +++ b/examples/quick/tutorials/tutorials.pro @@ -1,5 +1,4 @@ TEMPLATE = subdirs -SUBDIRS += gettingStartedQml EXAMPLE_FILES = \ dynamicview \ diff --git a/examples/quick/views/visualdatamodel/visualdatamodel.qmlproject b/examples/quick/views/delegatemodel/delegatemodel.qmlproject index 2bb4016996..2bb4016996 100644 --- a/examples/quick/views/visualdatamodel/visualdatamodel.qmlproject +++ b/examples/quick/views/delegatemodel/delegatemodel.qmlproject diff --git a/examples/quick/views/visualdatamodel/dragselection.qml b/examples/quick/views/delegatemodel/dragselection.qml index 54c24fd30d..15fd2654c2 100644 --- a/examples/quick/views/visualdatamodel/dragselection.qml +++ b/examples/quick/views/delegatemodel/dragselection.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -171,7 +181,7 @@ Item { model: 35 delegate: packageDelegate - groups: VisualDataGroup { id: selectedItems; name: "selected" } + groups: DelegateModelGroup { id: selectedItems; name: "selected" } Component.onCompleted: parts.selection.filterOnGroup = "selected" } diff --git a/examples/quick/views/visualdatamodel/slideshow.qml b/examples/quick/views/delegatemodel/slideshow.qml index c8676bc597..b252519bbf 100644 --- a/examples/quick/views/visualdatamodel/slideshow.qml +++ b/examples/quick/views/delegatemodel/slideshow.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -38,9 +48,9 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtQuick.XmlListModel 2.0 -import QtQml.Models 2.1 +import QtQuick 2.12 +import QtQml.Models 2.12 +import "../../shared" as Shared Rectangle { id: root @@ -51,18 +61,14 @@ Rectangle { color: "black" + Shared.FlickrRssModel { + id: flickrModel + tags: "fjords,mountains" + } DelegateModel { id: visualModel - model: XmlListModel { - source: "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2" - query: "/rss/channel/item" - namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" - - XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" } - XmlRole { name: "url"; query: "media:content/@url/string()" } - } - + model: flickrModel delegate: Item { id: delegateItem @@ -80,9 +86,8 @@ Rectangle { anchors.leftMargin: 1 anchors.topMargin: 1 - source: imagePath + source: thumbnail fillMode: Image.PreserveAspectFit - } MouseArea { diff --git a/examples/quick/views/doc/src/views.qdoc b/examples/quick/views/doc/src/views.qdoc index cdec8b69fc..294b88542b 100644 --- a/examples/quick/views/doc/src/views.qdoc +++ b/examples/quick/views/doc/src/views.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,7 +20,7 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/quick/views/gridview/gridview-example.qml b/examples/quick/views/gridview/gridview-example.qml index 040347ef07..76a1d8dd37 100644 --- a/examples/quick/views/gridview/gridview-example.qml +++ b/examples/quick/views/gridview/gridview-example.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/content/PetsModel.qml b/examples/quick/views/listview/content/PetsModel.qml index f72b6f7183..bc8751f00a 100644 --- a/examples/quick/views/listview/content/PetsModel.qml +++ b/examples/quick/views/listview/content/PetsModel.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/content/PressAndHoldButton.qml b/examples/quick/views/listview/content/PressAndHoldButton.qml index 44be57a4f3..527394eb4d 100644 --- a/examples/quick/views/listview/content/PressAndHoldButton.qml +++ b/examples/quick/views/listview/content/PressAndHoldButton.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/content/RecipesModel.qml b/examples/quick/views/listview/content/RecipesModel.qml index da5b36efff..05f6d8a472 100644 --- a/examples/quick/views/listview/content/RecipesModel.qml +++ b/examples/quick/views/listview/content/RecipesModel.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/content/SmallText.qml b/examples/quick/views/listview/content/SmallText.qml index b3d4a71311..21dc46d676 100644 --- a/examples/quick/views/listview/content/SmallText.qml +++ b/examples/quick/views/listview/content/SmallText.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/content/TextButton.qml b/examples/quick/views/listview/content/TextButton.qml index b344b9db1a..ed95112d47 100644 --- a/examples/quick/views/listview/content/TextButton.qml +++ b/examples/quick/views/listview/content/TextButton.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/content/ToggleButton.qml b/examples/quick/views/listview/content/ToggleButton.qml index db9a6954a9..0a2747a683 100644 --- a/examples/quick/views/listview/content/ToggleButton.qml +++ b/examples/quick/views/listview/content/ToggleButton.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQml module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/displaymargin.qml b/examples/quick/views/listview/displaymargin.qml index 85dcfc1b64..e0024e72a9 100644 --- a/examples/quick/views/listview/displaymargin.qml +++ b/examples/quick/views/listview/displaymargin.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/dynamiclist.qml b/examples/quick/views/listview/dynamiclist.qml index 8ea3d24401..bfc697d094 100644 --- a/examples/quick/views/listview/dynamiclist.qml +++ b/examples/quick/views/listview/dynamiclist.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/expandingdelegates.qml b/examples/quick/views/listview/expandingdelegates.qml index 94a8fcf0b8..1308e8441d 100644 --- a/examples/quick/views/listview/expandingdelegates.qml +++ b/examples/quick/views/listview/expandingdelegates.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/highlight.qml b/examples/quick/views/listview/highlight.qml index ac29c5cb70..5b03d30f25 100644 --- a/examples/quick/views/listview/highlight.qml +++ b/examples/quick/views/listview/highlight.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/highlightranges.qml b/examples/quick/views/listview/highlightranges.qml index 1820917893..7bc9ab7fe1 100644 --- a/examples/quick/views/listview/highlightranges.qml +++ b/examples/quick/views/listview/highlightranges.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/listview/sections.qml b/examples/quick/views/listview/sections.qml index 340eddeb84..75b0f5c6d9 100644 --- a/examples/quick/views/listview/sections.qml +++ b/examples/quick/views/listview/sections.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/main.cpp b/examples/quick/views/main.cpp index 34323cf0ee..b09597e804 100644 --- a/examples/quick/views/main.cpp +++ b/examples/quick/views/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/objectmodel/objectmodel.qml b/examples/quick/views/objectmodel/objectmodel.qml index a0480447bf..8fc2f7c386 100644 --- a/examples/quick/views/objectmodel/objectmodel.qml +++ b/examples/quick/views/objectmodel/objectmodel.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/package/Delegate.qml b/examples/quick/views/package/Delegate.qml index a6b9783a53..7c73f35c3d 100644 --- a/examples/quick/views/package/Delegate.qml +++ b/examples/quick/views/package/Delegate.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/package/view.qml b/examples/quick/views/package/view.qml index 70056b617a..311cc3be8e 100644 --- a/examples/quick/views/package/view.qml +++ b/examples/quick/views/package/view.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/parallax/content/Clock.qml b/examples/quick/views/parallax/content/Clock.qml deleted file mode 100644 index 9e6ed16c80..0000000000 --- a/examples/quick/views/parallax/content/Clock.qml +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - id : clock - width: { - if (ListView.view && ListView.view.width >= 200) - return ListView.view.width / Math.floor(ListView.view.width / 200.0); - else - return 200; - } - - height: { - if (ListView.view && ListView.view.height >= 240) - return ListView.view.height; - else - return 240; - } - - property alias city: cityLabel.text - property int hours - property int minutes - property int seconds - property real shift - property bool night: false - property bool internationalTime: true //Unset for local time - - function timeChanged() { - var date = new Date; - hours = internationalTime ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours() - night = ( hours < 7 || hours > 19 ) - minutes = internationalTime ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes() - seconds = date.getUTCSeconds(); - } - - Timer { - interval: 100; running: true; repeat: true; - onTriggered: clock.timeChanged() - } - - Item { - anchors.centerIn: parent - width: 200; height: 240 - - Image { id: background; source: "clock.png"; visible: clock.night == false } - Image { source: "clock-night.png"; visible: clock.night == true } - - - Image { - x: 92.5; y: 27 - source: "hour.png" - transform: Rotation { - id: hourRotation - origin.x: 7.5; origin.y: 73; - angle: (clock.hours * 30) + (clock.minutes * 0.5) - Behavior on angle { - SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } - } - } - } - - Image { - x: 93.5; y: 17 - source: "minute.png" - transform: Rotation { - id: minuteRotation - origin.x: 6.5; origin.y: 83; - angle: clock.minutes * 6 - Behavior on angle { - SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } - } - } - } - - Image { - x: 97.5; y: 20 - source: "second.png" - transform: Rotation { - id: secondRotation - origin.x: 2.5; origin.y: 80; - angle: clock.seconds * 6 - Behavior on angle { - SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } - } - } - } - - Image { - anchors.centerIn: background; source: "center.png" - } - - Text { - id: cityLabel - y: 210; anchors.horizontalCenter: parent.horizontalCenter - color: "white" - font.family: "Helvetica" - font.bold: true; font.pixelSize: 16 - style: Text.Raised; styleColor: "black" - } - } -} diff --git a/examples/quick/views/parallax/content/ParallaxView.qml b/examples/quick/views/parallax/content/ParallaxView.qml deleted file mode 100644 index d5d30d7c9f..0000000000 --- a/examples/quick/views/parallax/content/ParallaxView.qml +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQml.Models 2.1 - -Item { - id: root - - property alias background: background.source - property int currentIndex: 0 - default property alias content: visualModel.children - - Image { - id: background - fillMode: Image.TileHorizontally - x: -list.contentX / 2 - width: Math.max(list.contentWidth, parent.width) - } - - ListView { - id: list - anchors.fill: parent - - currentIndex: root.currentIndex - onCurrentIndexChanged: root.currentIndex = currentIndex - - orientation: Qt.Horizontal - boundsBehavior: Flickable.DragOverBounds - model: ObjectModel { id: visualModel } - - highlightRangeMode: ListView.StrictlyEnforceRange - snapMode: ListView.SnapOneItem - } - - ListView { - id: selector - - height: 50 - anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter - width: Math.min(count * 50, parent.width - 20) - interactive: width == parent.width - 20 - orientation: Qt.Horizontal - - currentIndex: root.currentIndex - onCurrentIndexChanged: root.currentIndex = currentIndex - - model: visualModel.children - delegate: Item { - width: 50; height: 50 - id: delegateRoot - - Image { - id: image - source: modelData.icon - scale: 0.8 - } - - MouseArea { - anchors.fill: parent - onClicked: { root.currentIndex = index } - } - - states: State { - name: "Selected" - when: delegateRoot.ListView.isCurrentItem == true - PropertyChanges { - target: image - scale: 1 - y: -5 - } - } - transitions: Transition { - NumberAnimation { properties: "scale,y" } - } - } - - Rectangle { - color: "#60FFFFFF" - x: -10; y: -10; z: -1 - width: parent.width + 20; height: parent.height + 20 - radius: 10 - } - } -} diff --git a/examples/quick/views/parallax/content/QuitButton.qml b/examples/quick/views/parallax/content/QuitButton.qml deleted file mode 100644 index 7c2f422bc9..0000000000 --- a/examples/quick/views/parallax/content/QuitButton.qml +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -Image { - source: "quit.png" - scale: quitMouse.pressed ? 0.8 : 1.0 - smooth: quitMouse.pressed - MouseArea { - id: quitMouse - anchors.fill: parent - anchors.margins: -10 - onClicked: Qt.quit() - } -} diff --git a/examples/quick/views/parallax/content/Smiley.qml b/examples/quick/views/parallax/content/Smiley.qml deleted file mode 100644 index 50de6be4bc..0000000000 --- a/examples/quick/views/parallax/content/Smiley.qml +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -// This is taken from the declarative animation/basics/property-animation.qml -// example - -Item { - id: window - width: 320; height: 480 - - Image { - anchors.horizontalCenter: parent.horizontalCenter - y: smiley.minHeight + 58 - source: "pics/shadow.png" - - scale: smiley.y * 0.5 / (smiley.minHeight - smiley.maxHeight) - } - - Image { - id: smiley - property int maxHeight: window.height / 3 - property int minHeight: 2 * window.height / 3 - - anchors.horizontalCenter: parent.horizontalCenter - y: minHeight - source: "pics/face-smile.png" - - SequentialAnimation on y { - loops: Animation.Infinite - - NumberAnimation { - from: smiley.minHeight; to: smiley.maxHeight - easing.type: Easing.OutExpo; duration: 300 - } - - NumberAnimation { - from: smiley.maxHeight; to: smiley.minHeight - easing.type: Easing.OutBounce; duration: 1000 - } - - PauseAnimation { duration: 500 } - } - } -} - diff --git a/examples/quick/views/parallax/content/background.png b/examples/quick/views/parallax/content/background.png Binary files differdeleted file mode 100644 index a885950862..0000000000 --- a/examples/quick/views/parallax/content/background.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/center.png b/examples/quick/views/parallax/content/center.png Binary files differdeleted file mode 100644 index 7fbd802a44..0000000000 --- a/examples/quick/views/parallax/content/center.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/clock-night.png b/examples/quick/views/parallax/content/clock-night.png Binary files differdeleted file mode 100644 index cc7151a397..0000000000 --- a/examples/quick/views/parallax/content/clock-night.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/clock.png b/examples/quick/views/parallax/content/clock.png Binary files differdeleted file mode 100644 index 462edacc0e..0000000000 --- a/examples/quick/views/parallax/content/clock.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/hour.png b/examples/quick/views/parallax/content/hour.png Binary files differdeleted file mode 100644 index 9f33fc5d48..0000000000 --- a/examples/quick/views/parallax/content/hour.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/minute.png b/examples/quick/views/parallax/content/minute.png Binary files differdeleted file mode 100644 index e2f216c897..0000000000 --- a/examples/quick/views/parallax/content/minute.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/pics/background.jpg b/examples/quick/views/parallax/content/pics/background.jpg Binary files differdeleted file mode 100644 index 61cca2f138..0000000000 --- a/examples/quick/views/parallax/content/pics/background.jpg +++ /dev/null diff --git a/examples/quick/views/parallax/content/pics/face-smile.png b/examples/quick/views/parallax/content/pics/face-smile.png Binary files differdeleted file mode 100644 index 3d66d72578..0000000000 --- a/examples/quick/views/parallax/content/pics/face-smile.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/pics/home-page.png b/examples/quick/views/parallax/content/pics/home-page.png Binary files differdeleted file mode 100644 index 01c17b0bbf..0000000000 --- a/examples/quick/views/parallax/content/pics/home-page.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/pics/home-page.svg b/examples/quick/views/parallax/content/pics/home-page.svg deleted file mode 100644 index 4f16958844..0000000000 --- a/examples/quick/views/parallax/content/pics/home-page.svg +++ /dev/null @@ -1,445 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="48" - height="48" - overflow="visible" - enable-background="new 0 0 128 129.396" - xml:space="preserve" - id="svg2" - sodipodi:version="0.32" - inkscape:version="0.46" - sodipodi:docname="go-home.svg" - sodipodi:docbase="/home/jimmac/src/cvs/tango-icon-theme/scalable/actions" - version="1.0" - inkscape:export-filename="/home/tigert/My Downloads/go-home.png" - inkscape:export-xdpi="90.000000" - inkscape:export-ydpi="90.000000" - inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata - id="metadata367"><rdf:RDF><cc:Work - rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><cc:license - rdf:resource="http://creativecommons.org/licenses/publicdomain/" /><dc:title>Go Home</dc:title><dc:creator><cc:Agent><dc:title>Jakub Steiner</dc:title></cc:Agent></dc:creator><dc:source>http://jimmac.musichall.cz</dc:source><dc:subject><rdf:Bag><rdf:li>home</rdf:li><rdf:li>return</rdf:li><rdf:li>go</rdf:li><rdf:li>default</rdf:li><rdf:li>user</rdf:li><rdf:li>directory</rdf:li></rdf:Bag></dc:subject><dc:contributor><cc:Agent><dc:title>Tuomas Kuosmanen</dc:title></cc:Agent></dc:contributor></cc:Work><cc:License - rdf:about="http://creativecommons.org/licenses/publicdomain/"><cc:permits - rdf:resource="http://creativecommons.org/ns#Reproduction" /><cc:permits - rdf:resource="http://creativecommons.org/ns#Distribution" /><cc:permits - rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /></cc:License></rdf:RDF></metadata><defs - id="defs365"><inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 24 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="48 : 24 : 1" - inkscape:persp3d-origin="24 : 16 : 1" - id="perspective92" /><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient5060" - id="radialGradient5031" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)" - cx="605.71429" - cy="486.64789" - fx="605.71429" - fy="486.64789" - r="117.14286" /><linearGradient - inkscape:collect="always" - id="linearGradient5060"><stop - style="stop-color:black;stop-opacity:1;" - offset="0" - id="stop5062" /><stop - style="stop-color:black;stop-opacity:0;" - offset="1" - id="stop5064" /></linearGradient><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient5060" - id="radialGradient5029" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)" - cx="605.71429" - cy="486.64789" - fx="605.71429" - fy="486.64789" - r="117.14286" /><linearGradient - id="linearGradient5048"><stop - style="stop-color:black;stop-opacity:0;" - offset="0" - id="stop5050" /><stop - id="stop5056" - offset="0.5" - style="stop-color:black;stop-opacity:1;" /><stop - style="stop-color:black;stop-opacity:0;" - offset="1" - id="stop5052" /></linearGradient><linearGradient - inkscape:collect="always" - xlink:href="#linearGradient5048" - id="linearGradient5027" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)" - x1="302.85715" - y1="366.64789" - x2="302.85715" - y2="609.50507" /><linearGradient - id="linearGradient2406"><stop - style="stop-color:#7c7e79;stop-opacity:1;" - offset="0" - id="stop2408" /><stop - id="stop2414" - offset="0.1724138" - style="stop-color:#848681;stop-opacity:1;" /><stop - style="stop-color:#898c86;stop-opacity:1;" - offset="1" - id="stop2410" /></linearGradient><linearGradient - inkscape:collect="always" - id="linearGradient2390"><stop - style="stop-color:#919191;stop-opacity:1;" - offset="0" - id="stop2392" /><stop - style="stop-color:#919191;stop-opacity:0;" - offset="1" - id="stop2394" /></linearGradient><linearGradient - inkscape:collect="always" - id="linearGradient2378"><stop - style="stop-color:#575757;stop-opacity:1;" - offset="0" - id="stop2380" /><stop - style="stop-color:#575757;stop-opacity:0;" - offset="1" - id="stop2382" /></linearGradient><linearGradient - inkscape:collect="always" - id="linearGradient2368"><stop - style="stop-color:#ffffff;stop-opacity:1;" - offset="0" - id="stop2370" /><stop - style="stop-color:#ffffff;stop-opacity:0;" - offset="1" - id="stop2372" /></linearGradient><linearGradient - inkscape:collect="always" - id="linearGradient2349"><stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop2351" /><stop - style="stop-color:#000000;stop-opacity:0;" - offset="1" - id="stop2353" /></linearGradient><linearGradient - id="linearGradient2341"><stop - id="stop2343" - offset="0" - style="stop-color:#000000;stop-opacity:1;" /><stop - id="stop2345" - offset="1" - style="stop-color:#000000;stop-opacity:0;" /></linearGradient><linearGradient - id="linearGradient2329"><stop - style="stop-color:#000000;stop-opacity:0.18556701;" - offset="0" - id="stop2331" /><stop - style="stop-color:#ffffff;stop-opacity:1;" - offset="1" - id="stop2333" /></linearGradient><linearGradient - inkscape:collect="always" - id="linearGradient2319"><stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop2321" /><stop - style="stop-color:#000000;stop-opacity:0;" - offset="1" - id="stop2323" /></linearGradient><linearGradient - id="linearGradient2307"><stop - style="stop-color:#edd400;stop-opacity:1;" - offset="0" - id="stop2309" /><stop - style="stop-color:#998800;stop-opacity:1;" - offset="1" - id="stop2311" /></linearGradient><linearGradient - inkscape:collect="always" - id="linearGradient2299"><stop - style="stop-color:#ffffff;stop-opacity:1;" - offset="0" - id="stop2301" /><stop - style="stop-color:#ffffff;stop-opacity:0;" - offset="1" - id="stop2303" /></linearGradient><linearGradient - id="XMLID_2_" - gradientUnits="userSpaceOnUse" - x1="80.223602" - y1="117.5205" - x2="48.046001" - y2="59.7995" - gradientTransform="matrix(0.314683,0.000000,0.000000,0.314683,4.128264,3.742874)"> - <stop - offset="0" - style="stop-color:#CCCCCC" - id="stop17" /> - <stop - offset="0.9831" - style="stop-color:#FFFFFF" - id="stop19" /> - <midPointStop - offset="0" - style="stop-color:#CCCCCC" - id="midPointStop48" /> - <midPointStop - offset="0.5" - style="stop-color:#CCCCCC" - id="midPointStop50" /> - <midPointStop - offset="0.9831" - style="stop-color:#FFFFFF" - id="midPointStop52" /> - </linearGradient><linearGradient - inkscape:collect="always" - xlink:href="#XMLID_2_" - id="linearGradient1514" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.336922,0.000000,0.000000,0.166888,17.98288,15.46151)" - x1="52.006104" - y1="166.1331" - x2="14.049017" - y2="-42.218513" /><linearGradient - id="XMLID_39_" - gradientUnits="userSpaceOnUse" - x1="64.387703" - y1="65.124001" - x2="64.387703" - y2="35.569" - gradientTransform="matrix(0.354101,0.000000,0.000000,0.354101,1.638679,-8.364921e-2)"> - <stop - offset="0" - style="stop-color:#FFFFFF" - id="stop336" /> - <stop - offset="0.8539" - style="stop-color:#FF6200" - id="stop338" /> - <stop - offset="1" - style="stop-color:#F25D00" - id="stop340" /> - <midPointStop - offset="0" - style="stop-color:#FFFFFF" - id="midPointStop335" /> - <midPointStop - offset="0.5" - style="stop-color:#FFFFFF" - id="midPointStop337" /> - <midPointStop - offset="0.8539" - style="stop-color:#FF6200" - id="midPointStop339" /> - <midPointStop - offset="0.5" - style="stop-color:#FF6200" - id="midPointStop341" /> - <midPointStop - offset="1" - style="stop-color:#F25D00" - id="midPointStop343" /> - </linearGradient><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2299" - id="radialGradient2305" - cx="7.5326638" - cy="24.202574" - fx="7.5326638" - fy="24.202574" - r="8.2452128" - gradientTransform="matrix(4.100086,-1.627292e-17,2.125447e-14,4.201322,-25.41506,-78.53967)" - gradientUnits="userSpaceOnUse" /><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2307" - id="radialGradient2313" - cx="19.985598" - cy="36.77816" - fx="19.985598" - fy="36.77816" - r="1.0821035" - gradientTransform="matrix(1.125263,0.000000,0.000000,0.982744,-3.428678,0.565787)" - gradientUnits="userSpaceOnUse" /><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2319" - id="radialGradient2325" - cx="20.443665" - cy="37.425829" - fx="20.443665" - fy="37.425829" - r="1.0821035" - gradientTransform="matrix(1.125263,0.000000,0.000000,0.982744,-3.428678,0.731106)" - gradientUnits="userSpaceOnUse" /><linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2329" - id="linearGradient2335" - x1="17.602522" - y1="26.057423" - x2="17.682528" - y2="32.654099" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.898789,0,0,1.071914,0.478025,-2.080838)" /><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2341" - id="radialGradient2339" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(4.100086,1.627292e-17,2.125447e-14,-4.201322,-5.198109,105.3535)" - cx="11.68129" - cy="19.554111" - fx="11.68129" - fy="19.554111" - r="8.2452126" /><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2349" - id="radialGradient2355" - cx="24.023088" - cy="40.56913" - fx="24.023088" - fy="40.56913" - r="16.28684" - gradientTransform="matrix(1.000000,0.000000,0.000000,0.431250,1.157278e-15,23.07369)" - gradientUnits="userSpaceOnUse" /><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2368" - id="radialGradient2374" - cx="29.913452" - cy="30.442923" - fx="29.913452" - fy="30.442923" - r="4.0018832" - gradientTransform="matrix(3.751495,-2.191984e-22,1.723265e-22,3.147818,-82.00907,-65.70704)" - gradientUnits="userSpaceOnUse" /><radialGradient - inkscape:collect="always" - xlink:href="#linearGradient2378" - id="radialGradient2384" - cx="24.195112" - cy="10.577631" - fx="24.195112" - fy="10.577631" - r="15.242914" - gradientTransform="matrix(1.125263,-3.585417e-8,4.269819e-8,1.340059,-3.006704,1.355395)" - gradientUnits="userSpaceOnUse" /><linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2390" - id="linearGradient2396" - x1="30.603519" - y1="37.337803" - x2="30.603519" - y2="36.112415" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.263867,0,0,0.859794,-6.499556,8.390924)" /><linearGradient - inkscape:collect="always" - xlink:href="#linearGradient2406" - id="linearGradient2412" - x1="17.850183" - y1="28.939463" - x2="19.040216" - y2="41.03223" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.888785,0,0,1.08932,2.41099,-1.524336)" /></defs><sodipodi:namedview - inkscape:cy="-2.3755359" - inkscape:cx="25.234802" - inkscape:zoom="1" - inkscape:window-height="691" - inkscape:window-width="872" - inkscape:pageshadow="2" - inkscape:pageopacity="0.0" - borderopacity="0.21568627" - bordercolor="#666666" - pagecolor="#ffffff" - id="base" - inkscape:showpageshadow="false" - inkscape:window-x="466" - inkscape:window-y="157" - inkscape:current-layer="svg2" - fill="#555753" - showgrid="false" - stroke="#a40000" - showguides="true" - inkscape:guide-bbox="true" /> - <g - style="display:inline" - id="g5022" - transform="matrix(2.158196e-2,0,0,1.859457e-2,43.12251,41.63767)"><rect - y="-150.69685" - x="-1559.2523" - height="478.35718" - width="1339.6335" - id="rect4173" - style="opacity:0.40206185;color:black;fill:url(#linearGradient5027);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path - sodipodi:nodetypes="cccc" - id="path5058" - d="M -219.61876,-150.68038 C -219.61876,-150.68038 -219.61876,327.65041 -219.61876,327.65041 C -76.744594,328.55086 125.78146,220.48075 125.78138,88.454235 C 125.78138,-43.572302 -33.655436,-150.68036 -219.61876,-150.68038 z " - style="opacity:0.40206185;color:black;fill:url(#radialGradient5029);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path - style="opacity:0.40206185;color:black;fill:url(#radialGradient5031);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" - d="M -1559.2523,-150.68038 C -1559.2523,-150.68038 -1559.2523,327.65041 -1559.2523,327.65041 C -1702.1265,328.55086 -1904.6525,220.48075 -1904.6525,88.454235 C -1904.6525,-43.572302 -1745.2157,-150.68036 -1559.2523,-150.68038 z " - id="path5018" - sodipodi:nodetypes="cccc" /></g><path - style="color:#000000;fill:url(#linearGradient1514);fill-opacity:1;fill-rule:nonzero;stroke:#757575;stroke-width:1.0000006;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" - d="M 21.619576,8.1833733 L 27.577035,8.1833733 C 28.416767,8.1833733 41.46351,23.618701 41.46351,24.524032 L 41.019989,43.020777 C 41.019989,43.92611 40.343959,44.654954 39.504227,44.654954 L 8.0469496,44.654954 C 7.2072167,44.654954 6.5311871,43.92611 6.5311871,43.020777 L 6.5876651,24.524032 C 6.5876651,23.618701 20.779844,8.1833733 21.619576,8.1833733 z " - id="rect1512" - sodipodi:nodetypes="ccccccccc" /><path - style="fill:none" - id="path5" - d="M 46.963575,45.735573 L 1.6386762,45.735573 L 1.6386762,0.41067554 L 46.963575,0.41067554 L 46.963575,45.735573 z " /><path - style="fill:url(#linearGradient2335);fill-opacity:1;fill-rule:evenodd" - id="path2327" - d="M 23,29 L 22.954256,44.090942 L 11.111465,44.090942 L 11,29 L 23,29 z " - clip-rule="evenodd" - sodipodi:nodetypes="ccccc" /><path - sodipodi:nodetypes="ccccccccc" - id="path2357" - d="M 21.780459,9.405584 L 27.339556,9.405584 C 28.123138,9.405584 40.340425,23.805172 40.340425,24.649756 L 39.993267,42.862067 C 39.993267,43.321326 39.84953,43.515532 39.480892,43.515532 L 8.0936894,43.529812 C 7.7250517,43.529812 7.5097258,43.449894 7.5097258,43.076262 L 7.7250676,24.649756 C 7.7250676,23.805172 20.99688,9.405584 21.780459,9.405584 z " - style="opacity:0.3125;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path - clip-rule="evenodd" - d="M 7.2075295,27.943053 L 7.1532728,30.538247 L 25.521437,17.358993 L 40.807832,28.513421 L 40.879142,28.201707 L 24.508686,12.297576 L 7.2075295,27.943053 z " - id="path23" - style="opacity:0.2;fill:url(#radialGradient2384);fill-opacity:1;fill-rule:evenodd" - sodipodi:nodetypes="ccccccc" /><path - clip-rule="evenodd" - d="M 22,30 L 22,44.090942 L 12.188971,44.090942 L 12,30 L 22,30 z " - id="path188" - style="fill:url(#linearGradient2412);fill-opacity:1;fill-rule:evenodd" - sodipodi:nodetypes="ccccc" /><path - style="opacity:0.40909089;fill:url(#radialGradient2325);fill-opacity:1;fill-rule:evenodd" - id="path2315" - d="M 19.576856,36.44767 C 20.249646,36.44767 20.793472,36.922275 20.793472,37.506177 C 20.793472,38.095988 20.249646,38.574532 19.576856,38.574532 C 18.904584,38.574532 18.35817,38.095988 18.35817,37.506177 C 18.358685,36.922275 18.904584,36.44767 19.576856,36.44767 z " - clip-rule="evenodd" /><path - clip-rule="evenodd" - d="M 19.462314,35.932229 C 20.135103,35.932229 20.678929,36.406834 20.678929,36.990736 C 20.678929,37.580545 20.135103,38.059089 19.462314,38.059089 C 18.790041,38.059089 18.243627,37.580545 18.243627,36.990736 C 18.244142,36.406834 18.790041,35.932229 19.462314,35.932229 z " - id="path217" - style="fill:url(#radialGradient2313);fill-opacity:1;fill-rule:evenodd" /><path - d="M 24.447748,11.559337 L 43.374808,28.729205 L 43.869487,29.121196 L 44.273163,28.949811 L 43.900293,28.188138 L 43.622679,27.964702 L 24.447748,12.392396 L 5.0582327,28.135731 L 4.8206309,28.279851 L 4.603921,28.986637 L 5.0373408,29.115885 L 5.4218948,28.807462 L 24.447748,11.559337 z " - id="path342" - style="fill:url(#XMLID_39_)" - sodipodi:nodetypes="ccccccccccccc" /><path - style="fill:#ef2929;stroke:#a40000" - id="path362" - d="M 24.330168,2.2713382 L 2.4484294,20.372675 L 1.8237005,27.538603 L 3.8236367,29.602926 C 3.8236367,29.602926 24.231018,12.445641 24.44773,12.274963 L 44.08027,29.818223 L 45.978694,27.494226 L 44.362903,20.382852 L 24.44773,2.1668788 L 24.330168,2.2713382 z " - sodipodi:nodetypes="cccccccccc" /> -<path - style="opacity:0.40909089;color:#000000;fill:url(#radialGradient2305);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" - d="M 2.8413446,20.613129 L 2.5497894,27.236494 L 24.369219,8.980075 L 24.298891,3.0867443 L 2.8413446,20.613129 z " - id="path1536" - sodipodi:nodetypes="ccccc" /><path - sodipodi:nodetypes="ccccc" - id="path2337" - d="M 24.483763,8.7509884 L 24.583223,2.9098867 L 43.912186,20.56184 L 45.403998,27.062652 L 24.483763,8.7509884 z " - style="opacity:0.13636367;color:#000000;fill:url(#radialGradient2339);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" /><path - style="opacity:0.31818183;color:#000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.99999934;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" - d="M 27.102228,27.719824 L 36.142223,27.719824 C 36.912818,27.719824 37.53319,28.340194 37.53319,29.110791 L 37.525229,38.190012 C 37.525229,38.960608 36.928907,39.455981 36.158311,39.455981 L 27.102228,39.455981 C 26.331631,39.455981 25.711261,38.835608 25.711261,38.065012 L 25.711261,29.110791 C 25.711261,28.340194 26.331631,27.719824 27.102228,27.719824 z " - id="rect2361" - sodipodi:nodetypes="ccccccccc" /><rect - style="opacity:1;color:#000000;fill:#3465a4;fill-opacity:1;fill-rule:nonzero;stroke:#757575;stroke-width:0.9999994;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" - id="rect3263" - width="10.001333" - height="9.9624557" - x="26.507767" - y="28.514256" - rx="0.38128215" - ry="0.38128215" /><path - style="opacity:0.39772728;color:#000000;fill:url(#radialGradient2374);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.99999958;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" - d="M 27.107118,34.408261 C 30.725101,34.739438 32.634842,32.962557 35.97527,32.855521 L 36,29.00603 L 27.088388,29 L 27.107118,34.408261 z " - id="rect2363" - sodipodi:nodetypes="ccccc" /></svg>
\ No newline at end of file diff --git a/examples/quick/views/parallax/content/pics/shadow.png b/examples/quick/views/parallax/content/pics/shadow.png Binary files differdeleted file mode 100644 index 2dd494f6c6..0000000000 --- a/examples/quick/views/parallax/content/pics/shadow.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/pics/yast-joystick.png b/examples/quick/views/parallax/content/pics/yast-joystick.png Binary files differdeleted file mode 100644 index 858cea0301..0000000000 --- a/examples/quick/views/parallax/content/pics/yast-joystick.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/pics/yast-wol.png b/examples/quick/views/parallax/content/pics/yast-wol.png Binary files differdeleted file mode 100644 index 7712180a3b..0000000000 --- a/examples/quick/views/parallax/content/pics/yast-wol.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/quit.png b/examples/quick/views/parallax/content/quit.png Binary files differdeleted file mode 100644 index b822057d4e..0000000000 --- a/examples/quick/views/parallax/content/quit.png +++ /dev/null diff --git a/examples/quick/views/parallax/content/second.png b/examples/quick/views/parallax/content/second.png Binary files differdeleted file mode 100644 index d95d99e83d..0000000000 --- a/examples/quick/views/parallax/content/second.png +++ /dev/null diff --git a/examples/quick/views/parallax/parallax.qml b/examples/quick/views/parallax/parallax.qml deleted file mode 100644 index 8d287e7fad..0000000000 --- a/examples/quick/views/parallax/parallax.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import "content" - -Rectangle { - width: 320; height: 480 - - ParallaxView { - id: parallax - anchors.fill: parent - background: "content/pics/background.jpg" - - Item { - property url icon: "content/pics/yast-wol.png" - width: 320; height: 480 - Clock { anchors.centerIn: parent } - } - - Item { - property url icon: "content/pics/home-page.png" - width: 320; height: 480 - Smiley { } - } - - Item { - property url icon: "content/pics/yast-joystick.png" - width: 320; height: 480 - - Loader { - anchors { top: parent.top; topMargin: 10; horizontalCenter: parent.horizontalCenter } - width: 300; height: 400 - clip: true; - source: "../../demos/samegame/samegame.qml" - } - } - } -} diff --git a/examples/quick/views/pathview/pathview-example.qml b/examples/quick/views/pathview/pathview-example.qml index 472ed66d2d..a70bf1b656 100644 --- a/examples/quick/views/pathview/pathview-example.qml +++ b/examples/quick/views/pathview/pathview-example.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/views/views.qml b/examples/quick/views/views.qml index db693094fe..bdf05269ae 100644 --- a/examples/quick/views/views.qml +++ b/examples/quick/views/views.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -59,6 +69,8 @@ Item { addExample("PathView", "A simple PathView", Qt.resolvedUrl("pathview/pathview-example.qml")) addExample("ObjectModel", "Using a ObjectModel", Qt.resolvedUrl("objectmodel/objectmodel.qml")) addExample("Display Margins", "A ListView with display margins", Qt.resolvedUrl("listview/displaymargin.qml")) + addExample("DelegateModel", "A PathView using DelegateModel to instantiate delegates", Qt.resolvedUrl("delegatemodel/slideshow.qml")) + addExample("Draggable Selections", "Enabling drag-and-drop on DelegateModel delegates", Qt.resolvedUrl("delegatemodel/dragselection.qml")) } } } diff --git a/examples/quick/views/views.qrc b/examples/quick/views/views.qrc index 52abb68659..1646c49e81 100644 --- a/examples/quick/views/views.qrc +++ b/examples/quick/views/views.qrc @@ -33,26 +33,6 @@ <file>listview/content/pics/vegetable-soup.jpg</file> <file>package/Delegate.qml</file> <file>package/view.qml</file> - <file>parallax/parallax.qml</file> - <file>parallax/content/Smiley.qml</file> - <file>parallax/content/background.png</file> - <file>parallax/content/center.png</file> - <file>parallax/content/clock-night.png</file> - <file>parallax/content/clock.png</file> - <file>parallax/content/Clock.qml</file> - <file>parallax/content/hour.png</file> - <file>parallax/content/minute.png</file> - <file>parallax/content/ParallaxView.qml</file> - <file>parallax/content/quit.png</file> - <file>parallax/content/QuitButton.qml</file> - <file>parallax/content/second.png</file> - <file>parallax/content/pics/background.jpg</file> - <file>parallax/content/pics/face-smile.png</file> - <file>parallax/content/pics/home-page.png</file> - <file>parallax/content/pics/home-page.svg</file> - <file>parallax/content/pics/shadow.png</file> - <file>parallax/content/pics/yast-joystick.png</file> - <file>parallax/content/pics/yast-wol.png</file> <file>pathview/pathview-example.qml</file> <file>pathview/pics/AddressBook_48.png</file> <file>pathview/pics/AudioPlayer_48.png</file> @@ -61,8 +41,8 @@ <file>pathview/pics/EMail_48.png</file> <file>pathview/pics/TodoList_48.png</file> <file>pathview/pics/VideoPlayer_48.png</file> - <file>visualdatamodel/slideshow.qml</file> - <file>visualdatamodel/dragselection.qml</file> + <file>delegatemodel/slideshow.qml</file> + <file>delegatemodel/dragselection.qml</file> <file>objectmodel/objectmodel.qml</file> <file>views.qml</file> <file>listview/displaymargin.qml</file> diff --git a/examples/quick/window/AllScreens.qml b/examples/quick/window/AllScreens.qml index 83a6c5f958..a5da380025 100644 --- a/examples/quick/window/AllScreens.qml +++ b/examples/quick/window/AllScreens.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/window/CurrentScreen.qml b/examples/quick/window/CurrentScreen.qml index 5a23cd7e29..2703582399 100644 --- a/examples/quick/window/CurrentScreen.qml +++ b/examples/quick/window/CurrentScreen.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/window/Splash.qml b/examples/quick/window/Splash.qml index 3baf207992..c3e36d9b3b 100644 --- a/examples/quick/window/Splash.qml +++ b/examples/quick/window/Splash.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/window/doc/src/window.qdoc b/examples/quick/window/doc/src/window.qdoc index 2028b31383..26caafce9a 100644 --- a/examples/quick/window/doc/src/window.qdoc +++ b/examples/quick/window/doc/src/window.qdoc @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** @@ -11,8 +11,8 @@ ** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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 @@ -20,14 +20,14 @@ ** 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: http://www.gnu.org/copyleft/fdl.html. +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ /*! \title Qt Quick Examples - Window and Screen \example window - \brief This example demonstrates the Window and Screen types in QML + \brief This example demonstrates the Window and Screen types in QML. \image qml-window-example.png \ingroup qtquickexamples diff --git a/examples/quick/window/main.cpp b/examples/quick/window/main.cpp index ee8855cbc8..1a9598a56c 100644 --- a/examples/quick/window/main.cpp +++ b/examples/quick/window/main.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/examples/quick/window/window.qml b/examples/quick/window/window.qml index d27ab3d0a3..2ee7fb6e09 100644 --- a/examples/quick/window/window.qml +++ b/examples/quick/window/window.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** 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. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -177,7 +187,7 @@ QtObject { anchors.margins: defaultSpacing text: "X" width: 30 - onClicked: testWindow.visible = false + onClicked: testWindow.close() } } } |