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
1beb0074
Commit
1beb0074
authored
Jul 15, 2013
by
Ludovic Fauvet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: QProxyStyle is the new way to extend styles in Qt5
parent
1c9516cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
modules/gui/qt4/styles/seekstyle.cpp
modules/gui/qt4/styles/seekstyle.cpp
+10
-4
modules/gui/qt4/styles/seekstyle.hpp
modules/gui/qt4/styles/seekstyle.hpp
+3
-3
No files found.
modules/gui/qt4/styles/seekstyle.cpp
View file @
1beb0074
...
@@ -24,7 +24,8 @@
...
@@ -24,7 +24,8 @@
#include "util/input_slider.hpp"
#include "util/input_slider.hpp"
#include "adapters/seekpoints.hpp"
#include "adapters/seekpoints.hpp"
#include <QWindowsStyle>
#include <QProxyStyle>
#include <QStyleFactory>
#include <QStyleOptionSlider>
#include <QStyleOptionSlider>
#include <QPainter>
#include <QPainter>
#include <QDebug>
#include <QDebug>
...
@@ -32,6 +33,11 @@
...
@@ -32,6 +33,11 @@
#define RADIUS 3
#define RADIUS 3
#define CHAPTERSSPOTSIZE 3
#define CHAPTERSSPOTSIZE 3
SeekStyle
::
SeekStyle
()
:
QProxyStyle
(
QStyleFactory
::
create
(
QLatin1String
(
"Windows"
)
)
)
{
}
int
SeekStyle
::
pixelMetric
(
PixelMetric
metric
,
const
QStyleOption
*
option
,
const
QWidget
*
widget
)
const
int
SeekStyle
::
pixelMetric
(
PixelMetric
metric
,
const
QStyleOption
*
option
,
const
QWidget
*
widget
)
const
{
{
const
QStyleOptionSlider
*
slider
;
const
QStyleOptionSlider
*
slider
;
...
@@ -39,7 +45,7 @@ int SeekStyle::pixelMetric( PixelMetric metric, const QStyleOption *option, cons
...
@@ -39,7 +45,7 @@ int SeekStyle::pixelMetric( PixelMetric metric, const QStyleOption *option, cons
if
(
metric
==
PM_SliderLength
&&
(
slider
=
qstyleoption_cast
<
const
QStyleOptionSlider
*>
(
option
)
)
)
if
(
metric
==
PM_SliderLength
&&
(
slider
=
qstyleoption_cast
<
const
QStyleOptionSlider
*>
(
option
)
)
)
return
slider
->
rect
.
height
();
return
slider
->
rect
.
height
();
else
else
return
Q
Windows
Style
::
pixelMetric
(
metric
,
option
,
widget
);
return
Q
Proxy
Style
::
pixelMetric
(
metric
,
option
,
widget
);
}
}
void
SeekStyle
::
drawComplexControl
(
ComplexControl
cc
,
const
QStyleOptionComplex
*
option
,
QPainter
*
painter
,
const
QWidget
*
widget
)
const
void
SeekStyle
::
drawComplexControl
(
ComplexControl
cc
,
const
QStyleOptionComplex
*
option
,
QPainter
*
painter
,
const
QWidget
*
widget
)
const
...
@@ -121,7 +127,7 @@ void SeekStyle::drawComplexControl( ComplexControl cc, const QStyleOptionComplex
...
@@ -121,7 +127,7 @@ void SeekStyle::drawComplexControl( ComplexControl cc, const QStyleOptionComplex
if
(
slider
->
subControls
&
SC_SliderTickmarks
)
{
if
(
slider
->
subControls
&
SC_SliderTickmarks
)
{
QStyleOptionSlider
tmpSlider
=
*
slider
;
QStyleOptionSlider
tmpSlider
=
*
slider
;
tmpSlider
.
subControls
=
SC_SliderTickmarks
;
tmpSlider
.
subControls
=
SC_SliderTickmarks
;
Q
Windows
Style
::
drawComplexControl
(
cc
,
&
tmpSlider
,
painter
,
widget
);
Q
Proxy
Style
::
drawComplexControl
(
cc
,
&
tmpSlider
,
painter
,
widget
);
}
}
if
(
slider
->
subControls
&
SC_SliderHandle
&&
handle
.
isValid
()
)
if
(
slider
->
subControls
&
SC_SliderHandle
&&
handle
.
isValid
()
)
...
@@ -202,6 +208,6 @@ void SeekStyle::drawComplexControl( ComplexControl cc, const QStyleOptionComplex
...
@@ -202,6 +208,6 @@ void SeekStyle::drawComplexControl( ComplexControl cc, const QStyleOptionComplex
else
else
{
{
qWarning
()
<<
"SeekStyle: Drawing an unmanaged control"
;
qWarning
()
<<
"SeekStyle: Drawing an unmanaged control"
;
Q
Windows
Style
::
drawComplexControl
(
cc
,
option
,
painter
,
widget
);
Q
Proxy
Style
::
drawComplexControl
(
cc
,
option
,
painter
,
widget
);
}
}
}
}
modules/gui/qt4/styles/seekstyle.hpp
View file @
1beb0074
...
@@ -23,14 +23,14 @@
...
@@ -23,14 +23,14 @@
#ifndef SEEKSTYLE_HPP
#ifndef SEEKSTYLE_HPP
#define SEEKSTYLE_HPP
#define SEEKSTYLE_HPP
#include <Q
Windows
Style>
#include <Q
Proxy
Style>
class
SeekStyle
:
public
Q
Windows
Style
class
SeekStyle
:
public
Q
Proxy
Style
{
{
Q_OBJECT
Q_OBJECT
public:
public:
SeekStyle
()
{
}
SeekStyle
()
;
virtual
int
pixelMetric
(
PixelMetric
metric
,
const
QStyleOption
*
option
=
0
,
const
QWidget
*
widget
=
0
)
const
;
virtual
int
pixelMetric
(
PixelMetric
metric
,
const
QStyleOption
*
option
=
0
,
const
QWidget
*
widget
=
0
)
const
;
virtual
void
drawComplexControl
(
ComplexControl
cc
,
const
QStyleOptionComplex
*
opt
,
QPainter
*
p
,
const
QWidget
*
widget
)
const
;
virtual
void
drawComplexControl
(
ComplexControl
cc
,
const
QStyleOptionComplex
*
opt
,
QPainter
*
p
,
const
QWidget
*
widget
)
const
;
};
};
...
...
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