native: add main.qml
This commit is contained in:
parent
cfc8e9fb28
commit
3ad9f6c607
4 changed files with 41 additions and 59 deletions
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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") }
|
||||
}
|
||||
}
|
||||
|
|
10
native/TextFieldStyle.qml
Normal file
10
native/TextFieldStyle.qml
Normal file
|
@ -0,0 +1,10 @@
|
|||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.TextField {
|
||||
id: textFeld
|
||||
placeholderText: qsTr("works")
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue