This adds the missing headers
CredentialsView.ui.qml
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import credentials 1.0
Page {
id: page_Credentials
header: Label {
text: qsTr("Credentials")
font.pixelSize: Qt.application.font.pixelSize
padding: 10
}
ColumnLayout{
RowLayout{
Rectangle{
color: "lightgray"
implicitWidth: page_Credentials.width/2
implicitHeight: lbl_cell_user.implicitHeight
Label{
id: lbl_cell_user
text: "user"
anchors.centerIn: parent
}
}
Rectangle{
color: "lightgray"
implicitWidth: page_Credentials.width/2
implicitHeight: lbl_cell_password.height
Label{
id: lbl_cell_password
text: "pass"
anchors.centerIn: parent
}
}
}
RowLayout{
CredentialsTableView{
model: SqlCredentialsModel{}
implicitWidth: page_Credentials.width
implicitHeight: page_Credentials.height
}
}
}
}
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import credentials 1.0
Page {
id: page_Credentials
header: Label {
text: qsTr("Credentials")
font.pixelSize: Qt.application.font.pixelSize
padding: 10
}
ColumnLayout{
RowLayout{
Rectangle{
color: "lightgray"
implicitWidth: page_Credentials.width/2
implicitHeight: lbl_cell_user.implicitHeight
Label{
id: lbl_cell_user
text: "user"
anchors.centerIn: parent
}
}
Rectangle{
color: "lightgray"
implicitWidth: page_Credentials.width/2
implicitHeight: lbl_cell_password.height
Label{
id: lbl_cell_password
text: "pass"
anchors.centerIn: parent
}
}
}
RowLayout{
CredentialsTableView{
model: SqlCredentialsModel{}
implicitWidth: page_Credentials.width
implicitHeight: page_Credentials.height
}
}
}
}
To copy to clipboard, switch view to plain text mode
CredentialsTableView.ui.qml
import QtQuick 2.12
import QtQuick.Controls 2.12
import credentials 1.0
TableView {
id: dbTableView
columnSpacing: 5
rowSpacing: 1
clip: true
delegate: Rectangle{
implicitWidth: dbTableView.width/2;
implicitHeight: lb_cell.height;
color: "lightblue"
Label {
id: lb_cell
text: display
anchors.centerIn: parent
}
}
}
import QtQuick 2.12
import QtQuick.Controls 2.12
import credentials 1.0
TableView {
id: dbTableView
columnSpacing: 5
rowSpacing: 1
clip: true
delegate: Rectangle{
implicitWidth: dbTableView.width/2;
implicitHeight: lb_cell.height;
color: "lightblue"
Label {
id: lb_cell
text: display
anchors.centerIn: parent
}
}
}
To copy to clipboard, switch view to plain text mode
main.qml
import QtQuick 2.12
import QtQuick.Controls 2.5
ApplicationWindow {
visible: true
width: 100
height: 120
title: qsTr("Credentials")
SwipeView {
id: swipeView
CredentialsView{
id: credentialsView
}
}
}
import QtQuick 2.12
import QtQuick.Controls 2.5
ApplicationWindow {
visible: true
width: 100
height: 120
title: qsTr("Credentials")
SwipeView {
id: swipeView
CredentialsView{
id: credentialsView
}
}
}
To copy to clipboard, switch view to plain text mode
Code is available in https://github.com/hstig/qt/tree/add...iteCredentials
How to get rid of following binding loops?
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitWidth"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitWidth"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitHeight"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitWidth"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitWidth"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitHeight"
Bookmarks