native: add main.qml

This commit is contained in:
Schnitzel 2024-07-10 22:24:28 +02:00
parent cfc8e9fb28
commit 3ad9f6c607
4 changed files with 41 additions and 59 deletions

View file

@ -7,7 +7,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.2 REQUIRED COMPONENTS Quick) find_package(Qt6 6.2 REQUIRED COMPONENTS Quick)
qt_add_executable(alisa qt_add_executable(alisa
main.cpp main.cpp
) )
@ -24,6 +23,7 @@ qt_add_qml_module(alisa
RESOURCES RESOURCES
Assets/Icons/turbo.svg Assets/Icons/turbo.svg
) )
set_target_properties(alisa PROPERTIES set_target_properties(alisa PROPERTIES

View file

@ -27,13 +27,29 @@ Window {
left: parent.left left: parent.left
right: parent.right right: parent.right
} }
height: 400 radius: 10
height: 50
border.width: 5 border.width: 5
border.color: getColors().accent border.color: getColors().accent
color: getColors().midlight color: getColors().midlight
TextField {
anchors{
verticalCenter: s1.verticalCenter
rightMargin: 10
right: s1.right
} }
TableView { placeholderText: qsTr("Seach")
}
}
/* TableView {
anchors.fill: parent anchors.fill: parent
columnSpacing: 1 columnSpacing: 1
@ -55,6 +71,7 @@ Window {
} }
} }
} }
*/
Button { Button {
id: testB id: testB
anchors { anchors {

View file

@ -1,63 +1,18 @@
import QtQuick import QtQuick 2.12
import QtQuick.Window import QtQuick.Controls 2.12
import Qt.labs.qmlmodels import QtQuick.Controls.Universal 2.12
Window { ApplicationWindow {
width: 400
height: 400
visible: true visible: true
TableView { Universal.theme: Universal.Dark
anchors.fill: parent Universal.accent: Universal.Violet
columnSpacing: 1
rowSpacing: 1
boundsBehavior: Flickable.StopAtBounds
model: TableModel { Column {
TableModelColumn { display: "checked" } anchors.centerIn: parent
TableModelColumn { display: "amount" }
TableModelColumn { display: "fruitType" }
TableModelColumn { display: "fruitName" }
TableModelColumn { display: "fruitPrice" }
// Each row is one type of fruit that can be ordered RadioButton { text: qsTr("Small") }
rows: [ RadioButton { text: qsTr("Medium"); checked: true }
{ RadioButton { text: qsTr("Large") }
// 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
}
}
} }
} }

10
native/TextFieldStyle.qml Normal file
View file

@ -0,0 +1,10 @@
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.Templates as T
T.TextField {
id: textFeld
placeholderText: qsTr("works")
}