Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d14bb18c
Commit
d14bb18c
authored
Jan 10, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: fix a sticking slider issue.
Close #3105
parent
3684f450
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+16
-7
No files found.
modules/gui/qt4/util/input_slider.cpp
View file @
d14bb18c
...
@@ -41,18 +41,23 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
...
@@ -41,18 +41,23 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
QSlider
(
q
,
_parent
)
QSlider
(
q
,
_parent
)
{
{
b_isSliding
=
false
;
b_isSliding
=
false
;
lastSeeked
=
0
;
lastSeeked
=
0
;
timer
=
new
QTimer
(
this
);
timer
=
new
QTimer
(
this
);
timer
->
setSingleShot
(
true
);
timer
->
setSingleShot
(
true
);
setMinimum
(
0
);
setMouseTracking
(
true
);
/* Properties */
set
Maximum
(
1000
);
set
Range
(
0
,
1000
);
setSingleStep
(
2
);
setSingleStep
(
2
);
setPageStep
(
10
);
setPageStep
(
10
);
setMouseTracking
(
true
);
setTracking
(
true
);
setTracking
(
true
);
setFocusPolicy
(
Qt
::
NoFocus
);
/* Init to 0 */
setPosition
(
-
1.0
,
0
,
0
);
setPosition
(
-
1.0
,
0
,
0
);
secstotimestr
(
psz_length
,
0
);
secstotimestr
(
psz_length
,
0
);
setFocusPolicy
(
Qt
::
NoFocus
);
CONNECT
(
this
,
valueChanged
(
int
),
this
,
userDrag
(
int
)
);
CONNECT
(
this
,
valueChanged
(
int
),
this
,
userDrag
(
int
)
);
CONNECT
(
timer
,
timeout
(),
this
,
seekTick
()
);
CONNECT
(
timer
,
timeout
(),
this
,
seekTick
()
);
}
}
...
@@ -60,7 +65,10 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
...
@@ -60,7 +65,10 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
void
InputSlider
::
setPosition
(
float
pos
,
int
a
,
int
b
)
void
InputSlider
::
setPosition
(
float
pos
,
int
a
,
int
b
)
{
{
if
(
pos
==
-
1.0
)
if
(
pos
==
-
1.0
)
{
setEnabled
(
false
);
setEnabled
(
false
);
b_isSliding
=
false
;
}
else
else
setEnabled
(
true
);
setEnabled
(
true
);
...
@@ -73,12 +81,13 @@ void InputSlider::setPosition( float pos, int a, int b )
...
@@ -73,12 +81,13 @@ void InputSlider::setPosition( float pos, int a, int b )
void
InputSlider
::
userDrag
(
int
new_value
)
void
InputSlider
::
userDrag
(
int
new_value
)
{
{
if
(
b_isSliding
&&
!
timer
->
isActive
()
)
if
(
b_isSliding
&&
!
timer
->
isActive
()
)
timer
->
start
(
150
);
timer
->
start
(
150
);
}
}
void
InputSlider
::
seekTick
()
void
InputSlider
::
seekTick
()
{
{
if
(
value
()
!=
lastSeeked
)
{
if
(
value
()
!=
lastSeeked
)
{
lastSeeked
=
value
();
lastSeeked
=
value
();
float
f_pos
=
(
float
)(
lastSeeked
)
/
1000.0
;
float
f_pos
=
(
float
)(
lastSeeked
)
/
1000.0
;
emit
sliderDragged
(
f_pos
);
emit
sliderDragged
(
f_pos
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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