From 3ad9f6c60773f7778c3fecd006053ea566f5d737 Mon Sep 17 00:00:00 2001 From: Schnitzel Date: Wed, 10 Jul 2024 22:24:28 +0200 Subject: [PATCH] native: add main.qml --- native/CMakeLists.txt | 2 +- native/Main.qml | 21 ++++++++++-- native/Test.qml | 67 +++++++-------------------------------- native/TextFieldStyle.qml | 10 ++++++ 4 files changed, 41 insertions(+), 59 deletions(-) create mode 100644 native/TextFieldStyle.qml diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 1881dba..2a53f2f 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -7,7 +7,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 6.2 REQUIRED COMPONENTS Quick) - qt_add_executable(alisa main.cpp ) @@ -24,6 +23,7 @@ qt_add_qml_module(alisa RESOURCES Assets/Icons/turbo.svg + ) set_target_properties(alisa PROPERTIES diff --git a/native/Main.qml b/native/Main.qml index 080c9db..6b255c3 100644 --- a/native/Main.qml +++ b/native/Main.qml @@ -27,13 +27,29 @@ Window { left: parent.left right: parent.right } - height: 400 + radius: 10 + height: 50 border.width: 5 border.color: getColors().accent color: getColors().midlight + + TextField { + anchors{ + verticalCenter: s1.verticalCenter + rightMargin: 10 + right: s1.right + } + + placeholderText: qsTr("Seach") + + + + + } + } - TableView { + /* TableView { anchors.fill: parent columnSpacing: 1 @@ -55,6 +71,7 @@ Window { } } } + */ Button { id: testB anchors { diff --git a/native/Test.qml b/native/Test.qml index c51a224..6d3c162 100644 --- a/native/Test.qml +++ b/native/Test.qml @@ -1,63 +1,18 @@ -import QtQuick -import QtQuick.Window -import Qt.labs.qmlmodels +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Controls.Universal 2.12 -Window { - width: 400 - height: 400 +ApplicationWindow { visible: true - TableView { - anchors.fill: parent - columnSpacing: 1 - rowSpacing: 1 - boundsBehavior: Flickable.StopAtBounds + Universal.theme: Universal.Dark + Universal.accent: Universal.Violet - model: TableModel { - TableModelColumn { display: "checked" } - TableModelColumn { display: "amount" } - TableModelColumn { display: "fruitType" } - TableModelColumn { display: "fruitName" } - TableModelColumn { display: "fruitPrice" } + Column { + anchors.centerIn: parent - // Each row is one type of fruit that can be ordered - rows: [ - { - // Each property is one cell/column. - checked: false, - amount: 1, - fruitType: "Apple", - fruitName: "Granny Smith", - fruitPrice: 1.50 - }, - { - checked: true, - amount: 4, - fruitType: "Orange", - fruitName: "Navel", - fruitPrice: 2.50 - }, - { - checked: false, - amount: 1, - fruitType: "Banana", - fruitName: "Cavendish", - fruitPrice: 3.50 - } - ] - } - delegate: TextInput { - text: model.display - padding: 12 - selectByMouse: true - - onAccepted: model.display = text - - Rectangle { - anchors.fill: parent - color: "#efefef" - z: -1 - } - } + RadioButton { text: qsTr("Small") } + RadioButton { text: qsTr("Medium"); checked: true } + RadioButton { text: qsTr("Large") } } } diff --git a/native/TextFieldStyle.qml b/native/TextFieldStyle.qml new file mode 100644 index 0000000..bd275b7 --- /dev/null +++ b/native/TextFieldStyle.qml @@ -0,0 +1,10 @@ +import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T + +T.TextField { + id: textFeld + placeholderText: qsTr("works") + + +}