Adding TextField view
This commit is contained in:
parent
fd3ce483f0
commit
092f4ea2b5
@ -5,7 +5,7 @@ project(AutoCatQt VERSION 0.1 LANGUAGES CXX)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_PREFIX_PATH "/home/selim/qt/6.4.3/gcc_64/lib/cmake")
|
set(CMAKE_PREFIX_PATH "/home/selim/qt/6.4.3/gcc_64/lib/cmake")
|
||||||
|
|
||||||
find_package(Qt6 6.4 REQUIRED COMPONENTS Quick)
|
find_package(Qt6 6.4 REQUIRED COMPONENTS Quick QuickControls2)
|
||||||
find_package(nlohmann_json REQUIRED)
|
find_package(nlohmann_json REQUIRED)
|
||||||
|
|
||||||
qt_standard_project_setup()
|
qt_standard_project_setup()
|
||||||
@ -17,8 +17,7 @@ qt_add_executable(appAutoCatQt
|
|||||||
qt_add_qml_module(appAutoCatQt
|
qt_add_qml_module(appAutoCatQt
|
||||||
URI AutoCatQt
|
URI AutoCatQt
|
||||||
VERSION 1.0
|
VERSION 1.0
|
||||||
QML_FILES views/LoginWindow.qml
|
QML_FILES views/LoginWindow.qml views/MainWindow.qml views/TextField.qml
|
||||||
QML_FILES views/MainWindow.qml
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(appAutoCatQt PROPERTIES
|
set_target_properties(appAutoCatQt PROPERTIES
|
||||||
|
|||||||
@ -1,9 +1,33 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
height: 480
|
height: 480
|
||||||
width: 640
|
|
||||||
title: "Login"
|
title: "Login"
|
||||||
visible: true
|
visible: true
|
||||||
|
width: 640
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 16
|
||||||
|
width: parent.width * 0.6
|
||||||
|
|
||||||
|
// TextField {
|
||||||
|
// id: login
|
||||||
|
// anchors.left: parent.left
|
||||||
|
// anchors.right: parent.right
|
||||||
|
// }
|
||||||
|
// TextField {
|
||||||
|
// id: password
|
||||||
|
// anchors.left: parent.left
|
||||||
|
// anchors.right: parent.right
|
||||||
|
// }
|
||||||
|
|
||||||
|
Button {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: "Log In"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
22
views/TextField.qml
Normal file
22
views/TextField.qml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
FocusScope {
|
||||||
|
property alias input: input
|
||||||
|
property alias text: input.text
|
||||||
|
|
||||||
|
height: input.contentHeight + 8
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
border.color: "gray"
|
||||||
|
color: "lightsteelblue"
|
||||||
|
}
|
||||||
|
TextInput {
|
||||||
|
id: input
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: 4
|
||||||
|
focus: true
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user