From 67906d61c6f786dbbced67becc25e1a396f3183c Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Tue, 12 Sep 2017 15:30:23 +0200 Subject: Example: Update to the new QObject::connect syntax The QSortFilterProxyModel-based proxy model forwards the rowsInserted and rowsDeleted signals. Task-number: QTBUG-60631 Change-Id: I51a46cd13a89ea22b8bb4807821b3f21f6893b19 Reviewed-by: Shawn Rutledge Reviewed-by: J-P Nurmi --- .../quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp b/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp index 55f76d67..b93641a9 100644 --- a/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp +++ b/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp @@ -54,8 +54,8 @@ SortFilterProxyModel::SortFilterProxyModel(QObject *parent) : QSortFilterProxyModel(parent), m_complete(false) { - connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(countChanged())); - connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(countChanged())); + connect(this, &QSortFilterProxyModel::rowsInserted, this, &SortFilterProxyModel::countChanged); + connect(this, &QSortFilterProxyModel::rowsRemoved, this, &SortFilterProxyModel::countChanged); } int SortFilterProxyModel::count() const -- cgit v1.2.1 From bca35ce54a541991ff1e36a9bb2e0d436c757ed9 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 3 Oct 2017 15:40:01 +0200 Subject: Doc: add documentation to Dashboard example Task-number: QTBUG-60648 Change-Id: I79b9fdfde18041d95b7aa422bfb4d188ed907589 Reviewed-by: Mitch Curtis --- examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml | 10 ++++++---- examples/quickcontrols/extras/dashboard/qml/ValueSource.qml | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml b/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml index b132510e..c0fb6720 100644 --- a/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml +++ b/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml @@ -59,7 +59,7 @@ Item { property bool flashing: false scale: direction === Qt.LeftArrow ? 1 : -1 - +//! [1] Timer { id: flashTimer interval: 500 @@ -67,7 +67,8 @@ Item { repeat: true onTriggered: flashing = !flashing } - +//! [1] +//! [2] function paintOutlinePath(ctx) { ctx.beginPath(); ctx.moveTo(0, height * 0.5); @@ -79,7 +80,7 @@ Item { ctx.lineTo(0.6 * width, height); ctx.lineTo(0, height * 0.5); } - +//! [2] Canvas { id: backgroundCanvas anchors.fill: parent @@ -95,7 +96,7 @@ Item { ctx.stroke(); } } - +//! [3] Canvas { id: foregroundCanvas anchors.fill: parent @@ -111,4 +112,5 @@ Item { ctx.fill(); } } +//! [3] } diff --git a/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml b/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml index 7225be48..44913621 100644 --- a/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml +++ b/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml @@ -49,7 +49,7 @@ ****************************************************************************/ import QtQuick 2.2 - +//! [0] Item { id: valueSource property real kph: 0 @@ -79,6 +79,7 @@ Item { property int turnSignal: gear == "P" && !start ? randomDirection() : -1 property real temperature: 0.6 property bool start: true +//! [0] function randomDirection() { return Math.random() > 0.5 ? Qt.LeftArrow : Qt.RightArrow; @@ -101,7 +102,7 @@ Item { SequentialAnimation { loops: Animation.Infinite - +//! [1] ParallelAnimation { NumberAnimation { target: valueSource @@ -120,6 +121,7 @@ Item { duration: 3000 } } +//! [1] ParallelAnimation { // We changed gears so we lost a bit of speed. NumberAnimation { -- cgit v1.2.1 From 296810ea4bb4f734881a517eb101e5b948c1905b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 28 Sep 2017 16:38:30 +0200 Subject: Fix outdated FDL license header Change-Id: I03c222a72490959d55b3077a6282553a4bfcf7d2 Reviewed-by: Jani Heikkinen --- examples/quickcontrols/controls/basiclayouts/main.qml | 16 +++++++++++++--- examples/quickcontrols/controls/touch/src/main.cpp | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/quickcontrols/controls/basiclayouts/main.qml b/examples/quickcontrols/controls/basiclayouts/main.qml index b6694b45..cc4c0d4f 100644 --- a/examples/quickcontrols/controls/basiclayouts/main.qml +++ b/examples/quickcontrols/controls/basiclayouts/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/quickcontrols/controls/touch/src/main.cpp b/examples/quickcontrols/controls/touch/src/main.cpp index e66387f7..be01f287 100644 --- a/examples/quickcontrols/controls/touch/src/main.cpp +++ b/examples/quickcontrols/controls/touch/src/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 -- cgit v1.2.1