pouya
2 years ago
commit
2ea558c8e3
19 changed files with 1133 additions and 0 deletions
@ -0,0 +1,73 @@ |
|||
# This file is used to ignore files which are generated |
|||
# ---------------------------------------------------------------------------- |
|||
|
|||
*~ |
|||
*.autosave |
|||
*.a |
|||
*.core |
|||
*.moc |
|||
*.o |
|||
*.obj |
|||
*.orig |
|||
*.rej |
|||
*.so |
|||
*.so.* |
|||
*_pch.h.cpp |
|||
*_resource.rc |
|||
*.qm |
|||
.#* |
|||
*.*# |
|||
core |
|||
!core/ |
|||
tags |
|||
.DS_Store |
|||
.directory |
|||
*.debug |
|||
Makefile* |
|||
*.prl |
|||
*.app |
|||
moc_*.cpp |
|||
ui_*.h |
|||
qrc_*.cpp |
|||
Thumbs.db |
|||
*.res |
|||
*.rc |
|||
/.qmake.cache |
|||
/.qmake.stash |
|||
|
|||
# qtcreator generated files |
|||
*.pro.user* |
|||
|
|||
# xemacs temporary files |
|||
*.flc |
|||
|
|||
# Vim temporary files |
|||
.*.swp |
|||
|
|||
# Visual Studio generated files |
|||
*.ib_pdb_index |
|||
*.idb |
|||
*.ilk |
|||
*.pdb |
|||
*.sln |
|||
*.suo |
|||
*.vcproj |
|||
*vcproj.*.*.user |
|||
*.ncb |
|||
*.sdf |
|||
*.opensdf |
|||
*.vcxproj |
|||
*vcxproj.* |
|||
|
|||
# MinGW generated files |
|||
*.Debug |
|||
*.Release |
|||
|
|||
# Python byte code |
|||
*.pyc |
|||
|
|||
# Binaries |
|||
# -------- |
|||
*.dll |
|||
*.exe |
|||
|
@ -0,0 +1,25 @@ |
|||
QT += quick quickcontrols2 |
|||
|
|||
# You can make your code fail to compile if it uses deprecated APIs. |
|||
# In order to do so, uncomment the following line. |
|||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 |
|||
|
|||
SOURCES += \ |
|||
bridge.cpp \ |
|||
main.cpp |
|||
|
|||
RESOURCES += UI/qml.qrc |
|||
|
|||
# Additional import path used to resolve QML modules in Qt Creator's code model |
|||
QML_IMPORT_PATH = |
|||
|
|||
# Additional import path used to resolve QML modules just for Qt Quick Designer |
|||
QML_DESIGNER_IMPORT_PATH = |
|||
|
|||
# Default rules for deployment. |
|||
qnx: target.path = /tmp/$${TARGET}/bin |
|||
else: unix:!android: target.path = /opt/$${TARGET}/bin |
|||
!isEmpty(target.path): INSTALLS += target |
|||
|
|||
HEADERS += \ |
|||
bridge.h |
@ -0,0 +1,45 @@ |
|||
import QtQuick 2.15 |
|||
import QtQuick.Window 2.15 |
|||
import QtQuick.Controls 2.15 |
|||
import QtQuick.Controls.Material 2.15 |
|||
|
|||
Item { |
|||
property string input: idText.text |
|||
property string name: "" |
|||
anchors.topMargin: 5 |
|||
width: parent.width |
|||
height: 57 |
|||
function clear() { |
|||
idText.clear() |
|||
} |
|||
|
|||
Label { |
|||
id: idName |
|||
anchors.left: parent.left |
|||
text: parent.name + ":" |
|||
y: 0 |
|||
Material.foreground: "#167a72" |
|||
font.pointSize: 10 |
|||
visible: false |
|||
} |
|||
TextField { |
|||
id: idText |
|||
y: 10 |
|||
horizontalAlignment: TextInput.AlignHCenter |
|||
anchors.horizontalCenter: parent.horizontalCenter |
|||
width: parent.width |
|||
selectByMouse: true |
|||
onTextChanged: { |
|||
|
|||
if (text === "") { |
|||
placeholderText = name |
|||
idName.visible = false |
|||
} else { |
|||
placeholderText = "" |
|||
idName.visible = true |
|||
} |
|||
} |
|||
|
|||
placeholderText: name |
|||
} |
|||
} |
@ -0,0 +1,6 @@ |
|||
import QtQuick 2.15 |
|||
|
|||
Rectangle { |
|||
|
|||
color: "#F5F5F5" |
|||
} |
@ -0,0 +1,65 @@ |
|||
import QtQuick 2.0 |
|||
import QtQuick.Controls 2.13 |
|||
|
|||
TextField { |
|||
id: customTextField |
|||
|
|||
property bool isEmpty: text == "" |
|||
property string title: "Camera Name" |
|||
|
|||
width: 250 |
|||
height: 56 |
|||
|
|||
text: "" |
|||
font.pixelSize: 14 |
|||
horizontalAlignment: Text.AlignLeft |
|||
verticalAlignment: Text.AlignTop |
|||
topPadding: 25 |
|||
|
|||
Text { |
|||
id: titleText |
|||
font.pixelSize: parent.isEmpty ? 14 : 12 |
|||
y: parent.isEmpty ? 25 : 10 |
|||
x: 10 |
|||
text: parent.title |
|||
color: parent.isEmpty ? "gray" : "red" |
|||
|
|||
Behavior on y { |
|||
NumberAnimation { |
|||
duration: Theme.easingDuration |
|||
easing.type: Easing.InOutQuad |
|||
} |
|||
} |
|||
|
|||
Behavior on font.pixelSize { |
|||
NumberAnimation { |
|||
duration: Theme.easingDuration |
|||
easing.type: Easing.InOutQuad |
|||
} |
|||
} |
|||
} |
|||
|
|||
background: Rectangle { |
|||
radius: 5 |
|||
implicitWidth: parent.width |
|||
implicitHeight: parent.height |
|||
color: parent.focus ? Theme.tertiary : Theme.secondary |
|||
|
|||
Rectangle { |
|||
id: cornerFiller |
|||
width: parent.width |
|||
height: parent.radius |
|||
anchors.bottom: parent.bottom |
|||
color: parent.color |
|||
} |
|||
|
|||
Rectangle { |
|||
id: focusSign |
|||
width: parent.width |
|||
height: 2 |
|||
anchors.bottom: parent.bottom |
|||
color: Theme.primary |
|||
visible: customTextField.focus |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,53 @@ |
|||
import QtQuick 2.12 |
|||
import QtQuick.Layouts 1.12 |
|||
import "../" |
|||
|
|||
Rectangle { |
|||
id: root |
|||
color: "#e6f0ea" |
|||
property var userData |
|||
property var indexOfDelegate |
|||
anchors.horizontalCenter: parent.horizontalCenter |
|||
width: parent.width - 30 |
|||
onIndexOfDelegateChanged: { |
|||
if (indexOfDelegate % 2 == 0) { |
|||
root.color = "#debaba" |
|||
} else { |
|||
root.color = "#ded1ba" |
|||
} |
|||
} |
|||
|
|||
onUserDataChanged: { |
|||
id_source.text = userData.source |
|||
id_destination.text = userData.destination |
|||
id_message.text = userData.message |
|||
id_duration.text = userData.duration |
|||
} |
|||
|
|||
RowLayout { |
|||
anchors.fill: parent |
|||
clip: true |
|||
|
|||
C_DataField { |
|||
id: id_source |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
} |
|||
C_DataField { |
|||
id: id_destination |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
} |
|||
C_DataField { |
|||
id: id_message |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
Layout.fillWidth: true |
|||
} |
|||
C_DataField { |
|||
id: id_duration |
|||
Layout.minimumWidth: 100 |
|||
Layout.preferredWidth: 100 |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
import QtQuick 2.15 |
|||
|
|||
Item { |
|||
height: parent.height |
|||
property alias text: id_text.text |
|||
property bool makeGreen: false |
|||
property bool isBold: false |
|||
|
|||
Text { |
|||
id: id_text |
|||
anchors.fill: parent |
|||
horizontalAlignment: Text.AlignHCenter |
|||
verticalAlignment: Text.AlignVCenter |
|||
color: { |
|||
if (makeGreen) { |
|||
return "#3e8740" |
|||
} else { |
|||
return "#505550" |
|||
} |
|||
} |
|||
font.bold: isBold |
|||
} |
|||
} |
@ -0,0 +1,121 @@ |
|||
import QtQuick 2.12 |
|||
import QtQuick.Layouts 1.12 |
|||
import "../" |
|||
|
|||
Rectangle { |
|||
id: root |
|||
color: "#e6f0ea" |
|||
radius: 6 |
|||
property var userData |
|||
property var indexOfDelegate |
|||
height: 40 |
|||
onIndexOfDelegateChanged: { |
|||
if (indexOfDelegate % 2 == 0) { |
|||
root.color = "#bed6bc" |
|||
} else { |
|||
root.color = "#bcd6d4" |
|||
} |
|||
} |
|||
|
|||
clip: true |
|||
onUserDataChanged: { |
|||
id_source.text = userData.source |
|||
id_destination.text = userData.destination |
|||
id_message.text = userData.message |
|||
id_duration.text = userData.duration |
|||
|
|||
id_modelChild.clear() |
|||
|
|||
for (var i = 0; i < userData.child.length; i++) { |
|||
id_modelChild.append({ |
|||
"info": userData.child[i] |
|||
}) |
|||
} |
|||
idChildList.height = 40 * userData.child.length |
|||
} |
|||
|
|||
Item { |
|||
id: idTitle |
|||
width: parent.width |
|||
height: 40 |
|||
anchors.top: parent.top |
|||
RowLayout { |
|||
anchors.fill: parent |
|||
clip: true |
|||
|
|||
Item { |
|||
Layout.minimumWidth: 15 |
|||
Layout.preferredWidth: 15 |
|||
} |
|||
C_DataField { |
|||
id: id_source |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
isBold: true |
|||
} |
|||
C_DataField { |
|||
id: id_destination |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
isBold: true |
|||
} |
|||
C_DataField { |
|||
id: id_message |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
Layout.fillWidth: true |
|||
isBold: true |
|||
} |
|||
C_DataField { |
|||
id: id_duration |
|||
Layout.minimumWidth: 100 |
|||
Layout.preferredWidth: 100 |
|||
isBold: true |
|||
} |
|||
Item { |
|||
Layout.minimumWidth: 15 |
|||
Layout.preferredWidth: 15 |
|||
} |
|||
} |
|||
MouseArea { |
|||
property bool isExapnded: false |
|||
anchors.fill: parent |
|||
onClicked: { |
|||
|
|||
if (isExapnded) { |
|||
isExapnded = false |
|||
root.height = 40 |
|||
} else { |
|||
isExapnded = true |
|||
root.height = 40 + idChildList.height + 15 |
|||
} |
|||
} |
|||
} |
|||
} |
|||
Item { |
|||
id: idChildList |
|||
anchors.top: idTitle.bottom |
|||
width: parent.width |
|||
visible: true |
|||
ListView { |
|||
anchors.fill: parent |
|||
model: id_modelChild |
|||
spacing: 0 |
|||
clip: true |
|||
delegate: CTableDeligateChild { |
|||
userData: info |
|||
height: 40 |
|||
indexOfDelegate: index |
|||
} |
|||
} |
|||
ListModel { |
|||
id: id_modelChild |
|||
} |
|||
} |
|||
|
|||
Behavior on height { |
|||
NumberAnimation { |
|||
duration: 200 |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,34 @@ |
|||
import QtQuick 2.12 |
|||
import QtQuick.Controls 2.12 |
|||
import "../" |
|||
|
|||
Item { |
|||
id: root |
|||
function updateListOfMessages(listOfMesseges) { |
|||
id_model.clear() |
|||
for (var i = 0; i < listOfMesseges.length; i++) { |
|||
id_model.append({ |
|||
"info": listOfMesseges[i] |
|||
}) |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
ListModel { |
|||
id: id_model |
|||
} |
|||
|
|||
ListView { |
|||
anchors.fill: parent |
|||
model: id_model |
|||
spacing: 5 |
|||
clip: true |
|||
delegate: C_TableDelegate { |
|||
userData: info |
|||
|
|||
width: root.width |
|||
indexOfDelegate: index |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
import QtQuick 2.0 |
|||
|
|||
Item { |
|||
id: root |
|||
height: parent.height |
|||
property alias text: id_text.text |
|||
property int sortState: 0 |
|||
signal clicked |
|||
onSortStateChanged: { |
|||
if (sortState === 0) { |
|||
id_text.color = "#848984" |
|||
id_text.font.bold = false |
|||
} else { |
|||
id_text.color = "#0091ff" |
|||
id_text.font.bold = true |
|||
} |
|||
} |
|||
|
|||
Rectangle { |
|||
id: idRectangle |
|||
radius: 100 |
|||
opacity: 0 |
|||
color: "black" |
|||
anchors.fill: parent |
|||
|
|||
Behavior on opacity { |
|||
NumberAnimation { |
|||
duration: 100 |
|||
} |
|||
} |
|||
|
|||
MouseArea { |
|||
anchors.fill: parent |
|||
hoverEnabled: true |
|||
onHoveredChanged: { |
|||
if (containsMouse) { |
|||
idRectangle.opacity = 0.05 |
|||
} else { |
|||
idRectangle.opacity = 0 |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
Text { |
|||
id: id_text |
|||
anchors.fill: parent |
|||
horizontalAlignment: Text.AlignHCenter |
|||
verticalAlignment: Text.AlignVCenter |
|||
color: "#848984" |
|||
} |
|||
MouseArea { |
|||
anchors.fill: parent |
|||
onClicked: { |
|||
if (sortState === 0) |
|||
sortState = 1 |
|||
else if (sortState === 1) |
|||
sortState = -1 |
|||
else if (sortState === -1) |
|||
sortState = 0 |
|||
|
|||
root.clicked() |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,68 @@ |
|||
import QtQuick 2.12 |
|||
import QtQuick.Layouts 1.12 |
|||
|
|||
RowLayout { |
|||
|
|||
Item { |
|||
Layout.minimumWidth: 15 |
|||
Layout.preferredWidth: 15 |
|||
} |
|||
C_Title { |
|||
id: src |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
text: "Source" |
|||
onClicked: { |
|||
des.sortState = 0 |
|||
mess.sortState = 0 |
|||
dur.sortState = 0 |
|||
setSortState() |
|||
} |
|||
} |
|||
C_Title { |
|||
id: des |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
text: "Destination" |
|||
onClicked: { |
|||
src.sortState = 0 |
|||
mess.sortState = 0 |
|||
dur.sortState = 0 |
|||
setSortState() |
|||
} |
|||
} |
|||
C_Title { |
|||
id: mess |
|||
Layout.minimumWidth: 200 |
|||
Layout.preferredWidth: 200 |
|||
Layout.fillWidth: true |
|||
text: "Message" |
|||
onClicked: { |
|||
src.sortState = 0 |
|||
des.sortState = 0 |
|||
dur.sortState = 0 |
|||
setSortState() |
|||
} |
|||
} |
|||
C_Title { |
|||
id: dur |
|||
Layout.minimumWidth: 100 |
|||
Layout.preferredWidth: 100 |
|||
text: "Duration" |
|||
onClicked: { |
|||
src.sortState = 0 |
|||
des.sortState = 0 |
|||
mess.sortState = 0 |
|||
setSortState() |
|||
} |
|||
} |
|||
Item { |
|||
Layout.minimumWidth: 15 |
|||
Layout.preferredWidth: 15 |
|||
} |
|||
|
|||
function setSortState() { |
|||
cpp.sortsChanged(src.sortState, des.sortState, mess.sortState, |
|||
dur.sortState) |
|||
} |
|||
} |
@ -0,0 +1,146 @@ |
|||
import QtQuick 2.12 |
|||
import QtQuick.Controls 2.12 |
|||
import "../Components" |
|||
import "../" |
|||
|
|||
Item{ |
|||
|
|||
Item{ |
|||
id: root |
|||
anchors.fill: parent |
|||
C_RectangleWithShadow { |
|||
anchors.top: parent.top |
|||
width: parent.width |
|||
height: 55 |
|||
radius: 0 |
|||
color: "#D3D8D5" |
|||
Text { |
|||
height: parent.height |
|||
width: 200 |
|||
verticalAlignment: Text.AlignVCenter |
|||
horizontalAlignment: Text.AlignHCenter |
|||
anchors.horizontalCenter: parent.horizontalCenter |
|||
id: name |
|||
text: StateManager.lastEmail |
|||
color: "#008299" |
|||
font: Style.fontTitle |
|||
|
|||
} |
|||
|
|||
C_Button{ |
|||
width: 200 |
|||
height: 37 |
|||
anchors.verticalCenter: parent.verticalCenter |
|||
text: "Update Users List" |
|||
anchors.right: parent.right |
|||
anchors.rightMargin: 40 |
|||
mainColor: Style.secondaryColor |
|||
hoverColor: Style.secondaryColorDarker |
|||
onClicked: { |
|||
StateManager.requestUsersList(); |
|||
} |
|||
} |
|||
C_Button{ |
|||
width: 130 |
|||
height: 37 |
|||
anchors.verticalCenter: parent.verticalCenter |
|||
text: "Log Out" |
|||
anchors.left: parent.left |
|||
anchors.leftMargin: 40 |
|||
mainColor: "#de4e4e" |
|||
hoverColor: "#c74242" |
|||
onClicked: { |
|||
StateManager.requestLogOut(); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
C_RectangleWithShadow { |
|||
anchors.fill: parent |
|||
anchors.rightMargin: 35 |
|||
anchors.leftMargin: 35 |
|||
anchors.topMargin: 90 |
|||
anchors.bottomMargin: 40 |
|||
radius: 10 |
|||
color: "#eff6f2" |
|||
|
|||
Flickable { |
|||
anchors.fill: parent |
|||
anchors.rightMargin: 4 |
|||
anchors.leftMargin: 4 |
|||
onWidthChanged: { |
|||
if(width>990){ |
|||
contentWidth = parent.width |
|||
} |
|||
else{ |
|||
contentWidth = 990; |
|||
} |
|||
} |
|||
|
|||
contentWidth: 990 |
|||
contentHeight: parent.height |
|||
flickableDirection: Flickable.HorizontalFlick |
|||
boundsBehavior: Flickable.StopAtBounds |
|||
ScrollIndicator.horizontal: ScrollIndicator { } |
|||
clip: true |
|||
|
|||
|
|||
C_Titles{ |
|||
id:id_titels |
|||
anchors.top: parent.top |
|||
anchors.topMargin: 5 |
|||
anchors.right: parent.right |
|||
anchors.left: parent.left |
|||
anchors.rightMargin: 10 |
|||
anchors.leftMargin: 10 |
|||
height: 25 |
|||
} |
|||
C_TableUsers{ |
|||
id:tableUsers |
|||
anchors.right: parent.right |
|||
anchors.left: parent.left |
|||
anchors.bottom: parent.bottom |
|||
anchors.top: id_titels.bottom |
|||
anchors.topMargin: 10 |
|||
anchors.rightMargin: 10 |
|||
anchors.leftMargin: 10 |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
Connections { |
|||
target: StateManager |
|||
onOpenUserEditWindow: function(userInfo){ |
|||
id_editUserWindow.visible = true; |
|||
id_blur.visible = true; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
C_Blur{ |
|||
id:id_blur |
|||
|
|||
target: root |
|||
z:2 |
|||
} |
|||
|
|||
C_UserEdit { |
|||
id: id_editUserWindow |
|||
anchors.centerIn: parent |
|||
width: 420 |
|||
height: 600 |
|||
z:3 |
|||
onCloseWithOutSaving: { |
|||
id_editUserWindow.opacity = 0; |
|||
id_blur.opacity = 0; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
After Width: | Height: | Size: 3.0 KiB |
@ -0,0 +1,234 @@ |
|||
import QtQuick 2.15 |
|||
import QtQuick.Window 2.15 |
|||
import QtQuick.Controls 2.15 |
|||
import QtQuick.Controls.Material 2.15 |
|||
import QtQuick.Dialogs 1.3 |
|||
|
|||
import "./UserList" |
|||
|
|||
Window { |
|||
id: root |
|||
width: 1200 |
|||
height: 800 |
|||
visible: true |
|||
title: "Logger" |
|||
|
|||
Material.theme: Material.Light |
|||
Material.primary: Material.Red |
|||
Material.accent: Material.Cyan |
|||
Rectangle { |
|||
anchors.fill: parent |
|||
color: "#E4E4E4" |
|||
Item { |
|||
id: idMenu |
|||
anchors.left: parent.left |
|||
height: parent.height |
|||
width: 300 |
|||
|
|||
CSection { |
|||
id: idOpenFile |
|||
width: parent.width |
|||
height: 70 |
|||
|
|||
Item { |
|||
width: parent.width - 30 |
|||
anchors.horizontalCenter: parent.horizontalCenter |
|||
anchors.top: parent.top |
|||
anchors.topMargin: 10 |
|||
|
|||
Button { |
|||
text: "Open Log File" |
|||
anchors.horizontalCenter: parent.horizontalCenter |
|||
Material.accent: Material.Orange |
|||
highlighted: true |
|||
Material.background: Material.Teal |
|||
width: parent.width |
|||
onClicked: fileDialog.open() |
|||
FileDialog { |
|||
id: fileDialog |
|||
title: "Please choose a Log" |
|||
folder: shortcuts.home |
|||
onAccepted: { |
|||
root.title = fileDialog.fileUrls[0] |
|||
cpp.fileLogChanged(fileDialog.fileUrls[0]) |
|||
} |
|||
Component.onCompleted: visible = false |
|||
} |
|||
} |
|||
} |
|||
} |
|||
CSection { |
|||
|
|||
width: parent.width |
|||
anchors.top: idOpenFile.bottom |
|||
anchors.topMargin: 5 |
|||
anchors.bottom: parent.bottom |
|||
|
|||
Label { |
|||
id: idLabel |
|||
text: "Filters" |
|||
anchors.left: parent.left |
|||
anchors.top: parent.top |
|||
anchors.topMargin: 4 |
|||
anchors.leftMargin: 4 |
|||
font.pointSize: 12 |
|||
Material.foreground: "#a5a5a5" |
|||
} |
|||
Item { |
|||
id: idFilters |
|||
property bool isSignalDisable: false |
|||
anchors.left: parent.left |
|||
anchors.right: parent.right |
|||
anchors.bottom: parent.bottom |
|||
anchors.top: idLabel.bottom |
|||
anchors.margins: 16 |
|||
anchors.topMargin: 15 |
|||
|
|||
CFilters { |
|||
id: idSource |
|||
name: "Source" |
|||
onInputChanged: idFilters.setFilters() |
|||
} |
|||
CFilters { |
|||
id: idDistination |
|||
name: "Destination" |
|||
anchors.top: idSource.bottom |
|||
onInputChanged: idFilters.setFilters() |
|||
} |
|||
CFilters { |
|||
id: idMessage |
|||
name: "Message" |
|||
anchors.top: idDistination.bottom |
|||
onInputChanged: idFilters.setFilters() |
|||
} |
|||
|
|||
CFilters { |
|||
id: idMinMessageLength |
|||
name: "Min Message Length" |
|||
anchors.top: idMessage.bottom |
|||
anchors.topMargin: 32 |
|||
onInputChanged: idFilters.setFilters() |
|||
} |
|||
CFilters { |
|||
id: idMaxMessageLength |
|||
name: "Max Message Length" |
|||
anchors.top: idMinMessageLength.bottom |
|||
onInputChanged: idFilters.setFilters() |
|||
} |
|||
|
|||
CFilters { |
|||
id: idMinMessageDuration |
|||
name: "Min Message Time" |
|||
anchors.top: idMaxMessageLength.bottom |
|||
anchors.topMargin: 32 |
|||
onInputChanged: idFilters.setFilters() |
|||
} |
|||
CFilters { |
|||
id: idMaxMessageDuration |
|||
name: "Max Message Time" |
|||
anchors.top: idMinMessageDuration.bottom |
|||
onInputChanged: idFilters.setFilters() |
|||
} |
|||
|
|||
function setFilters() { |
|||
if (!idFilters.isSignalDisable) { |
|||
cpp.filtersChanged(idSource.input, |
|||
idDistination.input, |
|||
idMessage.input, |
|||
idMinMessageLength.input, |
|||
idMaxMessageLength.input, |
|||
idMinMessageDuration.input, |
|||
idMaxMessageDuration.input) |
|||
} |
|||
} |
|||
|
|||
Button { |
|||
text: "Clear All Filters" |
|||
anchors.horizontalCenter: parent.horizontalCenter |
|||
Material.accent: Material.Orange |
|||
highlighted: true |
|||
Material.background: Material.Orange |
|||
width: parent.width |
|||
anchors.top: idMaxMessageDuration.bottom |
|||
anchors.topMargin: 0 |
|||
onClicked: { |
|||
idFilters.isSignalDisable = true |
|||
idMaxMessageDuration.clear() |
|||
idMinMessageDuration.clear() |
|||
idMaxMessageLength.clear() |
|||
idMinMessageLength.clear() |
|||
idMessage.clear() |
|||
idDistination.clear() |
|||
idSource.clear() |
|||
idFilters.isSignalDisable = false |
|||
idFilters.setFilters() |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
CSection { |
|||
id: idMain |
|||
anchors.right: parent.right |
|||
height: parent.height |
|||
anchors.left: idMenu.right |
|||
anchors.leftMargin: 5 |
|||
|
|||
C_Titles { |
|||
id: id_titels |
|||
anchors.top: parent.top |
|||
anchors.topMargin: 5 |
|||
anchors.right: parent.right |
|||
anchors.left: parent.left |
|||
anchors.rightMargin: 10 |
|||
anchors.leftMargin: 10 |
|||
height: 25 |
|||
} |
|||
C_TableUsers { |
|||
id: tableUsers |
|||
anchors.right: parent.right |
|||
anchors.left: parent.left |
|||
anchors.bottom: parent.bottom |
|||
anchors.top: id_titels.bottom |
|||
anchors.topMargin: 10 |
|||
anchors.rightMargin: 10 |
|||
anchors.leftMargin: 10 |
|||
|
|||
// Component.onCompleted: { |
|||
// let messeges = [] |
|||
// let messege1 = { |
|||
// "source": "source1", |
|||
// "destination": "dest1", |
|||
// "message": "message1", |
|||
// "duration": "120ms", |
|||
// "child": [{ |
|||
// "source": "child source1", |
|||
// "destination": "child dest1", |
|||
// "message": "chld message1", |
|||
// "duration": "120ms" |
|||
// }, { |
|||
// "source": "child source2", |
|||
// "destination": "child dest2", |
|||
// "message": "chld message3", |
|||
// "duration": "220ms" |
|||
// }] |
|||
// } |
|||
// messeges.push(messege1) |
|||
// messeges.push(messege1) |
|||
// messeges.push(messege1) |
|||
// messeges.push(messege1) |
|||
// updateListOfMessages(messeges) |
|||
// } |
|||
Connections { |
|||
target: cpp |
|||
function onSetJsonData(jsonData) { |
|||
// console.log(jsonData) |
|||
let jsonObj = JSON.parse(jsonData) |
|||
tableUsers.updateListOfMessages(jsonObj) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,17 @@ |
|||
<RCC> |
|||
<qresource prefix="/"> |
|||
<file>main.qml</file> |
|||
<file>qtquickcontrols2.conf</file> |
|||
<file>log.svg</file> |
|||
<file>CSection.qml</file> |
|||
<file>CTextField.qml</file> |
|||
<file>CFilters.qml</file> |
|||
<file>UserList/C_DataField.qml</file> |
|||
<file>UserList/C_TableDelegate.qml</file> |
|||
<file>UserList/C_TableUsers.qml</file> |
|||
<file>UserList/C_Title.qml</file> |
|||
<file>UserList/C_Titles.qml</file> |
|||
<file>UserList/P_UserList.qml</file> |
|||
<file>UserList/CTableDeligateChild.qml</file> |
|||
</qresource> |
|||
</RCC> |
@ -0,0 +1,2 @@ |
|||
[Controls] |
|||
Style=Material |
@ -0,0 +1,41 @@ |
|||
#include "bridge.h" |
|||
|
|||
#include <QJsonArray> |
|||
#include <QJsonObject> |
|||
#include <QJsonDocument> |
|||
#include <QDebug> |
|||
#include <QTimer> |
|||
|
|||
|
|||
|
|||
Bridge::Bridge(QObject *parent) |
|||
: QObject{parent} |
|||
{ |
|||
QJsonDocument jsonDoc; |
|||
QJsonArray mainArray; |
|||
QJsonObject obj1; |
|||
obj1.insert ("source","source1"); |
|||
obj1.insert ("destination","destination1"); |
|||
obj1.insert ("message","message1"); |
|||
obj1.insert ("duration","duration1"); |
|||
QJsonArray childArray; |
|||
childArray.append (obj1); |
|||
childArray.append (obj1); |
|||
obj1.insert ("child",childArray); |
|||
|
|||
mainArray.append (obj1); |
|||
mainArray.append (obj1); |
|||
jsonDoc.setArray (mainArray); |
|||
QString jsonString = jsonDoc.toJson(); |
|||
|
|||
connect (this,&Bridge::sortsChanged ,[=](int path,int path1,int path2, |
|||
int path3){ |
|||
qDebug() << "___________--"; |
|||
qDebug() << path << " " << path1; |
|||
|
|||
}); |
|||
|
|||
QTimer::singleShot(2000, this, [=](){ |
|||
emit setJsonData (jsonString); |
|||
}); |
|||
} |
@ -0,0 +1,32 @@ |
|||
#ifndef BRIDGE_H |
|||
#define BRIDGE_H |
|||
|
|||
#include <QObject> |
|||
|
|||
class Bridge : public QObject |
|||
{ |
|||
Q_OBJECT |
|||
public: |
|||
explicit Bridge(QObject *parent = nullptr); |
|||
|
|||
|
|||
|
|||
signals://===from qml===
|
|||
void filtersChanged(QString source,QString destination,QString message, |
|||
QString minMessageLength,QString maxMessageLenght, |
|||
QString minMessageTime, QString maxMessageTile); |
|||
|
|||
//1 assending , -1 desending , 0 non
|
|||
void sortsChanged(int sourceOrder, int distinationOrder, |
|||
int messageOrder,int durationOrder); |
|||
void fileLogChanged(QString path); |
|||
|
|||
|
|||
signals://===from cpp===
|
|||
void setJsonData(QString jsonData); |
|||
|
|||
|
|||
|
|||
}; |
|||
|
|||
#endif // BRIDGE_H
|
@ -0,0 +1,22 @@ |
|||
#include <QGuiApplication> |
|||
#include <QQmlApplicationEngine> |
|||
#include <QQmlContext> |
|||
|
|||
#include <bridge.h> |
|||
|
|||
int main(int argc, char *argv[]) |
|||
{ |
|||
|
|||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); |
|||
|
|||
QGuiApplication app(argc, argv); |
|||
app.setOrganizationName("Sepanta"); |
|||
app.setOrganizationDomain("Sepanta"); |
|||
|
|||
QQmlApplicationEngine engine; |
|||
Bridge *brdige = new Bridge; |
|||
engine.rootContext ()->setContextProperty ("cpp",brdige); |
|||
engine.load("qrc:/main.qml"); |
|||
|
|||
return app.exec(); |
|||
} |
Loading…
Reference in new issue