Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ff7967cb
Commit
ff7967cb
authored
Mar 22, 2010
by
Thorbjørn Lindeijer
Browse files
Namespace ProgressBar and FadeWidgetHack appropriately
They're internal classes of the core plugin.
parent
0981b1c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/progressmanager/futureprogress.cpp
View file @
ff7967cb
...
...
@@ -43,9 +43,33 @@
#include
<utils/stylehelper.h>
using
namespace
Core
;
using
namespace
Core
::
Internal
;
const
int
notificationTimeout
=
8000
;
namespace
Core
{
namespace
Internal
{
class
FadeWidgetHack
:
public
QWidget
{
Q_OBJECT
Q_PROPERTY
(
float
opacity
READ
opacity
WRITE
setOpacity
)
public:
FadeWidgetHack
(
QWidget
*
parent
)
:
QWidget
(
parent
),
m_opacity
(
0
){
setAttribute
(
Qt
::
WA_TransparentForMouseEvents
);
}
void
paintEvent
(
QPaintEvent
*
);
void
setOpacity
(
float
o
)
{
m_opacity
=
o
;
update
();
}
float
opacity
()
const
{
return
m_opacity
;
}
private:
float
m_opacity
;
};
}
// namespace Internal
}
// namespace Core
void
FadeWidgetHack
::
paintEvent
(
QPaintEvent
*
)
{
if
(
m_opacity
==
0
)
...
...
@@ -285,3 +309,5 @@ void FutureProgress::fadeAway()
animation
->
start
(
QAbstractAnimation
::
DeleteWhenStopped
);
connect
(
animation
,
SIGNAL
(
finished
()),
this
,
SIGNAL
(
removeMe
()));
}
#include
"futureprogress.moc"
src/plugins/coreplugin/progressmanager/futureprogress.h
View file @
ff7967cb
...
...
@@ -42,26 +42,12 @@ class QProgressBar;
class
QHBoxLayout
;
QT_END_NAMESPACE
class
ProgressBar
;
namespace
Core
{
class
FadeWidgetHack
:
public
QWidget
{
Q_OBJECT
Q_PROPERTY
(
float
opacity
READ
opacity
WRITE
setOpacity
)
public:
FadeWidgetHack
(
QWidget
*
parent
)
:
QWidget
(
parent
),
m_opacity
(
0
){
setAttribute
(
Qt
::
WA_TransparentForMouseEvents
);
}
void
paintEvent
(
QPaintEvent
*
);
void
setOpacity
(
float
o
)
{
m_opacity
=
o
;
update
();
}
float
opacity
()
const
{
return
m_opacity
;
}
private:
float
m_opacity
;
};
namespace
Internal
{
class
ProgressBar
;
class
FadeWidgetHack
;
}
// namespace Internal
class
CORE_EXPORT
FutureProgress
:
public
QWidget
{
...
...
@@ -111,14 +97,13 @@ private slots:
private:
QFutureWatcher
<
void
>
m_watcher
;
ProgressBar
*
m_progress
;
Internal
::
ProgressBar
*
m_progress
;
QWidget
*
m_widget
;
QHBoxLayout
*
m_widgetLayout
;
QString
m_type
;
bool
m_keep
;
bool
m_waitingForUserInteraction
;
FadeWidgetHack
*
m_faderWidget
;
Internal
::
FadeWidgetHack
*
m_faderWidget
;
};
}
// namespace Core
...
...
src/plugins/coreplugin/progressmanager/progressbar.cpp
View file @
ff7967cb
...
...
@@ -37,7 +37,9 @@
#include
<QtGui/QBrush>
#include
<QtGui/QColor>
#include
<QtGui/QMouseEvent>
#include
<QtDebug>
using
namespace
Core
;
using
namespace
Core
::
Internal
;
#define PROGRESSBAR_HEIGHT 13
#define CANCELBUTTON_SIZE 15
...
...
src/plugins/coreplugin/progressmanager/progressbar.h
View file @
ff7967cb
...
...
@@ -33,6 +33,9 @@
#include
<QtCore/QString>
#include
<QtGui/QWidget>
namespace
Core
{
namespace
Internal
{
class
ProgressBar
:
public
QWidget
{
Q_OBJECT
...
...
@@ -77,7 +80,9 @@ private:
int
m_maximum
;
int
m_value
;
float
m_fader
;
};
}
// namespace Internal
}
// namespace Core
#endif // PROGRESSPIE_H
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment