Ai
1 Star 1 Fork 1

Yaoqinghui/qml-bootstrap

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.qml 2.58 KB
一键复制 编辑 原始数据 按行查看 历史
Boris KOUMONDJI 提交于 2014-11-28 02:21 +08:00 . Add card component
import QtQuick 2.3
import QtQuick.Controls 1.2
import "src/lists"
import "src/bars"
import "src/buttons"
import "src/variables/fontawesome.js" as FontAwesome
ApplicationWindow {
visible: true
width: 800
height: 1280
FontLoader{ source: "qrc:/src/fonts/fontawesome-webfont.ttf"}
Rectangle {
anchors.fill: parent
}
toolBar: Bar{
id: titleBar
leftComponent: Component{
ButtonDefault{
class_name: "bar dark clear"
text: "Back"
icon: FontAwesome.icons.fa_angle_left
opacity: stackView.depth > 1 ? 1 : 0
visible: opacity ? true : false
Behavior on opacity { NumberAnimation{} }
onClicked: {
stackView.pop()
titleBar.title = "Qml Bootstrap Demo"
}
}
}
class_name: "header"
title: "Qml Bootstrap Demo"
}
ListModel {
id: pageModel
ListElement {
text: "Buttons Demo"
page: "src/examples/ButtonPage.qml"
}
ListElement {
text: "ListView Demo"
page: "src/examples/DefaultListPage.qml"
}
ListElement {
text: "ListView with icon Demo"
page: "src/examples/IconListPage.qml"
}
ListElement {
text: "Avatar ListView Demo"
page: "src/examples/AvatarListPage.qml"
}
ListElement {
text: "Thumnail ListView Demo"
page: "src/examples/ThumbnailListPage.qml"
}
ListElement {
text: "Button bar Demo"
page: "src/examples/ButtonBarPage.qml"
}
ListElement {
text: "Card"
page: "src/examples/CardPage.qml"
}
}
StackView {
id: stackView
anchors.fill: parent
focus: true
Keys.onReleased: if (event.key === Qt.Key_Back && stackView.depth > 1) {
stackView.pop();
event.accepted = true;
}
initialItem: Item {
width: parent.width
height: parent.height
DefaultListView{
model: pageModel
anchors.fill: parent
onItemClicked: {
stackView.push(Qt.resolvedUrl(item.page))
titleBar.title = item.text
}
}
}
}
statusBar: Bar{
class_name: "footer calm"
title: "Powered by Brexis and Kamhix"
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Tarmy/qml-bootstrap.git
git@gitee.com:Tarmy/qml-bootstrap.git
Tarmy
qml-bootstrap
qml-bootstrap
master

搜索帮助