项目作者: yasser-sobhy

项目描述 :
QML ui framework
高级语言: QML
项目地址: git://github.com/yasser-sobhy/Gurra.git
创建时间: 2017-02-26T09:49:51Z
项目社区:https://github.com/yasser-sobhy/Gurra

开源协议:

下载


Gurra is a QML ui framework, it has many easy-to-use components and unified structure

Installation

Download app.tar.gz template, extract it and start coding :)

Screenshots

screenshots

Getting Started

Ongoing documentation https://yasser-sobhy.github.io/Gurra/

App Structure

  1. .
  2. |__ App
  3. | |__ android
  4. | |__ ios
  5. | |__ assets
  6. | | |__fonts
  7. | | |__Gurra
  8. | | |__images
  9. | | |__languages
  10. | | |__sounds
  11. | |__ qml
  12. | | |__ customs
  13. | | | |__ api
  14. | | | |__ moreApi.qml
  15. | | | |__ Api.qml
  16. | | | |__ Colors.qml
  17. | | | |__ Fonts.qml
  18. | | | |__ Headers.qml
  19. | | | |__ Logic.qml
  20. | | | |__ Models.qml
  21. | | | |__ Pages.qml
  22. | | | |__ Params.qml
  23. | | | |__ Settings.qml
  24. | | | |__ SoundEffects.qml
  25. | | | |__ Urls.qml
  26. | | |__ pages
  27. | | | |__ components
  28. | | | |__ delegates
  29. | | | |__ Home.qml
  30. | | |__ main.qml
  31. | |__ src
  32. | |__ app.pro
  33. | |__ app.pro.user
  34. | |__ main.cpp
  35. | |__ qml.qrc
  36. | |__ qtquickcontrols2.conf

Example App

main.qml

  1. import QtQuick 2.7
  2. import QtQuick.Controls 2.0
  3. import QtQuick.Controls.Material 2.0
  4. import Org.Yasser.Gurra 1.0
  5. import Gurra 1.0
  6. import "qrc:/qml"
  7. import "qrc:/qml/pages"
  8. import "customs" as Custom
  9. App
  10. {
  11. id: app
  12. title: qsTr("Gurra")
  13. view: mainStack
  14. api: Custom.Api{}
  15. logic: Custom.Logic{}
  16. pages: Custom.Pages{}
  17. colors: Custom.Colors{}
  18. urls: Custom.Urls{}
  19. headers: Custom.Headers{}
  20. models: Custom.Models{}
  21. settings: Custom.Settings{}
  22. params: Custom.Params{}
  23. fonts: Custom.Fonts{}
  24. soundEffects: Custom.SoundEffects {}
  25. production: true
  26. // delay creating lazy items until all app Components are ready
  27. Timer {
  28. interval: 500
  29. running: true
  30. onTriggered: {
  31. app.ready(function(){
  32. console.log("app ready")
  33. })
  34. }
  35. }
  36. StackView
  37. {
  38. id: mainStack
  39. anchors.fill: parent
  40. Component.onCompleted: {
  41. push(app.pages.home)
  42. }
  43. }
  44. }

Home.qml

  1. import QtQuick 2.7
  2. import QtQuick.Layouts 1.1
  3. import QtQuick.Controls 2.0
  4. import QtQuick.Controls.Material 2.0
  5. import Gurra 1.0
  6. AnaPage
  7. {
  8. Grid
  9. {
  10. id: grid
  11. anchors.centerIn: parent
  12. layoutDirection: Qt.RightToLeft
  13. columns: 3
  14. rowSpacing: app.spacing.xLarge
  15. columnSpacing: app.spacing.xLarge
  16. BigIcon {
  17. icon.icon: app.icons.fontAwesome.check
  18. label.text: qsTr("Auctions")
  19. onClicked: app.pushPage(app.pages.auctionTypeSelect)
  20. }
  21. BigIcon {
  22. icon.icon: app.icons.fontAwesome.th_list
  23. label.text: qsTr("Listings")
  24. onClicked: {
  25. app.pages.listings.params.search_query = ""
  26. app.pushPage(app.pages.listings)
  27. }
  28. }
  29. BigIcon {
  30. icon.icon: app.icons.fontAwesome.search
  31. label.text: qsTr("Search")
  32. onClicked: app.pushPage(app.pages.search)
  33. }
  34. BigIcon {
  35. icon.icon: app.icons.fontAwesome.user
  36. label.text: qsTr("My Account")
  37. onClicked: {
  38. if(app.settings.member_id === 0)
  39. app.pushPage(app.pages.loginPage)
  40. else
  41. app.pushPage(app.pages.userAccountPage)
  42. }
  43. }
  44. BigIcon {
  45. icon.icon: app.icons.fontAwesome.heart
  46. label.text: qsTr("Watchings")
  47. onClicked: {
  48. if(app.settings.member_id === 0)
  49. app.pushPage(app.pages.loginPage)
  50. else
  51. app.pushPage(app.pages.watchings)
  52. }
  53. }
  54. BigIcon {
  55. icon.icon: app.icons.fontAwesome.list
  56. label.text: qsTr("Rules")
  57. onClicked: {
  58. app.pages.tosPage.params.tos = false
  59. app.pushPage(app.pages.tosPage)
  60. }
  61. }
  62. BigIcon {
  63. icon.icon: app.icons.fontAwesome.ticket
  64. label.text: qsTr("Tos")
  65. onClicked: {
  66. app.pages.tosPage.params.tos = true
  67. app.pushPage(app.pages.tosPage)
  68. }
  69. }
  70. BigIcon {
  71. icon.icon: app.icons.fontAwesome.envelope
  72. label.text: qsTr("Contact Us")
  73. onClicked: app.pushPage(app.pages.contactUsPage)
  74. }
  75. BigIcon {
  76. icon.icon: app.icons.fontAwesome.info
  77. label.text: qsTr("About")
  78. onClicked: app.pushPage(app.pages.aboutPage)
  79. }
  80. }
  81. }

Reference

License

Gurra is freely distributable under the terms of the MIT license.