main.qml Example File
databasecreation/assets/main.qml
import bb.cascades 1.0
Page {
id: root
property bool databaseOpen: false
titleBar: TitleBar {
title: qsTr("Database Creation Sample")
}
Container {
layout: DockLayout {
}
Container {
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
leftPadding: 30
rightPadding: 30
layout: StackLayout {
}
Button {
horizontalAlignment: HorizontalAlignment.Fill
text: qsTr("Create/Register Database")
onClicked: {
root.databaseOpen = _app.createDatabase()
}
}
Button {
horizontalAlignment: HorizontalAlignment.Fill
text: qsTr("Create Table")
enabled: root.databaseOpen
onClicked: {
_app.createTable()
}
}
Button {
horizontalAlignment: HorizontalAlignment.Fill
text: qsTr("Create Table Asynchronously")
enabled: root.databaseOpen
onClicked: {
_app.createTableAsync()
}
}
Button {
horizontalAlignment: HorizontalAlignment.Fill
text: qsTr("Drop Table")
enabled: root.databaseOpen
onClicked: {
_app.dropTable()
}
}
Button {
horizontalAlignment: HorizontalAlignment.Fill
text: qsTr("Create Record")
enabled: root.databaseOpen
onClicked: {
_app.createRecord("John", "Doe")
}
}
}
}
}