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
17786c59
Commit
17786c59
authored
Nov 09, 2009
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: fix build with Qt < 4.5
parent
75dcb251
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
modules/gui/qt4/util/customwidgets.cpp
modules/gui/qt4/util/customwidgets.cpp
+18
-9
modules/gui/qt4/util/customwidgets.hpp
modules/gui/qt4/util/customwidgets.hpp
+3
-1
No files found.
modules/gui/qt4/util/customwidgets.cpp
View file @
17786c59
...
...
@@ -147,21 +147,32 @@ void SearchLineEdit::updateText( const QString& text )
}
QVLCIconLabel
::
QVLCIconLabel
(
const
QIcon
&
i
,
QWidget
*
p
)
:
QLabel
(
p
),
icon
(
i
)
:
QLabel
(
p
),
icon
(
i
)
,
iconMode
(
QIcon
::
Normal
)
{
setPixmap
(
icon
.
pixmap
(
pixmapSize
(
QIcon
::
Normal
),
QIcon
::
Normal
)
);
updatePixmap
(
);
}
void
QVLCIconLabel
::
setIcon
(
const
QIcon
&
i
)
{
icon
=
i
;
}
{
icon
=
i
;
updatePixmap
();
}
void
QVLCIconLabel
::
resizeEvent
(
QResizeEvent
*
event
)
{
updatePixmap
();
}
void
QVLCIconLabel
::
enterEvent
(
QEvent
*
)
{
setPixmap
(
icon
.
pixmap
(
pixmapSize
(
QIcon
::
Active
),
QIcon
::
Active
)
);
iconMode
=
QIcon
::
Active
;
updatePixmap
();
}
void
QVLCIconLabel
::
leaveEvent
(
QEvent
*
)
{
setPixmap
(
icon
.
pixmap
(
pixmapSize
(
QIcon
::
Normal
),
QIcon
::
Normal
)
);
iconMode
=
QIcon
::
Normal
;
updatePixmap
();
}
void
QVLCIconLabel
::
mouseReleaseEvent
(
QMouseEvent
*
)
...
...
@@ -169,11 +180,9 @@ void QVLCIconLabel::mouseReleaseEvent( QMouseEvent * )
emit
clicked
();
}
QSize
QVLCIconLabel
::
pixmapSize
(
QIcon
::
Mode
mode
,
QIcon
::
State
state
)
void
QVLCIconLabel
::
updatePixmap
(
)
{
QList
<
QSize
>
sizes
=
icon
.
availableSizes
(
mode
,
state
);
if
(
sizes
.
isEmpty
()
)
sizes
=
icon
.
availableSizes
();
return
(
!
sizes
.
isEmpty
()
?
sizes
[
0
]
:
QSize
()
);
setPixmap
(
icon
.
pixmap
(
size
(),
iconMode
)
);
}
/***************************************************************************
...
...
modules/gui/qt4/util/customwidgets.hpp
View file @
17786c59
...
...
@@ -88,9 +88,11 @@ protected:
virtual
void
enterEvent
(
QEvent
*
);
virtual
void
leaveEvent
(
QEvent
*
);
virtual
void
mouseReleaseEvent
(
QMouseEvent
*
);
virtual
void
resizeEvent
(
QResizeEvent
*
);
private:
inline
QSize
pixmapSize
(
QIcon
::
Mode
=
QIcon
::
Normal
,
QIcon
::
State
=
QIcon
::
Off
);
inline
void
updatePixmap
(
);
QIcon
icon
;
QIcon
::
Mode
iconMode
;
};
/*****************************************************************
...
...
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