Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Tobias Hunger
qt-creator
Commits
76be8042
Commit
76be8042
authored
15 years ago
by
con
Browse files
Options
Downloads
Patches
Plain Diff
More documentation for ProgressManager related tasks.
parent
b6d1b700
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/coreplugin/progressmanager/futureprogress.cpp
+69
-0
69 additions, 0 deletions
src/plugins/coreplugin/progressmanager/futureprogress.cpp
src/plugins/coreplugin/progressmanager/progressmanager.cpp
+10
-2
10 additions, 2 deletions
src/plugins/coreplugin/progressmanager/progressmanager.cpp
with
79 additions
and
2 deletions
src/plugins/coreplugin/progressmanager/futureprogress.cpp
+
69
−
0
View file @
76be8042
...
...
@@ -39,6 +39,41 @@
using
namespace
Core
;
/*!
\mainclass
\class Core::FutureProgress
\brief The FutureProgress class is used to adapt the appearance of
progress indicators that were created through the ProgressManager class.
Use the instance of this class that was returned by
ProgressManager::addTask() to define a widget that
should be shown below the progress bar, or to change the
progress title.
Also use it to react on the event that the user clicks on
the progress indicator (which can be used to e.g. open a more detailed
view, or the results of the task).
*/
/*!
\fn void FutureProgress::clicked()
Connect to this signal to get informed when the user clicks on the
progress indicator.
*/
/*!
\fn void FutureProgress::finished()
Another way to get informed when the task has finished.
*/
/*!
\fn QWidget FutureProgress::widget() const
Returns the custom widget that is shown below the progress indicator.
*/
/*!
\fn FutureProgress::FutureProgress(QWidget *parent)
\internal
*/
FutureProgress
::
FutureProgress
(
QWidget
*
parent
)
:
QWidget
(
parent
),
m_progress
(
new
ProgressBar
),
...
...
@@ -63,12 +98,22 @@ FutureProgress::FutureProgress(QWidget *parent)
connect
(
m_progress
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
cancel
()));
}
/*!
\fn FutureProgress::~FutureProgress()
\internal
*/
FutureProgress
::~
FutureProgress
()
{
if
(
m_widget
)
delete
m_widget
;
}
/*!
\fn void FutureProgress::setWidget(QWidget *widget)
Sets the \a widget to show below the progress bar.
This will be destroyed when the progress indicator is destroyed.
Default is to show no widget below the progress indicator.
*/
void
FutureProgress
::
setWidget
(
QWidget
*
widget
)
{
if
(
m_widget
)
...
...
@@ -81,11 +126,19 @@ void FutureProgress::setWidget(QWidget *widget)
m_widgetLayout
->
addWidget
(
m_widget
);
}
/*!
\fn void FutureProgress::setTitle(const QString &title)
Changes the \a title of the progress indicator.
*/
void
FutureProgress
::
setTitle
(
const
QString
&
title
)
{
m_progress
->
setTitle
(
title
);
}
/*!
\fn QString FutureProgress::title() const
Returns the title of the progress indicator.
*/
QString
FutureProgress
::
title
()
const
{
return
m_progress
->
title
();
...
...
@@ -144,16 +197,28 @@ void FutureProgress::setProgressText(const QString &text)
setToolTip
(
text
);
}
/*!
\fn void FutureProgress::setFuture(const QFuture<void> &future)
\internal
*/
void
FutureProgress
::
setFuture
(
const
QFuture
<
void
>
&
future
)
{
m_watcher
.
setFuture
(
future
);
}
/*!
\fn QFuture<void> FutureProgress::future() const
Returns a QFuture object that represents this running task.
*/
QFuture
<
void
>
FutureProgress
::
future
()
const
{
return
m_watcher
.
future
();
}
/*!
\fn void FutureProgress::mousePressEvent(QMouseEvent *event)
\internal
*/
void
FutureProgress
::
mousePressEvent
(
QMouseEvent
*
event
)
{
if
(
event
->
button
()
==
Qt
::
LeftButton
)
...
...
@@ -161,6 +226,10 @@ void FutureProgress::mousePressEvent(QMouseEvent *event)
QWidget
::
mousePressEvent
(
event
);
}
/*!
\fn bool FutureProgress::hasError() const
Returns the error state of this progress indicator.
*/
bool
FutureProgress
::
hasError
()
const
{
return
m_progress
->
hasError
();
...
...
This diff is collapsed.
Click to expand it.
src/plugins/coreplugin/progressmanager/progressmanager.cpp
+
10
−
2
View file @
76be8042
...
...
@@ -166,6 +166,13 @@ using namespace Core::Internal;
in QFutureInterface. After the long taking operation has finished,
we report so through the QFutureInterface object, and delete it
afterwards.
\section1 Customizing progress appearance
You can set a custom widget to show below the progress bar itself,
using the FutureProgress object returned by the addTask() method.
Also use this object to get notified when the user clicks on the
progress indicator.
*/
/*!
...
...
@@ -193,13 +200,14 @@ using namespace Core::Internal;
/*!
\fn FutureProgress *Core::ProgressManager::addTask(const QFuture<void> &future, const QString &title, const QString &type, ProgressFlags flags = 0)
Shows a progress indicator for t
he
given
task
.
Shows a progress indicator for t
ask
given
by the QFuture object \a future
.
The progress indicator shows the specified \a title along with the progress bar.
The \a type of a task will specify a logical grouping with other
running tasks. Via the \a flags parameter you can e.g. let the
progress indicator stay visible after the task has finished.
Returns an object that represents the created progress indicator,
which can be used to further customize.
which can be used to further customize. The FutureProgress object's
life is managed by the ProgressManager and is guaranteed to live
*/
/*!
...
...
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