├── AndroidInfo.cpp ├── AndroidInfo.h ├── AutoData.js ├── Config.js ├── CpuInfo.cpp ├── CpuInfo.h ├── CustomButton.qml ├── CustomImageButton.qml ├── CustomItem.qml ├── FPSArea.qml ├── GeneralInfo.cpp ├── GeneralInfo.h ├── MemInfo.cpp ├── MemInfo.h ├── Menu.js ├── PerformanceArea.qml ├── ProgressBarCollection.pro ├── ProgressBarCollection.pro.user ├── ProgressBarGroupsArea.qml ├── ProgressBarStylesArea.qml ├── README.md ├── SysInfo.cpp ├── SysInfo.h ├── SysInfoQML.cpp ├── SysInfoQML.h ├── WindowsInfo.cpp ├── WindowsInfo.h ├── images ├── Cir_1.png ├── Cir_2.png ├── Cir_3.png ├── Cir_4.png ├── Cir_5.png ├── Cir_6.png ├── Cir_7.png ├── Cir_8.png ├── Cir_9.png ├── Hor_1.png ├── Hor_2.png ├── Hor_3.png ├── Hor_4.png └── Ver_1.png ├── main.cpp ├── main.qml ├── progbarstyles ├── Cir_1.qml ├── Cir_2.qml ├── Cir_3.qml ├── Cir_4.qml ├── Cir_5.qml ├── Cir_6.qml ├── Cir_7.qml ├── Cir_8.qml ├── Cir_9.qml ├── Hor_1.qml ├── Hor_2.qml ├── Hor_3.qml ├── Hor_4.qml └── Ver_1.qml └── qml.qrc /AndroidInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "AndroidInfo.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | AndroidInfo::AndroidInfo() 10 | { 11 | //get memory total 12 | QFile file("/proc/meminfo"); 13 | file.open(QIODevice::ReadOnly); 14 | QString line = file.readLine(); 15 | file.close(); 16 | QStringList data = line.split(" ", QString::SkipEmptyParts); 17 | QString totalMemory = data.at(1); 18 | this->m_memInfo.setTotal(totalMemory.toLong() / 1024); 19 | 20 | //get cpu first time running 21 | QFile file2("/proc/stat"); 22 | file2.open(QIODevice::ReadOnly); 23 | QByteArray line2 = file2.readLine(); 24 | file2.close(); 25 | sscanf(line2.data(), "cpu %llu %llu %llu %llu", &last_totalUser, &last_totalUserNice, &last_totalSystem, &last_totalIdle); 26 | } 27 | 28 | void AndroidInfo::update() 29 | { 30 | //get memory used 31 | QFile file("/proc/meminfo"); 32 | file.open(QIODevice::ReadOnly); 33 | 34 | qulonglong totalMemoryUsed; 35 | //MemTotal 36 | QString line = file.readLine(); 37 | QStringList data = line.split(" ", QString::SkipEmptyParts); 38 | QString totalMemory = data.at(1); 39 | totalMemoryUsed = totalMemory.toLongLong(); 40 | //MemFree 41 | line = file.readLine(); 42 | data = line.split(" ", QString::SkipEmptyParts); 43 | totalMemoryUsed -= ((QString)(data.at(1))).toLong(); 44 | //Buffers 45 | line = file.readLine(); 46 | data = line.split(" ", QString::SkipEmptyParts); 47 | totalMemoryUsed -= ((QString)(data.at(1))).toLong(); 48 | //Cached 49 | line = file.readLine(); 50 | data = line.split(" ", QString::SkipEmptyParts); 51 | totalMemoryUsed -= ((QString)(data.at(1))).toLong(); 52 | file.close(); 53 | 54 | this->m_memInfo.setUsage(totalMemoryUsed / 1024); 55 | 56 | //update cpu 57 | QFile file2("/proc/stat"); 58 | file2.open(QIODevice::ReadOnly); 59 | QByteArray line2 = file2.readLine(); 60 | file2.close(); 61 | sscanf(line2.data(), "cpu %llu %llu %llu %llu", &totalUser, &totalUserNice, &totalSystem, &totalIdle); 62 | 63 | double overall = totalUser - last_totalUser; 64 | overall += totalUserNice - last_totalUserNice; 65 | overall += totalSystem - last_totalSystem; 66 | 67 | double total = overall + totalIdle - last_totalIdle; 68 | this->m_cpuInfo.setUsage((overall / total) * 100.0); 69 | 70 | last_totalUser = totalUser; 71 | last_totalUserNice = totalUserNice; 72 | last_totalSystem = totalSystem; 73 | last_totalIdle = totalIdle; 74 | } 75 | -------------------------------------------------------------------------------- /AndroidInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef ANDROIDINFO_H 2 | #define ANDROIDINFO_H 3 | 4 | #include "SysInfo.h" 5 | #include 6 | 7 | class AndroidInfo : public SysInfo 8 | { 9 | private: 10 | qulonglong totalUser = 0; 11 | qulonglong totalUserNice = 0; 12 | qulonglong totalSystem = 0; 13 | qulonglong totalIdle = 0; 14 | 15 | qulonglong last_totalUser = 0; 16 | qulonglong last_totalUserNice = 0; 17 | qulonglong last_totalSystem = 0; 18 | qulonglong last_totalIdle = 0; 19 | public: 20 | AndroidInfo(); 21 | 22 | void update() override; 23 | }; 24 | 25 | #endif // ANDROIDINFO_H 26 | -------------------------------------------------------------------------------- /AutoData.js: -------------------------------------------------------------------------------- 1 | var list_styles = [ 2 | "Hor_1.qml", 3 | "Hor_2.qml", 4 | "Hor_3.qml", 5 | "Hor_4.qml", 6 | "Ver_1.qml", 7 | "Cir_1.qml", 8 | "Cir_2.qml", 9 | "Cir_3.qml", 10 | "Cir_4.qml", 11 | "Cir_5.qml", 12 | "Cir_6.qml", 13 | "Cir_7.qml", 14 | "Cir_8.qml", 15 | "Cir_9.qml", 16 | ] 17 | -------------------------------------------------------------------------------- /Config.js: -------------------------------------------------------------------------------- 1 | //groups 2 | var fontColor_default = "black" 3 | var fontColor_clicked = "#2196F3" 4 | var bgColor_default = "transparent" 5 | var bgColor_clicked = "white" 6 | 7 | var bgColor_default_imagebt = "#546E7A" 8 | -------------------------------------------------------------------------------- /CpuInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "CpuInfo.h" 2 | 3 | CpuInfo::CpuInfo() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /CpuInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef CPUINFO_H 2 | #define CPUINFO_H 3 | 4 | #include "GeneralInfo.h" 5 | 6 | class CpuInfo : public GeneralInfo 7 | { 8 | public: 9 | CpuInfo(); 10 | }; 11 | 12 | #endif // CPUINFO_H 13 | -------------------------------------------------------------------------------- /CustomButton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "Config.js" as Data 3 | 4 | Item { 5 | id: id_root 6 | 7 | property string p_text 8 | property color p_bgColor: Data.bgColor_default 9 | property color p_bgColorSelected: Data.bgColor_clicked 10 | property color p_textColor: Data.fontColor_default 11 | property color p_textColorSelected: Data.fontColor_clicked 12 | property int p_fontSize: 14 13 | property int p_radius: 10 14 | property int p_index: -1 15 | property int p_curIndex: -1 16 | 17 | signal clicked 18 | 19 | Rectangle { 20 | id: id_bgr 21 | anchors.fill: parent 22 | radius: p_radius 23 | color: p_bgColor 24 | 25 | Text { 26 | id: id_text 27 | anchors.centerIn: parent 28 | text: id_root.p_text 29 | font.pixelSize: p_fontSize 30 | color: p_textColor 31 | horizontalAlignment: Text.AlignHCenter 32 | verticalAlignment: Text.AlignVCenter 33 | } 34 | 35 | MouseArea { 36 | id: mouseArea 37 | anchors.fill: parent 38 | onClicked: { 39 | id_root.clicked() 40 | } 41 | } 42 | } 43 | 44 | onP_curIndexChanged: { 45 | if(id_root.p_index == id_root.p_curIndex){ 46 | id_bgr.color = id_root.p_bgColorSelected 47 | id_text.color = id_root.p_textColorSelected 48 | }else{ 49 | id_bgr.color = id_root.p_bgColor 50 | id_text.color = id_root.p_textColor 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /CustomImageButton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtGraphicalEffects 1.0 3 | import "Config.js" as Data 4 | 5 | Item { 6 | id: id_root 7 | 8 | property string p_text 9 | property string p_image 10 | property color p_bgColor: Data.bgColor_default_imagebt 11 | property color p_bgColorSelected: Data.bgColor_clicked 12 | property color p_textColor: Data.fontColor_default 13 | property color p_textColorSelected: Data.fontColor_clicked 14 | property int p_fontSize: 14 15 | property int p_radius: 10 16 | property int p_index: -1 17 | property int p_curIndex: -1 18 | 19 | signal clicked 20 | 21 | Rectangle { 22 | id: id_boundary 23 | anchors.fill: parent 24 | radius: width / 2 25 | 26 | color: "transparent" 27 | } 28 | 29 | Rectangle { 30 | id: id_rec 31 | anchors.fill: id_boundary 32 | anchors.margins: id_boundary.height * 0.05 33 | radius: width / 2 34 | 35 | color: p_bgColor 36 | } 37 | 38 | Image { 39 | id: id_image 40 | 41 | anchors.fill: id_rec 42 | anchors.margins: id_rec.height * 0.05 43 | fillMode: Image.PreserveAspectFit 44 | smooth: true 45 | z: 1 46 | 47 | source: "images/" + id_root.p_image 48 | } 49 | 50 | MouseArea { 51 | id: mouseArea 52 | anchors.fill: parent 53 | hoverEnabled: true 54 | 55 | onClicked: { 56 | id_root.clicked() 57 | } 58 | 59 | onEntered: { 60 | id_boundary.color = id_rec.color 61 | } 62 | 63 | onExited: { 64 | id_boundary.color = "transparent" 65 | } 66 | } 67 | 68 | onP_curIndexChanged: { 69 | if(id_root.p_index == id_root.p_curIndex){ 70 | id_rec.color = id_root.p_bgColorSelected 71 | id_boundary.color = id_rec.color 72 | }else{ 73 | id_rec.color = id_root.p_bgColor 74 | id_boundary.color = "transparent" 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /CustomItem.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Item { 4 | property int p_min: 0 5 | property int p_max: 100 6 | property int p_cur: 0 7 | property int p_interval: 20 8 | property int p_curFPS: 0 9 | property int p_actualFPS: 0 10 | 11 | signal fps(int target, int actual) 12 | 13 | Timer { 14 | id: id_timer 15 | repeat: true 16 | interval: p_interval 17 | running: true 18 | 19 | onTriggered: { 20 | if(p_cur == p_max){ 21 | p_cur = p_min 22 | } 23 | p_cur++ 24 | } 25 | } 26 | 27 | Timer { 28 | id: id_timer1s 29 | repeat: true 30 | interval: 1000 31 | running: true 32 | 33 | onTriggered: { 34 | p_actualFPS = p_curFPS - 1 35 | p_curFPS = 0 36 | fps(getTargetFPS(), getActualFPS()) 37 | } 38 | } 39 | 40 | function getTargetFPS(){ 41 | return 1000 / p_interval; 42 | } 43 | 44 | function getActualFPS(){ 45 | return p_actualFPS; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /FPSArea.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Item { 4 | id: id_root 5 | property int p_actualFPS: 0 6 | property int p_targetFPS: 0 7 | 8 | Item { 9 | anchors.fill: parent 10 | anchors.margins: parent.height * 0.01 11 | 12 | Rectangle { 13 | id: id_header 14 | anchors { 15 | left: parent.left 16 | right: parent.right 17 | top: parent.top 18 | } 19 | height: parent.height * 0.25 20 | color: "black" 21 | opacity: 0.5 22 | radius: height * 0.2 23 | } 24 | 25 | Text { 26 | anchors.centerIn: id_header 27 | text: "FPS" 28 | font.pixelSize: id_header.height * 0.7 29 | color: "white" 30 | } 31 | 32 | Rectangle { 33 | id: id_left 34 | anchors { 35 | left: parent.left 36 | right: parent.horizontalCenter 37 | top: id_header.bottom 38 | } 39 | height: parent.height * 0.25 40 | color: "black" 41 | radius: height * 0.2 42 | anchors.rightMargin: height * 0.02 43 | 44 | Text { 45 | anchors.centerIn: parent 46 | text: "Target" 47 | font.pixelSize: parent.height * 0.6 48 | color: "white" 49 | } 50 | } 51 | 52 | Rectangle { 53 | id: id_right 54 | anchors { 55 | left: parent.horizontalCenter 56 | right: parent.right 57 | top: id_header.bottom 58 | } 59 | height: parent.height * 0.25 60 | color: "black" 61 | radius: height * 0.2 62 | anchors.leftMargin: height * 0.02 63 | 64 | Text { 65 | anchors.centerIn: parent 66 | text: "Actual" 67 | font.pixelSize: parent.height * 0.6 68 | color: "white" 69 | } 70 | } 71 | 72 | Rectangle { 73 | id: id_targetFPSArea 74 | anchors { 75 | left: parent.left 76 | right: id_left.right 77 | top: id_left.bottom 78 | } 79 | height: parent.height * 0.5 80 | color: "black" 81 | opacity: 0.5 82 | radius: height * 0.2 83 | } 84 | 85 | Text { 86 | anchors.centerIn: id_targetFPSArea 87 | text: p_targetFPS 88 | font.pixelSize: id_targetFPSArea.height * 0.8 89 | color: "white" 90 | } 91 | 92 | Rectangle { 93 | id: id_actualFPSArea 94 | anchors { 95 | left: id_right.left 96 | right: id_right.right 97 | top: id_right.bottom 98 | } 99 | height: parent.height * 0.5 100 | color: "black" 101 | opacity: 0.5 102 | radius: height * 0.2 103 | } 104 | 105 | Text { 106 | anchors.centerIn: id_actualFPSArea 107 | text: p_actualFPS 108 | font.pixelSize: id_actualFPSArea.height * 0.8 109 | color: "white" 110 | } 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /GeneralInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "GeneralInfo.h" 2 | 3 | GeneralInfo::GeneralInfo() 4 | { 5 | this->Total = 0; 6 | this->Usage = 0; 7 | } 8 | 9 | double GeneralInfo::getTotal() 10 | { 11 | return this->Total; 12 | } 13 | 14 | void GeneralInfo::setTotal(double total) 15 | { 16 | this->Total = total; 17 | } 18 | 19 | double GeneralInfo::getUsage() 20 | { 21 | return this->Usage; 22 | } 23 | 24 | void GeneralInfo::setUsage(double usage) 25 | { 26 | this->Usage = usage; 27 | } 28 | -------------------------------------------------------------------------------- /GeneralInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef GENERALINFO_H 2 | #define GENERALINFO_H 3 | 4 | 5 | class GeneralInfo 6 | { 7 | private: 8 | double Total; 9 | double Usage; 10 | 11 | public: 12 | GeneralInfo(); 13 | 14 | //For Total 15 | double getTotal(); 16 | void setTotal(double total); 17 | 18 | //For Usage 19 | double getUsage(); 20 | void setUsage(double usage); 21 | }; 22 | 23 | #endif // GENERALINFO_H 24 | -------------------------------------------------------------------------------- /MemInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "MemInfo.h" 2 | 3 | MemInfo::MemInfo() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /MemInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMINFO_H 2 | #define MEMINFO_H 3 | 4 | #include "GeneralInfo.h" 5 | 6 | class MemInfo: public GeneralInfo 7 | { 8 | public: 9 | MemInfo(); 10 | }; 11 | 12 | #endif // MEMINFO_H 13 | -------------------------------------------------------------------------------- /Menu.js: -------------------------------------------------------------------------------- 1 | //progressbar group 2 | var bar_group = "Bar" 3 | var cir_group = "Circle" 4 | 5 | var probar_groups = [ 6 | bar_group, 7 | cir_group 8 | ] 9 | 10 | //progressbar style 11 | var bar_styles = [ 12 | "", "Hor_1.png", "Hor_1.qml", 13 | "", "Hor_2.png", "Hor_2.qml", 14 | "", "Hor_3.png", "Hor_3.qml", 15 | "", "Hor_4.png", "Hor_4.qml", 16 | "", "Ver_1.png", "Ver_1.qml", 17 | ] 18 | 19 | var cir_styles = [ 20 | "Circle Style 1", "Cir_1.png", "Cir_1.qml", 21 | "Circle Style 2", "Cir_2.png", "Cir_2.qml", 22 | "Circle Style 3", "Cir_3.png", "Cir_3.qml", 23 | "Circle Style 4", "Cir_4.png", "Cir_4.qml", 24 | "Circle Style 5", "Cir_5.png", "Cir_5.qml", 25 | "Circle Style 6", "Cir_6.png", "Cir_6.qml", 26 | "Circle Style 7", "Cir_7.png", "Cir_7.qml", 27 | "Circle Style 8", "Cir_8.png", "Cir_8.qml", 28 | "Circle Style 9", "Cir_9.png", "Cir_9.qml", 29 | ] 30 | -------------------------------------------------------------------------------- /PerformanceArea.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Item { 4 | id: id_root 5 | property int p_cpuUsage: 0 6 | property int p_memUsage: 0 7 | 8 | Item { 9 | anchors.fill: parent 10 | anchors.margins: parent.height * 0.01 11 | 12 | Rectangle { 13 | id: id_header 14 | anchors { 15 | left: parent.left 16 | right: parent.right 17 | top: parent.top 18 | } 19 | height: parent.height * 0.25 20 | color: "black" 21 | opacity: 0.5 22 | radius: height * 0.2 23 | } 24 | 25 | Text { 26 | anchors.centerIn: id_header 27 | text: "Performance" 28 | font.pixelSize: id_header.height * 0.7 29 | color: "white" 30 | } 31 | 32 | Rectangle { 33 | id: id_left 34 | anchors { 35 | left: parent.left 36 | right: parent.horizontalCenter 37 | top: id_header.bottom 38 | } 39 | height: parent.height * 0.25 40 | color: "black" 41 | radius: height * 0.2 42 | anchors.rightMargin: height * 0.02 43 | 44 | Text { 45 | anchors.centerIn: parent 46 | text: "CPU(%)" 47 | font.pixelSize: parent.height * 0.6 48 | color: "white" 49 | } 50 | } 51 | 52 | Rectangle { 53 | id: id_right 54 | anchors { 55 | left: parent.horizontalCenter 56 | right: parent.right 57 | top: id_header.bottom 58 | } 59 | height: parent.height * 0.25 60 | color: "black" 61 | radius: height * 0.2 62 | anchors.leftMargin: height * 0.02 63 | 64 | Text { 65 | anchors.centerIn: parent 66 | text: "MEM(%)" 67 | font.pixelSize: parent.height * 0.6 68 | color: "white" 69 | } 70 | } 71 | 72 | Rectangle { 73 | id: id_cpuArea 74 | anchors { 75 | left: parent.left 76 | right: id_left.right 77 | top: id_left.bottom 78 | } 79 | height: parent.height * 0.5 80 | color: "black" 81 | opacity: 0.5 82 | radius: height * 0.2 83 | } 84 | 85 | Text { 86 | anchors.centerIn: id_cpuArea 87 | text: p_cpuUsage 88 | font.pixelSize: id_cpuArea.height * 0.8 89 | color: "white" 90 | } 91 | 92 | Rectangle { 93 | id: id_memArea 94 | anchors { 95 | left: id_right.left 96 | right: id_right.right 97 | top: id_right.bottom 98 | } 99 | height: parent.height * 0.5 100 | color: "black" 101 | opacity: 0.5 102 | radius: height * 0.2 103 | } 104 | 105 | Text { 106 | anchors.centerIn: id_memArea 107 | text: p_memUsage 108 | font.pixelSize: id_memArea.height * 0.8 109 | color: "white" 110 | } 111 | } 112 | 113 | 114 | } 115 | -------------------------------------------------------------------------------- /ProgressBarCollection.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | QT += qml quick 4 | CONFIG += c++11 5 | 6 | SOURCES += main.cpp \ 7 | CpuInfo.cpp \ 8 | GeneralInfo.cpp \ 9 | MemInfo.cpp \ 10 | SysInfo.cpp \ 11 | SysInfoQML.cpp 12 | 13 | RESOURCES += qml.qrc 14 | 15 | # Additional import path used to resolve QML modules in Qt Creator's code model 16 | QML_IMPORT_PATH = 17 | 18 | # Additional import path used to resolve QML modules just for Qt Quick Designer 19 | QML_DESIGNER_IMPORT_PATH = 20 | 21 | # The following define makes your compiler emit warnings if you use 22 | # any feature of Qt which as been marked deprecated (the exact warnings 23 | # depend on your compiler). Please consult the documentation of the 24 | # deprecated API in order to know how to port your code away from it. 25 | DEFINES += QT_DEPRECATED_WARNINGS 26 | 27 | # You can also make your code fail to compile if you use deprecated APIs. 28 | # In order to do so, uncomment the following line. 29 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 30 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 31 | 32 | # Default rules for deployment. 33 | qnx: target.path = /tmp/$${TARGET}/bin 34 | else: unix:!android: target.path = /opt/$${TARGET}/bin 35 | !isEmpty(target.path): INSTALLS += target 36 | 37 | HEADERS += \ 38 | GeneralInfo.h \ 39 | MemInfo.h \ 40 | CpuInfo.h \ 41 | SysInfo.h \ 42 | SysInfoQML.h \ 43 | 44 | windows { 45 | SOURCES += WindowsInfo.cpp 46 | HEADERS += WindowsInfo.h 47 | } 48 | 49 | android { 50 | SOURCES += AndroidInfo.cpp 51 | HEADERS += AndroidInfo.h 52 | } 53 | 54 | DISTFILES += \ 55 | android/AndroidManifest.xml \ 56 | android/gradle/wrapper/gradle-wrapper.jar \ 57 | android/gradlew \ 58 | android/res/values/libs.xml \ 59 | android/build.gradle \ 60 | android/gradle/wrapper/gradle-wrapper.properties \ 61 | android/gradlew.bat 62 | 63 | ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android 64 | -------------------------------------------------------------------------------- /ProgressBarCollection.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {e6370a31-84f5-43ca-913b-09f652ebec50} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Android for armeabi-v7a (GCC 4.9, Qt 5.8.0) 63 | Android for armeabi-v7a (GCC 4.9, Qt 5.8.0) 64 | {76aa6975-bc41-4ceb-bbd0-93719cab8d88} 65 | 1 66 | 0 67 | 0 68 | 69 | C:/Qt/build-ProgressBarCollection-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0_76aa69-Debug 70 | 71 | 72 | true 73 | qmake 74 | 75 | QtProjectManager.QMakeBuildStep 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | -w 89 | -r 90 | 91 | false 92 | 93 | 94 | 95 | 96 | true 97 | Copy application data 98 | 99 | Qt4ProjectManager.AndroidPackageInstallationStep 100 | 101 | 102 | android-25 103 | F:/Project/QtExample/ProgressBarCollection/android/android_release.keystore 104 | true 105 | Build Android APK 106 | 107 | QmakeProjectManager.AndroidBuildApkStep 108 | 2 109 | true 110 | false 111 | 112 | 4 113 | Build 114 | 115 | ProjectExplorer.BuildSteps.Build 116 | 117 | 118 | 119 | true 120 | Make 121 | 122 | Qt4ProjectManager.MakeStep 123 | 124 | -w 125 | -r 126 | 127 | true 128 | clean 129 | 130 | 131 | 1 132 | Clean 133 | 134 | ProjectExplorer.BuildSteps.Clean 135 | 136 | 2 137 | false 138 | 139 | Debug 140 | 141 | Qt4ProjectManager.Qt4BuildConfiguration 142 | 2 143 | true 144 | 145 | 146 | C:/Qt/build-ProgressBarCollection-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0_76aa69-Release 147 | 148 | 149 | true 150 | qmake 151 | 152 | QtProjectManager.QMakeBuildStep 153 | false 154 | 155 | false 156 | false 157 | false 158 | 159 | 160 | true 161 | Make 162 | 163 | Qt4ProjectManager.MakeStep 164 | 165 | -w 166 | -r 167 | 168 | false 169 | 170 | 171 | 172 | 173 | true 174 | Copy application data 175 | 176 | Qt4ProjectManager.AndroidPackageInstallationStep 177 | 178 | 179 | android-25 180 | F:/Project/QtExample/ProgressBarCollection/android/android_release.keystore 181 | true 182 | Build Android APK 183 | 184 | QmakeProjectManager.AndroidBuildApkStep 185 | 2 186 | true 187 | false 188 | 189 | 4 190 | Build 191 | 192 | ProjectExplorer.BuildSteps.Build 193 | 194 | 195 | 196 | true 197 | Make 198 | 199 | Qt4ProjectManager.MakeStep 200 | 201 | -w 202 | -r 203 | 204 | true 205 | clean 206 | 207 | 208 | 1 209 | Clean 210 | 211 | ProjectExplorer.BuildSteps.Clean 212 | 213 | 2 214 | false 215 | 216 | Release 217 | 218 | Qt4ProjectManager.Qt4BuildConfiguration 219 | 0 220 | true 221 | 222 | 223 | C:/Qt/build-ProgressBarCollection-Android_for_armeabi_v7a_GCC_4_9_Qt_5_8_0_76aa69-Profile 224 | 225 | 226 | true 227 | qmake 228 | 229 | QtProjectManager.QMakeBuildStep 230 | true 231 | 232 | false 233 | true 234 | false 235 | 236 | 237 | true 238 | Make 239 | 240 | Qt4ProjectManager.MakeStep 241 | 242 | -w 243 | -r 244 | 245 | false 246 | 247 | 248 | 249 | 250 | true 251 | Copy application data 252 | 253 | Qt4ProjectManager.AndroidPackageInstallationStep 254 | 255 | 256 | android-25 257 | 258 | true 259 | Build Android APK 260 | 261 | QmakeProjectManager.AndroidBuildApkStep 262 | 2 263 | true 264 | false 265 | 266 | 4 267 | Build 268 | 269 | ProjectExplorer.BuildSteps.Build 270 | 271 | 272 | 273 | true 274 | Make 275 | 276 | Qt4ProjectManager.MakeStep 277 | 278 | -w 279 | -r 280 | 281 | true 282 | clean 283 | 284 | 285 | 1 286 | Clean 287 | 288 | ProjectExplorer.BuildSteps.Clean 289 | 290 | 2 291 | false 292 | 293 | Profile 294 | 295 | Qt4ProjectManager.Qt4BuildConfiguration 296 | 0 297 | true 298 | 299 | 3 300 | 301 | 302 | 303 | true 304 | Deploy to Android device 305 | 306 | Qt4ProjectManager.AndroidDeployQtStep 307 | false 308 | 309 | 1 310 | Deploy 311 | 312 | ProjectExplorer.BuildSteps.Deploy 313 | 314 | 1 315 | Deploy to Android device 316 | Deploy to Android device 317 | Qt4ProjectManager.AndroidDeployConfiguration2 318 | 319 | 1 320 | 321 | TA39101SI2 322 | 323 | 324 | false 325 | false 326 | 1000 327 | 328 | true 329 | 330 | false 331 | false 332 | false 333 | false 334 | true 335 | 0.01 336 | 10 337 | true 338 | 1 339 | 25 340 | 341 | 1 342 | true 343 | false 344 | true 345 | valgrind 346 | 347 | 0 348 | 1 349 | 2 350 | 3 351 | 4 352 | 5 353 | 6 354 | 7 355 | 8 356 | 9 357 | 10 358 | 11 359 | 12 360 | 13 361 | 14 362 | 363 | ProgressBarCollection 364 | 365 | Qt4ProjectManager.AndroidRunConfiguration:C:/Qt/ProgressBarCollection/ProgressBarCollection.pro 366 | ProgressBarCollection.pro 367 | 3768 368 | false 369 | true 370 | false 371 | false 372 | true 373 | 374 | 1 375 | 376 | 377 | 378 | ProjectExplorer.Project.TargetCount 379 | 1 380 | 381 | 382 | ProjectExplorer.Project.Updater.FileVersion 383 | 18 384 | 385 | 386 | Version 387 | 18 388 | 389 | 390 | -------------------------------------------------------------------------------- /ProgressBarGroupsArea.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Item { 4 | id: id_root 5 | 6 | property int p_curIndex: -1 7 | property string p_groupName 8 | 9 | Rectangle { 10 | anchors { 11 | bottom: id_root.bottom 12 | left: id_root.left 13 | right: id_root.right 14 | } 15 | height: id_root.height / 20 16 | 17 | color: "black" 18 | } 19 | 20 | ListModel { 21 | id: id_listOfGroup 22 | } 23 | 24 | Component { 25 | id: id_displayDelegate 26 | 27 | Item { 28 | width: id_root.width / 6 29 | height: id_root.height 30 | 31 | CustomButton { 32 | id: id_button 33 | anchors.fill: parent 34 | anchors { 35 | topMargin: id_root.height / 10 36 | leftMargin: id_root.height / 10 37 | rightMargin: id_root.height / 10 38 | bottomMargin: id_root.height / 10 39 | } 40 | 41 | p_text: name 42 | p_fontSize: id_root.height / 4 43 | p_radius: id_root.height / 2 44 | p_index: index 45 | p_curIndex: id_root.p_curIndex 46 | 47 | onClicked: { 48 | id_root.p_groupName = id_button.p_text 49 | id_root.p_curIndex = index 50 | } 51 | } 52 | } 53 | } 54 | 55 | Flickable { 56 | anchors.fill: parent 57 | contentWidth: id_root.width + 100 58 | clip: true 59 | 60 | Row { 61 | anchors.fill: parent 62 | Repeater { 63 | model: id_listOfGroup 64 | delegate: id_displayDelegate 65 | } 66 | } 67 | } 68 | 69 | function addItem(name) 70 | { 71 | id_listOfGroup.append({"name": name}) 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /ProgressBarStylesArea.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "Menu.js" as Data 3 | 4 | Item { 5 | id: id_root 6 | 7 | //maximum items are displayed 8 | property int p_maxItems: 8 9 | property int p_remainItems: 0 10 | property int p_curIndex: -1 11 | property string p_curSource 12 | property string p_curGroup 13 | signal selected 14 | 15 | Rectangle { 16 | anchors.fill: parent 17 | color: "transparent" 18 | } 19 | 20 | ListModel { 21 | id: id_listOfStyle 22 | } 23 | 24 | Component { 25 | id: id_displayDelegate 26 | 27 | Item { 28 | id: id_delegateItem 29 | 30 | height: id_root.height 31 | width: height 32 | 33 | CustomImageButton { 34 | id: id_button 35 | anchors.fill: parent 36 | 37 | p_text: name 38 | p_fontSize: id_root.height / 20 39 | p_radius: id_root.height / 2 40 | p_index: index 41 | p_image: image 42 | p_curIndex: id_root.p_curIndex 43 | 44 | onClicked: { 45 | id_root.p_curIndex = index 46 | id_root.p_curSource = source 47 | id_root.selected() 48 | } 49 | } 50 | } 51 | } 52 | 53 | Flickable { 54 | id: id_container 55 | 56 | anchors { 57 | top: id_root.top 58 | bottom: id_root.bottom 59 | horizontalCenter: id_root.horizontalCenter 60 | } 61 | width: 0 62 | contentWidth: width + height * p_remainItems 63 | clip: true 64 | 65 | Row { 66 | anchors.fill: parent 67 | Repeater { 68 | model: id_listOfStyle 69 | delegate: id_displayDelegate 70 | } 71 | } 72 | } 73 | 74 | function addItems(group) 75 | { 76 | id_listOfStyle.clear() 77 | p_curGroup = group 78 | id_container.width = id_container.height * Math.min(p_maxItems, elementsInGroup(group)) 79 | p_remainItems = 0 80 | if((elementsInGroup(group) - p_maxItems) > 0){ 81 | p_remainItems = elementsInGroup(group) - p_maxItems 82 | } 83 | 84 | switch(group){ 85 | case Data.bar_group: { 86 | for (var i = 0; i < Data.bar_styles.length; i+=3) { 87 | id_listOfStyle.append({"name": Data.bar_styles[i], "image": Data.bar_styles[i + 1],"source": Data.bar_styles[i + 2]}) 88 | } 89 | break; 90 | } 91 | case Data.cir_group: { 92 | for (var i = 0; i < Data.cir_styles.length; i+=3) { 93 | id_listOfStyle.append({"name": Data.cir_styles[i], "image": Data.cir_styles[i + 1],"source": Data.cir_styles[i + 2]}) 94 | } 95 | break; 96 | } 97 | } 98 | } 99 | 100 | function elementsInGroup(group) { 101 | switch(group){ 102 | case Data.bar_group: { 103 | return Data.bar_styles.length / 3; 104 | } 105 | case Data.cir_group: { 106 | return Data.cir_styles.length / 3; 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ProgressBarCollection 2 | ![picture](https://user-images.githubusercontent.com/24628660/31160413-637e6b9e-a8fa-11e7-8d63-8e8a59facd16.png) 3 | 4 | We create this application to show up demonstration of some style of progress bars that are common used 5 | 6 | This application are written by Qt QML language 7 | 8 | We just use some basic controls of QML type so that it can run on many version of Qt 5. Some controls are used such as: Item, Rectangle, Timer, Text, Canvas, Repeater 9 | 10 | Future work: add more style of progress bars 11 | 12 | Additionally, we also support to measure FPS, CPU usage, RAM usage 13 | 14 | Demonstration video at: 15 | https://www.youtube.com/watch?v=axO0TAELDoE&t=14s 16 | 17 | Android version at: 18 | https://play.google.com/store/apps/details?id=source.ProgressBarCollection 19 | -------------------------------------------------------------------------------- /SysInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "SysInfo.h" 2 | 3 | SysInfo::SysInfo() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /SysInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSINFO_H 2 | #define SYSINFO_H 3 | 4 | #include "MemInfo.h" 5 | #include "CpuInfo.h" 6 | 7 | class SysInfo 8 | { 9 | public: 10 | CpuInfo m_cpuInfo; 11 | MemInfo m_memInfo; 12 | 13 | public: 14 | SysInfo(); 15 | 16 | virtual void update() = 0; 17 | }; 18 | 19 | #endif // SYSINFO_H 20 | -------------------------------------------------------------------------------- /SysInfoQML.cpp: -------------------------------------------------------------------------------- 1 | #include "SysInfoQML.h" 2 | 3 | #ifdef Q_OS_WIN 4 | #include "WindowsInfo.h" 5 | #elif defined(Q_OS_ANDROID) 6 | #include "AndroidInfo.h" 7 | #endif 8 | 9 | 10 | SysInfoQML::SysInfoQML(QObject *parent) : QObject(parent) 11 | { 12 | #ifdef Q_OS_WIN 13 | this->m_sysInfo = new WindowsInfo(); 14 | #elif defined(Q_OS_ANDROID) 15 | this->m_sysInfo = new AndroidInfo(); 16 | #endif 17 | 18 | } 19 | 20 | double SysInfoQML::cpuTotal() const 21 | { 22 | return this->m_sysInfo->m_cpuInfo.getTotal(); 23 | } 24 | 25 | double SysInfoQML::cpuUsage() const 26 | { 27 | return this->m_sysInfo->m_cpuInfo.getUsage(); 28 | } 29 | 30 | double SysInfoQML::memTotal() const 31 | { 32 | return this->m_sysInfo->m_memInfo.getTotal(); 33 | } 34 | 35 | double SysInfoQML::memUsage() const 36 | { 37 | return this->m_sysInfo->m_memInfo.getUsage(); 38 | } 39 | 40 | void SysInfoQML::update() 41 | { 42 | this->m_sysInfo->update(); 43 | } 44 | -------------------------------------------------------------------------------- /SysInfoQML.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSINFOQML_H 2 | #define SYSINFOQML_H 3 | 4 | #include 5 | #include "SysInfo.h" 6 | 7 | class SysInfoQML : public QObject 8 | { 9 | Q_OBJECT 10 | Q_PROPERTY(double cpuTotal READ cpuTotal) 11 | Q_PROPERTY(double cpuUsage READ cpuUsage) 12 | Q_PROPERTY(double memTotal READ memTotal) 13 | Q_PROPERTY(double memUsage READ memUsage) 14 | public: 15 | SysInfoQML(QObject *parent = 0); 16 | 17 | double cpuTotal() const; 18 | double cpuUsage() const; 19 | 20 | double memTotal() const; 21 | double memUsage() const; 22 | 23 | public slots: 24 | void update(); 25 | 26 | private: 27 | SysInfo* m_sysInfo; 28 | }; 29 | 30 | #endif // SYSINFOQML_H 31 | -------------------------------------------------------------------------------- /WindowsInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "WindowsInfo.h" 2 | #include 3 | 4 | WindowsInfo::WindowsInfo() 5 | { 6 | //get memory total 7 | MEMORYSTATUSEX memoryStatus; 8 | memoryStatus.dwLength = sizeof(MEMORYSTATUSEX); 9 | GlobalMemoryStatusEx(&memoryStatus); 10 | this->m_memInfo.setTotal(memoryStatus.ullTotalPhys / 1024 / 1024); 11 | 12 | //get the last systemtime 13 | GetSystemTimes(&this->last_idleTime, &this->last_kernelTime, &this->last_userTime); 14 | } 15 | 16 | void WindowsInfo::update() 17 | { 18 | //update memory 19 | MEMORYSTATUSEX memoryStatus; 20 | memoryStatus.dwLength = sizeof(MEMORYSTATUSEX); 21 | GlobalMemoryStatusEx(&memoryStatus); 22 | this->m_memInfo.setUsage((memoryStatus.ullTotalPhys - memoryStatus.ullAvailPhys) / 1024 / 1024); 23 | 24 | //update cpu 25 | GetSystemTimes( &this->idleTime, &this->kernelTime, &this->userTime); 26 | qulonglong usr, ker, idl, sys; 27 | usr = convertFileTime(userTime) - convertFileTime(last_userTime); 28 | ker = convertFileTime(kernelTime) - convertFileTime(last_kernelTime); 29 | idl = convertFileTime(idleTime) - convertFileTime(last_idleTime); 30 | sys = ker + usr; 31 | this->m_cpuInfo.setUsage((sys - idl) * 100 / sys); 32 | last_userTime = userTime; 33 | last_kernelTime = kernelTime; 34 | last_idleTime = idleTime; 35 | } 36 | 37 | qulonglong WindowsInfo::convertFileTime(const FILETIME& filetime) const 38 | { 39 | ULARGE_INTEGER largeInteger; 40 | largeInteger.LowPart = filetime.dwLowDateTime; 41 | largeInteger.HighPart = filetime.dwHighDateTime; 42 | return largeInteger.QuadPart; 43 | } 44 | -------------------------------------------------------------------------------- /WindowsInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef WINDOWSINFO_H 2 | #define WINDOWSINFO_H 3 | 4 | #include "SysInfo.h" 5 | #include "Windows.h" 6 | #include 7 | 8 | class WindowsInfo : public SysInfo 9 | { 10 | private: 11 | FILETIME idleTime; 12 | FILETIME kernelTime; 13 | FILETIME userTime; 14 | 15 | FILETIME last_idleTime; 16 | FILETIME last_kernelTime; 17 | FILETIME last_userTime; 18 | 19 | public: 20 | WindowsInfo(); 21 | 22 | void update() override; 23 | 24 | qulonglong convertFileTime(const FILETIME& filetime) const; 25 | }; 26 | 27 | #endif // WINDOWSINFO_H 28 | -------------------------------------------------------------------------------- /images/Cir_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_1.png -------------------------------------------------------------------------------- /images/Cir_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_2.png -------------------------------------------------------------------------------- /images/Cir_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_3.png -------------------------------------------------------------------------------- /images/Cir_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_4.png -------------------------------------------------------------------------------- /images/Cir_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_5.png -------------------------------------------------------------------------------- /images/Cir_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_6.png -------------------------------------------------------------------------------- /images/Cir_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_7.png -------------------------------------------------------------------------------- /images/Cir_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_8.png -------------------------------------------------------------------------------- /images/Cir_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Cir_9.png -------------------------------------------------------------------------------- /images/Hor_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Hor_1.png -------------------------------------------------------------------------------- /images/Hor_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Hor_2.png -------------------------------------------------------------------------------- /images/Hor_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Hor_3.png -------------------------------------------------------------------------------- /images/Hor_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Hor_4.png -------------------------------------------------------------------------------- /images/Ver_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhoaTranProgrammer/ProgressBarCollection/64656c6d8e29bec3a796f58003a3bcd21eaefb3d/images/Ver_1.png -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "SysInfoQML.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QGuiApplication app(argc, argv); 9 | QQuickView view; 10 | 11 | qmlRegisterType("SysInfoQML", 1, 0, "SysInfoQML"); 12 | view.setSource(QUrl("qrc:/main.qml")); 13 | view.setMinimumSize(QSize(800, 480)); 14 | view.show(); 15 | 16 | return app.exec(); 17 | } 18 | -------------------------------------------------------------------------------- /main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import SysInfoQML 1.0 3 | import "Menu.js" as Data 4 | import "AutoData.js" as AutoData 5 | 6 | Item { 7 | id: id_root 8 | 9 | property bool isAutoRun: false 10 | 11 | anchors.fill: parent 12 | 13 | Rectangle { 14 | anchors.fill: id_root 15 | color: "#B3E5FC" 16 | } 17 | 18 | SysInfoQML { 19 | id: id_sysInfo 20 | } 21 | 22 | //use for auto run function - start 23 | property int p_autoIndex: 0 24 | 25 | Timer { 26 | id: id_timerAuto 27 | repeat: true 28 | interval: 5000 29 | running: false 30 | 31 | onTriggered: { 32 | id_root.state = "fadeOut" 33 | id_loader.source = "progbarstyles/" + AutoData.list_styles[p_autoIndex++] 34 | var scene = null 35 | scene = id_loader.item 36 | scene.parent = id_root 37 | scene.anchors.fill = id_displayProBarArea 38 | scene.fps.connect(newFPS) 39 | if(p_autoIndex == AutoData.list_styles.length) p_autoIndex = 0; 40 | } 41 | } 42 | 43 | Item { 44 | id: id_autoRun 45 | 46 | anchors { 47 | right: id_root.right 48 | top: id_root.top 49 | } 50 | height: id_root.height / 7 51 | width: height 52 | 53 | Rectangle { 54 | anchors.fill: parent 55 | radius: height / 2 56 | color: "black" 57 | opacity: 0.5 58 | anchors.margins: id_autoRun.height * 0.05 59 | 60 | MouseArea { 61 | id: mouseArea 62 | anchors.fill: parent 63 | 64 | onClicked: { 65 | startAutoRun() 66 | } 67 | } 68 | } 69 | 70 | Text { 71 | anchors.centerIn: id_autoRun 72 | text: "Auto\nRun" 73 | font.pixelSize: id_autoRun.height * 0.3 74 | color: "red" 75 | } 76 | } 77 | 78 | function startAutoRun(){ 79 | isAutoRun = true 80 | id_probar_style_area.p_curIndex = -1 81 | 82 | //Disable some GUI controls 83 | id_autoRun.height = 0 84 | id_autoRun.visible = false 85 | id_probar_group_area.height = 0 86 | id_probar_group_area.visible = false 87 | id_probar_style_area.visible = false 88 | 89 | //Enable some GUI 90 | id_stopAutoRun.visible = true 91 | 92 | //enable Timer for Auto run 93 | id_timerAuto.running = true 94 | 95 | //Set source qml file 96 | id_loader.source = "progbarstyles/" + AutoData.list_styles[p_autoIndex++] 97 | var scene = null 98 | scene = id_loader.item 99 | scene.parent = id_root 100 | scene.anchors.fill = id_displayProBarArea 101 | scene.fps.connect(newFPS) 102 | } 103 | 104 | function endAutoRun(){ 105 | isAutoRun = false 106 | 107 | //Enable some GUI controls 108 | id_autoRun.height = id_root.height / 7 109 | id_autoRun.visible = true 110 | id_probar_group_area.height = id_root.height / 7 111 | id_probar_group_area.visible = true 112 | id_probar_style_area.visible = true 113 | 114 | //Disable some GUI 115 | id_stopAutoRun.visible = false 116 | 117 | //enable Timer for Auto run 118 | id_timerAuto.running = false 119 | 120 | id_loader.source = "" 121 | 122 | p_autoIndex = 0 123 | } 124 | //use for auto run function - end 125 | 126 | ProgressBarGroupsArea { 127 | id: id_probar_group_area 128 | 129 | anchors { 130 | top: id_root.top 131 | left: id_root.left 132 | right: id_autoRun.left 133 | } 134 | height: id_root.height / 7 135 | z: 1 136 | 137 | Component.onCompleted: { 138 | for(var i = 0; i < Data.probar_groups.length; i++){ 139 | id_probar_group_area.addItem(Data.probar_groups[i]) 140 | } 141 | } 142 | 143 | onP_curIndexChanged: { 144 | id_fpsArea.p_targetFPS = 0 145 | id_fpsArea.p_actualFPS = 0 146 | 147 | id_probar_style_area.addItems(id_probar_group_area.p_groupName) 148 | id_probar_style_area.p_curIndex = -1 149 | id_loader.source = "" 150 | } 151 | } 152 | 153 | ProgressBarStylesArea { 154 | id: id_probar_style_area 155 | 156 | anchors { 157 | bottom: id_root.bottom 158 | left: id_root.left 159 | right: id_root.right 160 | } 161 | height: id_probar_group_area.height * 1.1 162 | 163 | onSelected: { 164 | id_fpsArea.p_targetFPS = 0 165 | id_fpsArea.p_actualFPS = 0 166 | 167 | id_loader.source = "progbarstyles/" + p_curSource 168 | var scene = null 169 | scene = id_loader.item 170 | scene.parent = id_root 171 | scene.anchors.fill = id_displayProBarArea 172 | scene.fps.connect(newFPS) 173 | } 174 | } 175 | 176 | Item { 177 | id: id_displayProBarArea 178 | 179 | anchors { 180 | left: id_root.left 181 | top: id_probar_group_area.bottom 182 | right: id_root.right 183 | bottom: id_probar_style_area.verticalCenter 184 | } 185 | } 186 | 187 | FPSArea { 188 | id: id_fpsArea 189 | 190 | anchors { 191 | right: id_root.right 192 | top: id_probar_group_area.bottom 193 | } 194 | width: id_root.width * 0.2 195 | height: id_root.height * 0.2 196 | } 197 | 198 | PerformanceArea { 199 | id: id_perfArea 200 | 201 | anchors { 202 | left: id_root.left 203 | top: id_probar_group_area.bottom 204 | } 205 | width: id_root.width * 0.2 206 | height: id_root.height * 0.2 207 | } 208 | 209 | Item { 210 | id: id_stopAutoRun 211 | anchors { 212 | bottom: id_root.bottom 213 | left: id_root.left 214 | right: id_root.right 215 | } 216 | height: id_root.height * 0.15 217 | visible: false 218 | 219 | Text { 220 | anchors.centerIn: parent 221 | text: "Please click to stop AutoRun" 222 | font.pixelSize: parent.height * 0.5 223 | color: "red" 224 | 225 | MouseArea { 226 | anchors.fill: parent 227 | 228 | onClicked: { 229 | endAutoRun() 230 | } 231 | } 232 | } 233 | } 234 | 235 | Loader { 236 | id: id_loader 237 | 238 | onLoaded: { 239 | if(isAutoRun) id_root.state = "fadeIn" 240 | } 241 | 242 | } 243 | 244 | states: [ 245 | State { 246 | name: "fadeOut"; 247 | PropertyChanges { target: id_loader.item; opacity: 0.1; } 248 | }, 249 | State { 250 | name: "fadeIn"; 251 | PropertyChanges { target: id_loader.item; opacity: 1; } 252 | } 253 | ] 254 | 255 | transitions: [ 256 | Transition { 257 | to: "fadeIn" 258 | NumberAnimation { properties: "opacity"; from: 0.0; to: 0.99; duration: 2000 } 259 | }, 260 | Transition { 261 | to: "fadeOut" 262 | NumberAnimation { properties: "opacity"; from: 0.99; to: 0; duration: 2000 } 263 | } 264 | ] 265 | 266 | Timer { 267 | id: id_timer1s 268 | repeat: true 269 | interval: 1000 270 | running: true 271 | 272 | onTriggered: { 273 | id_sysInfo.update() 274 | id_perfArea.p_cpuUsage = id_sysInfo.cpuUsage 275 | id_perfArea.p_memUsage = id_sysInfo.memUsage * 100 / id_sysInfo.memTotal 276 | } 277 | } 278 | 279 | function newFPS(target, actual){ 280 | id_fpsArea.p_targetFPS = target 281 | id_fpsArea.p_actualFPS = actual 282 | } 283 | } 284 | -------------------------------------------------------------------------------- /progbarstyles/Cir_1.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Canvas { 8 | id: id_canvas 9 | 10 | anchors { 11 | horizontalCenter: id_root.horizontalCenter 12 | verticalCenter: id_root.verticalCenter 13 | } 14 | contextType: "2d" 15 | antialiasing: true 16 | height: id_root.height * 0.8 17 | width: height 18 | rotation: 270 19 | 20 | onPaint: { 21 | var context = id_canvas.getContext('2d'); 22 | context.strokeStyle = "black"; 23 | 24 | context.lineWidth = id_canvas.height * 0.1; 25 | context.beginPath(); 26 | context.arc(id_canvas.height / 2, id_canvas.height / 2, id_canvas.height / 2 * 0.85, 0, Math.PI * 2, false); 27 | context.stroke(); 28 | 29 | context.strokeStyle = "green"; 30 | context.beginPath(); 31 | context.arc(id_canvas.height / 2, id_canvas.height / 2, id_canvas.height / 2 * 0.85, 0, Math.PI * 2 * id_root.p_cur / id_root.p_max, false); 32 | context.stroke(); 33 | 34 | p_curFPS++; 35 | } 36 | } 37 | 38 | Text { 39 | anchors.centerIn: id_canvas 40 | text: id_root.p_cur + " %" 41 | font.pixelSize: id_root.height * 0.2 42 | color: "green" 43 | } 44 | 45 | onP_curChanged: { 46 | id_canvas.requestPaint() 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /progbarstyles/Cir_2.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Canvas { 8 | id: id_canvas 9 | 10 | anchors { 11 | horizontalCenter: id_root.horizontalCenter 12 | verticalCenter: id_root.verticalCenter 13 | } 14 | contextType: "2d" 15 | antialiasing: true 16 | height: id_root.height * 0.8 17 | width: height 18 | rotation: 270 19 | 20 | onPaint: { 21 | var context = id_canvas.getContext('2d'); 22 | context.strokeStyle = "#26A69A"; 23 | 24 | context.lineWidth = id_canvas.height * 0.1; 25 | context.beginPath(); 26 | context.arc(id_canvas.height / 2, id_canvas.height / 2, id_canvas.height / 2 * 0.85, 0, Math.PI * 2, false); 27 | context.stroke(); 28 | 29 | context.strokeStyle = "#1DE9B6"; 30 | context.beginPath(); 31 | context.arc(id_canvas.height / 2, id_canvas.height / 2, id_canvas.height / 2 * 0.85, Math.PI * 2 * id_root.p_cur / id_root.p_max, Math.PI * 2 * 0.15 + Math.PI * 2 * id_root.p_cur / id_root.p_max, false); 32 | context.stroke(); 33 | 34 | p_curFPS++; 35 | } 36 | } 37 | 38 | onP_curChanged: { 39 | id_canvas.requestPaint() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /progbarstyles/Cir_3.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Canvas { 8 | id: id_canvas 9 | 10 | anchors { 11 | horizontalCenter: id_root.horizontalCenter 12 | verticalCenter: id_root.verticalCenter 13 | } 14 | contextType: "2d" 15 | antialiasing: true 16 | height: id_root.height * 0.8 17 | width: height 18 | rotation: 270 19 | 20 | onPaint: { 21 | var context = id_canvas.getContext('2d'); 22 | 23 | context.clearRect(0, 0, id_canvas.width, id_canvas.height); 24 | context.strokeStyle = "#1DE9B6"; 25 | context.lineWidth = id_canvas.height / 2; 26 | context.beginPath(); 27 | context.arc(id_canvas.height / 2, id_canvas.height / 2, id_canvas.height / 4, 0, Math.PI * 2 * id_root.p_cur / id_root.p_max, false); 28 | context.stroke(); 29 | 30 | p_curFPS++; 31 | } 32 | } 33 | 34 | onP_curChanged: { 35 | id_canvas.requestPaint() 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /progbarstyles/Cir_4.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Canvas { 8 | id: id_canvas 9 | 10 | anchors { 11 | horizontalCenter: id_root.horizontalCenter 12 | verticalCenter: id_root.verticalCenter 13 | } 14 | contextType: "2d" 15 | antialiasing: true 16 | height: id_root.height * 1.5 17 | width: height 18 | rotation: 270 19 | 20 | onPaint: { 21 | var context = id_canvas.getContext('2d'); 22 | 23 | context.clearRect(0, 0, id_canvas.width, id_canvas.height); 24 | context.strokeStyle = "blue"; 25 | context.lineWidth = id_canvas.height / 2; 26 | context.beginPath(); 27 | context.arc(id_canvas.height / 2, id_canvas.height / 2, id_canvas.height / 1024, 0, Math.PI * 2 * id_root.p_cur / id_root.p_max, false); 28 | context.stroke(); 29 | 30 | p_curFPS++; 31 | } 32 | } 33 | 34 | onP_curChanged: { 35 | id_canvas.requestPaint() 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /progbarstyles/Cir_5.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | property int p_Blocks: 8 10 | 11 | anchors.centerIn: parent 12 | height: Math.min(id_root.width, id_root.height) * 0.8 13 | width: height 14 | radius: width/2 15 | color: "transparent" 16 | 17 | Repeater { 18 | model: id_rec1.p_Blocks 19 | 20 | Item { 21 | height: id_rec1.height/2 22 | transformOrigin: Item.Bottom 23 | rotation: index * (360 / id_rec1.p_Blocks) 24 | x: id_rec1.width/2 25 | y: 0 26 | 27 | Rectangle { 28 | property int p_cur: id_root.p_cur 29 | height: id_rec1.height * 0.2 30 | width: height 31 | radius: width/2 32 | color: "black" 33 | anchors.horizontalCenter: parent.horizontalCenter 34 | 35 | onP_curChanged: { 36 | var cur_block = id_root.p_cur / (id_root.p_max / id_rec1.p_Blocks) 37 | if((cur_block > index) && (cur_block < index + 1)){ 38 | height = id_rec1.height * 0.3 39 | }else{ 40 | height = id_rec1.height * 0.2 41 | } 42 | if(index == (id_rec1.p_Blocks - 1)){ 43 | p_curFPS++ 44 | } 45 | } 46 | } 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /progbarstyles/Cir_6.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | property int p_Blocks: 8 10 | property int p_CurBlock: 0 11 | 12 | QtObject { 13 | id: id_obj 14 | property var colorList : ["#80CBC4", "#4DB6AC", "#26A69A", "#009688", "#00897B", "#00796B", "#00695C", "#004D40"] 15 | } 16 | 17 | anchors.centerIn: parent 18 | height: Math.min(id_root.width, id_root.height) * 0.8 19 | width: height 20 | radius: width/2 21 | color: "transparent" 22 | 23 | Repeater { 24 | model: id_rec1.p_Blocks 25 | 26 | Item { 27 | height: id_rec1.height/2 28 | transformOrigin: Item.Bottom 29 | rotation: index * (360 / id_rec1.p_Blocks) 30 | x: id_rec1.width/2 31 | y: 0 32 | 33 | Rectangle { 34 | property int p_cur: id_root.p_cur 35 | height: id_rec1.height * 0.2 36 | width: height 37 | radius: width/2 38 | color: "#80CBC4" 39 | anchors.horizontalCenter: parent.horizontalCenter 40 | 41 | onP_curChanged: { 42 | if(index == id_rec1.p_CurBlock){ 43 | color = id_obj.colorList[id_obj.colorList.length - 1] 44 | }else{ 45 | var step = index - id_rec1.p_CurBlock 46 | if(step < 0){ 47 | color = id_obj.colorList[id_obj.colorList.length + step] 48 | }else{ 49 | color = id_obj.colorList[step] 50 | } 51 | } 52 | if(index == (id_rec1.p_Blocks - 1)){ 53 | p_curFPS++ 54 | } 55 | } 56 | } 57 | } 58 | } 59 | } 60 | 61 | onP_curChanged: { 62 | id_rec1.p_CurBlock = id_root.p_cur / (id_root.p_max / id_rec1.p_Blocks) 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /progbarstyles/Cir_7.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | property int p_Blocks: 16 10 | 11 | anchors.centerIn: parent 12 | height: Math.min(id_root.width, id_root.height) * 0.8 13 | width: height 14 | transformOrigin: Item.Center 15 | rotation: 270 16 | color: "transparent" 17 | 18 | Repeater { 19 | model: id_rec1.p_Blocks 20 | 21 | Item { 22 | anchors.fill: parent 23 | Canvas { 24 | property int p_cur: id_root.p_cur 25 | 26 | anchors.fill: parent 27 | contextType: "2d" 28 | antialiasing: true 29 | 30 | onPaint: { 31 | var context = getContext('2d'); 32 | 33 | if(id_root.p_cur < (index * id_root.p_max / id_rec1.p_Blocks)){ 34 | context.strokeStyle = "#FFCC80"; 35 | }else{ 36 | context.strokeStyle = "#FF9800"; 37 | } 38 | 39 | context.lineWidth = id_rec1.height * 0.1; 40 | context.beginPath(); 41 | context.arc(id_rec1.height / 2, id_rec1.height / 2, id_rec1.height / 2 * 0.85, index * Math.PI * 2 * (360 / id_rec1.p_Blocks / 360) + Math.PI * 2 * 0.003, index * Math.PI * 2 * (360 / id_rec1.p_Blocks / 360) + Math.PI * 2 * (360 / id_rec1.p_Blocks / 360), false); 42 | context.stroke(); 43 | 44 | if(index == (id_rec1.p_Blocks - 1)){ 45 | p_curFPS++ 46 | } 47 | } 48 | 49 | onP_curChanged: { 50 | requestPaint() 51 | } 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /progbarstyles/Cir_8.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Canvas { 8 | id: id_canvas 9 | 10 | anchors { 11 | horizontalCenter: id_root.horizontalCenter 12 | verticalCenter: id_root.verticalCenter 13 | } 14 | contextType: "2d" 15 | antialiasing: true 16 | height: id_root.height * 0.8 17 | width: height 18 | 19 | onPaint: { 20 | var context = id_canvas.getContext('2d'); 21 | context.clearRect(0, 0, id_canvas.width, id_canvas.height); 22 | context.strokeStyle = "#CDDC39"; 23 | 24 | context.lineWidth = id_canvas.height * 0.1; 25 | context.beginPath(); 26 | context.arc(id_canvas.height / 2, id_canvas.height / 2, id_canvas.height / 2 * 0.85, 0, Math.PI * 2 * 0.85, false); 27 | context.stroke(); 28 | 29 | context.beginPath(); 30 | context.lineWidth = id_canvas.height * 0.05; 31 | context.arc(id_canvas.height / 2 + Math.cos(0) * id_canvas.height / 2 * 0.85, id_canvas.height / 2 + Math.sin(0) * id_canvas.height / 2 * 0.85, id_canvas.height * 0.05 / 2, 0, Math.PI * 2, false); 32 | context.stroke(); 33 | 34 | context.beginPath(); 35 | context.lineWidth = id_canvas.height * 0.05; 36 | context.arc(id_canvas.height / 2 + Math.cos(Math.PI * 2 * 0.15) * id_canvas.height / 2 * 0.85, id_canvas.height / 2 - Math.sin(Math.PI * 2 * 0.15) * id_canvas.height / 2 * 0.85, id_canvas.height * 0.05 / 2, 0, Math.PI * 2, false); 37 | context.stroke(); 38 | } 39 | } 40 | 41 | onP_curChanged: { 42 | id_canvas.rotation = 360 * id_root.p_cur / id_root.p_max; 43 | p_curFPS++; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /progbarstyles/Cir_9.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | property int p_Blocks: 8 10 | 11 | anchors.centerIn: parent 12 | height: Math.min(id_root.width, id_root.height) * 0.8 13 | width: height 14 | transformOrigin: Item.Center 15 | rotation: 270 16 | color: "transparent" 17 | 18 | Repeater { 19 | model: id_rec1.p_Blocks 20 | 21 | Item { 22 | anchors.fill: parent 23 | Canvas { 24 | property int p_cur: id_root.p_cur 25 | 26 | anchors.fill: parent 27 | contextType: "2d" 28 | antialiasing: true 29 | 30 | onPaint: { 31 | var context = getContext('2d'); 32 | 33 | if(id_root.p_cur > (index * id_root.p_max / id_rec1.p_Blocks)){ 34 | context.strokeStyle = "#76FF03"; 35 | }else{ 36 | context.strokeStyle = "#757575"; 37 | } 38 | 39 | context.lineWidth = id_rec1.height / 2 / id_rec1.p_Blocks * 0.7; 40 | context.beginPath(); 41 | context.arc(id_rec1.height / 2, id_rec1.height / 2, id_rec1.height / 2 * index / id_rec1.p_Blocks, 0, Math.PI * 2 , false); 42 | context.stroke(); 43 | 44 | if(index == (id_rec1.p_Blocks - 1)){ 45 | p_curFPS++ 46 | } 47 | } 48 | 49 | onP_curChanged: { 50 | requestPaint() 51 | } 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /progbarstyles/Hor_1.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | 10 | anchors { 11 | left: id_root.left 12 | right: id_root.right 13 | verticalCenter: id_root.verticalCenter 14 | leftMargin: id_root.width * 0.01 15 | rightMargin: id_root.width * 0.01 16 | } 17 | height: id_root.height * 0.1 18 | 19 | color: "white" 20 | } 21 | 22 | Rectangle { 23 | id: id_rec2 24 | 25 | anchors { 26 | left: id_rec1.left 27 | top: id_rec1.top 28 | bottom: id_rec1.bottom 29 | margins: id_rec1.height * 0.1 30 | } 31 | width: id_root.p_cur * id_rec1.width / id_root.p_max 32 | 33 | color: "blue" 34 | } 35 | 36 | Text { 37 | anchors { 38 | left: id_rec1.left 39 | bottom: id_rec1.top 40 | bottomMargin: id_rec1.height * 0.1 41 | } 42 | text: "On loading, please waiting......" 43 | font.pixelSize: id_rec1.height * 0.5 44 | } 45 | 46 | Text { 47 | id: id_curPercent 48 | anchors { 49 | centerIn: id_rec1 50 | margins: id_rec2.height * 0.08 51 | } 52 | text: id_root.p_cur + " %" 53 | font.pixelSize: id_rec1.height * 0.5 54 | } 55 | 56 | onP_curChanged: { 57 | p_curFPS++ 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /progbarstyles/Hor_2.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | 10 | anchors { 11 | left: id_root.left 12 | right: id_root.right 13 | verticalCenter: id_root.verticalCenter 14 | leftMargin: id_root.width * 0.01 15 | rightMargin: id_root.width * 0.01 16 | } 17 | height: id_root.height * 0.1 18 | radius: id_rec1.height 19 | 20 | color: "gray" 21 | } 22 | 23 | Rectangle { 24 | id: id_rec2 25 | 26 | anchors { 27 | left: id_rec1.left 28 | top: id_rec1.top 29 | bottom: id_rec1.bottom 30 | margins: id_rec1.height * 0.1 31 | } 32 | width: id_root.p_cur * id_rec1.width / id_root.p_max 33 | radius: id_rec1.radius 34 | 35 | color: "green" 36 | } 37 | 38 | onP_curChanged: { 39 | p_curFPS++ 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /progbarstyles/Hor_3.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | property int p_Blocks: 15 10 | 11 | anchors { 12 | left: id_root.left 13 | right: id_root.right 14 | verticalCenter: id_root.verticalCenter 15 | leftMargin: id_root.width * 0.01 16 | rightMargin: id_root.width * 0.01 17 | } 18 | height: id_root.height * 0.1 19 | color: "white" 20 | 21 | Repeater { 22 | model: id_rec1.p_Blocks 23 | 24 | Item { 25 | width: id_rec1.width / id_rec1.p_Blocks 26 | height: id_rec1.height 27 | x: id_rec1.width / id_rec1.p_Blocks * index 28 | y: 0 29 | 30 | Rectangle { 31 | property int p_cur: id_root.p_cur 32 | anchors { 33 | fill: parent 34 | topMargin: parent.height * 0.1 35 | bottomMargin: parent.height * 0.1 36 | leftMargin: parent.height * 0.05 37 | rightMargin: parent.height * 0.05 38 | } 39 | color: "white" 40 | 41 | onP_curChanged: { 42 | if(id_root.p_cur < (index * id_root.p_max / id_rec1.p_Blocks)){ 43 | color = "white" 44 | }else{ 45 | color = "blue" 46 | } 47 | if(index == (id_rec1.p_Blocks - 1)){ 48 | p_curFPS++ 49 | } 50 | } 51 | } 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /progbarstyles/Hor_4.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | property int p_Blocks: 8 10 | property int p_CurBlock: 0 11 | 12 | QtObject { 13 | id: id_obj 14 | property var colorList : ["#757575", "#757575", "#BDBDBD", "#BDBDBD", "#EEEEEE", "#EEEEEE", "#FAFAFA", "#FAFAFA"] 15 | } 16 | 17 | anchors { 18 | left: id_root.left 19 | right: id_root.right 20 | verticalCenter: id_root.verticalCenter 21 | leftMargin: id_root.width * 0.01 22 | rightMargin: id_root.width * 0.01 23 | } 24 | height: id_root.height * 0.6 25 | color: "transparent" 26 | 27 | Repeater { 28 | model: id_rec1.p_Blocks 29 | 30 | Item { 31 | width: id_rec1.width / id_rec1.p_Blocks 32 | height: id_rec1.height 33 | x: id_rec1.width / id_rec1.p_Blocks * index 34 | y: 0 35 | 36 | Rectangle { 37 | property int p_cur: id_root.p_cur 38 | anchors { 39 | fill: parent 40 | topMargin: parent.height * 0.1 41 | bottomMargin: parent.height * 0.1 42 | leftMargin: parent.height * 0.02 43 | rightMargin: parent.height * 0.02 44 | } 45 | color: "#757575" 46 | 47 | onP_curChanged: { 48 | if(index == id_rec1.p_CurBlock){ 49 | color = id_obj.colorList[0] 50 | }else{ 51 | var step = index - id_rec1.p_CurBlock 52 | if(step < 0){ 53 | color = id_obj.colorList[id_obj.colorList.length + step] 54 | }else{ 55 | color = id_obj.colorList[step] 56 | } 57 | } 58 | if(index == (id_rec1.p_Blocks - 1)){ 59 | p_curFPS++ 60 | } 61 | } 62 | } 63 | } 64 | } 65 | } 66 | 67 | onP_curChanged: { 68 | id_rec1.p_CurBlock = id_root.p_cur / (id_root.p_max / id_rec1.p_Blocks) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /progbarstyles/Ver_1.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../" 3 | 4 | CustomItem { 5 | id: id_root 6 | 7 | Rectangle { 8 | id: id_rec1 9 | property int p_Blocks: 15 10 | 11 | anchors { 12 | horizontalCenter: parent.horizontalCenter 13 | verticalCenter: parent.verticalCenter 14 | } 15 | width: parent.width * 0.15 16 | height: parent.height * 0.8 17 | color: "#757575" 18 | 19 | Repeater { 20 | model: id_rec1.p_Blocks 21 | 22 | Item { 23 | property int p_cur: id_root.p_cur 24 | 25 | width: id_rec1.width 26 | height: id_rec1.height / id_rec1.p_Blocks 27 | x: 0 28 | y: id_rec1.height - id_rec1.height / id_rec1.p_Blocks * index - id_rec1.height / id_rec1.p_Blocks 29 | 30 | Rectangle { 31 | id: id_left 32 | anchors { 33 | left: parent.left 34 | top: parent.top 35 | bottom: parent.bottom 36 | right: parent.horizontalCenter 37 | margins: parent.height * 0.1 38 | } 39 | color: "#757575" 40 | } 41 | 42 | Rectangle { 43 | id: id_right 44 | anchors { 45 | left: parent.horizontalCenter 46 | top: parent.top 47 | bottom: parent.bottom 48 | right: parent.right 49 | margins: parent.height * 0.1 50 | } 51 | color: "#757575" 52 | } 53 | 54 | onP_curChanged: { 55 | if(id_root.p_cur < (index * id_root.p_max / id_rec1.p_Blocks)){ 56 | id_left.color = "#757575" 57 | id_right.color = "#757575" 58 | }else{ 59 | id_left.color = "#76FF03" 60 | id_right.color = "#76FF03" 61 | } 62 | if(index == (id_rec1.p_Blocks - 1)){ 63 | p_curFPS++ 64 | } 65 | } 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | Menu.js 5 | ProgressBarGroupsArea.qml 6 | Config.js 7 | CustomButton.qml 8 | ProgressBarStylesArea.qml 9 | CustomImageButton.qml 10 | progbarstyles/Hor_1.qml 11 | images/Hor_1.png 12 | progbarstyles/Hor_2.qml 13 | images/Hor_2.png 14 | progbarstyles/Cir_1.qml 15 | progbarstyles/Cir_2.qml 16 | progbarstyles/Cir_3.qml 17 | progbarstyles/Cir_4.qml 18 | progbarstyles/Hor_3.qml 19 | progbarstyles/Cir_5.qml 20 | progbarstyles/Cir_6.qml 21 | progbarstyles/Hor_4.qml 22 | progbarstyles/Cir_7.qml 23 | images/Hor_3.png 24 | images/Hor_4.png 25 | images/Cir_1.png 26 | images/Cir_2.png 27 | images/Cir_3.png 28 | images/Cir_4.png 29 | images/Cir_5.png 30 | images/Cir_6.png 31 | images/Cir_7.png 32 | progbarstyles/Cir_8.qml 33 | images/Cir_8.png 34 | progbarstyles/Cir_9.qml 35 | images/Cir_9.png 36 | progbarstyles/Ver_1.qml 37 | CustomItem.qml 38 | FPSArea.qml 39 | images/Ver_1.png 40 | PerformanceArea.qml 41 | AutoData.js 42 | 43 | 44 | --------------------------------------------------------------------------------