diff options
author | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2021-02-10 12:52:50 +0100 |
---|---|---|
committer | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2021-02-16 12:32:52 +0100 |
commit | 860928d5c85f015bacde952037cae14d8dee24a5 (patch) | |
tree | 91558bc964fba149f06d77fbda42b246fedae222 /examples/quick/localstorage/localstorage/localstorage.qml | |
parent | 6d51f997df14f2b22c265c5b2fda679ece9edef3 (diff) |
Update localstore example to use QtQuickControls2
Removing MyButton.qml and replacing it with QtQuickControls2.
Task-number: QTBUG-90884
Change-Id: Ie1b22e817dedfd71593b074561bdfe2e7dc36008
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'examples/quick/localstorage/localstorage/localstorage.qml')
-rw-r--r-- | examples/quick/localstorage/localstorage/localstorage.qml | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/quick/localstorage/localstorage/localstorage.qml b/examples/quick/localstorage/localstorage/localstorage.qml index 418aab838e..5915b67367 100644 --- a/examples/quick/localstorage/localstorage/localstorage.qml +++ b/examples/quick/localstorage/localstorage/localstorage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.5 -import QtQuick.Window 2.2 -import QtQuick.Layouts 1.1 -import QtQuick.LocalStorage 2.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.LocalStorage import "Database.js" as JS Window { @@ -77,7 +77,7 @@ Window { statusText: statustext } RowLayout { - MyButton { + Button { text: "New" onClicked: { input.initrec_new() @@ -85,7 +85,7 @@ Window { listView.model.setProperty(listView.currentIndex, "id", 0) } } - MyButton { + Button { id: saveButton enabled: (window.creatingNewEntry || window.editingEntry) && listView.currentIndex != -1 text: "Save" @@ -118,7 +118,7 @@ Window { } } } - MyButton { + Button { id: editButton text: "Edit" enabled: !window.creatingNewEntry && !window.editingEntry && listView.currentIndex != -1 @@ -131,7 +131,7 @@ Window { window.editingEntry = true } } - MyButton { + Button { id: deleteButton text: "Delete" enabled: !window.creatingNewEntry && listView.currentIndex != -1 @@ -145,7 +145,7 @@ Window { } } } - MyButton { + Button { id: cancelButton text: "Cancel" enabled: (window.creatingNewEntry || window.editingEntry) && listView.currentIndex != -1 @@ -161,7 +161,7 @@ Window { input.initrec() } } - MyButton { + Button { text: "Exit" onClicked: Qt.quit() } @@ -195,7 +195,7 @@ Window { } } } - Text { + Label { id: statustext color: "red" Layout.fillWidth: true |