Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Qt UI Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Design Studio
QML Viewer Projects
Qt UI Viewer
Commits
3f9e6f6c
Verified
Commit
3f9e6f6c
authored
1 year ago
by
Burak Hançerli
Browse files
Options
Downloads
Patches
Plain Diff
add: integrate with download progress bar
parent
f7fd2266
No related branches found
No related tags found
No related merge requests found
Pipeline
#62179
passed
1 year ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/main.qml
+1
-1
1 addition, 1 deletion
resources/main.qml
src/backend.cpp
+2
-0
2 additions, 0 deletions
src/backend.cpp
src/backend.h
+4
-0
4 additions, 0 deletions
src/backend.h
with
7 additions
and
1 deletion
resources/main.qml
+
1
−
1
View file @
3f9e6f6c
...
@@ -31,7 +31,7 @@ Rectangle {
...
@@ -31,7 +31,7 @@ Rectangle {
id
:
progressBar
id
:
progressBar
Layout.minimumWidth
:
380
Layout.minimumWidth
:
380
to
:
100
to
:
100
value
:
50
value
:
backend
.
downloadProgress
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/backend.cpp
+
2
−
0
View file @
3f9e6f6c
...
@@ -334,6 +334,8 @@ QSharedPointer<QNetworkReply> Backend::fetchResource(const QString &url)
...
@@ -334,6 +334,8 @@ QSharedPointer<QNetworkReply> Backend::fetchResource(const QString &url)
float
percentage
=
roundf
((
float
)
bytesReceived
/
(
float
)
bytesTotal
*
100
);
float
percentage
=
roundf
((
float
)
bytesReceived
/
(
float
)
bytesTotal
*
100
);
printLog
(
"Download progress "
+
QSTRN
(
percentage
)
+
"% - "
printLog
(
"Download progress "
+
QSTRN
(
percentage
)
+
"% - "
+
QSTRN
(
bytesReceived
)
+
"/"
+
QSTRN
(
bytesTotal
));
+
QSTRN
(
bytesReceived
)
+
"/"
+
QSTRN
(
bytesTotal
));
m_downloadProgress
=
percentage
;
emit
downloadProgressChanged
();
});
});
loop
.
exec
();
loop
.
exec
();
...
...
This diff is collapsed.
Click to expand it.
src/backend.h
+
4
−
0
View file @
3f9e6f6c
...
@@ -39,16 +39,19 @@ class Backend : public QObject
...
@@ -39,16 +39,19 @@ class Backend : public QObject
Q_OBJECT
Q_OBJECT
Q_PROPERTY
(
QString
logs
READ
logs
NOTIFY
logsChanged
)
Q_PROPERTY
(
QString
logs
READ
logs
NOTIFY
logsChanged
)
Q_PROPERTY
(
QString
buildInfo
READ
buildInfo
NOTIFY
buildInfoChanged
)
Q_PROPERTY
(
QString
buildInfo
READ
buildInfo
NOTIFY
buildInfoChanged
)
Q_PROPERTY
(
int
downloadProgress
READ
downloadProgress
NOTIFY
downloadProgressChanged
FINAL
)
public:
public:
explicit
Backend
(
QObject
*
parent
=
nullptr
);
explicit
Backend
(
QObject
*
parent
=
nullptr
);
QString
logs
()
const
{
return
m_logs
;
}
QString
logs
()
const
{
return
m_logs
;
}
QString
buildInfo
()
const
{
return
m_buildInfo
;
}
QString
buildInfo
()
const
{
return
m_buildInfo
;
}
int
downloadProgress
()
const
{
return
m_downloadProgress
;
}
private
:
private
:
// UI data
// UI data
QString
m_logs
;
QString
m_logs
;
QString
m_buildInfo
;
QString
m_buildInfo
;
int
m_downloadProgress
=
0
;
// Qml related members
// Qml related members
QQmlEngine
m_qmlEngine
;
QQmlEngine
m_qmlEngine
;
...
@@ -77,6 +80,7 @@ private:
...
@@ -77,6 +80,7 @@ private:
signals
:
signals
:
void
logsChanged
();
void
logsChanged
();
void
buildInfoChanged
();
void
buildInfoChanged
();
void
downloadProgressChanged
();
public
slots
:
public
slots
:
void
downloadAndRun
(
const
QString
&
url
);
void
downloadAndRun
(
const
QString
&
url
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment