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
08823609
Commit
08823609
authored
Jan 28, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: EPG, propagate the infos when clicking on an Item
parent
e0a92345
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
2 deletions
+31
-2
modules/gui/qt4/components/epg/EPGItem.cpp
modules/gui/qt4/components/epg/EPGItem.cpp
+12
-0
modules/gui/qt4/components/epg/EPGItem.hpp
modules/gui/qt4/components/epg/EPGItem.hpp
+3
-0
modules/gui/qt4/components/epg/EPGView.cpp
modules/gui/qt4/components/epg/EPGView.cpp
+5
-0
modules/gui/qt4/components/epg/EPGView.hpp
modules/gui/qt4/components/epg/EPGView.hpp
+4
-1
modules/gui/qt4/components/epg/EPGWidget.cpp
modules/gui/qt4/components/epg/EPGWidget.cpp
+3
-0
modules/gui/qt4/dialogs/epg.cpp
modules/gui/qt4/dialogs/epg.cpp
+4
-1
No files found.
modules/gui/qt4/components/epg/EPGItem.cpp
View file @
08823609
...
...
@@ -26,9 +26,12 @@
#include <QFontMetrics>
#include <QDebug>
#include <QDateTime>
#include <QFocusEvent>
#include <QGraphicsScene>
#include "EPGItem.hpp"
#include "EPGView.hpp"
#include "EPGEvent.hpp"
EPGItem
::
EPGItem
(
EPGView
*
view
)
:
m_view
(
view
)
...
...
@@ -36,6 +39,7 @@ EPGItem::EPGItem( EPGView *view )
m_current
=
false
;
m_boundingRect
.
setHeight
(
TRACKS_HEIGHT
);
setFlags
(
QGraphicsItem
::
ItemIsSelectable
|
QGraphicsItem
::
ItemIsFocusable
);
}
QRectF
EPGItem
::
boundingRect
()
const
...
...
@@ -142,3 +146,11 @@ void EPGItem::setCurrent( bool current )
{
m_current
=
current
;
}
void
EPGItem
::
focusInEvent
(
QFocusEvent
*
event
)
{
EPGEvent
*
evEPG
=
new
EPGEvent
(
m_name
);
evEPG
->
description
=
m_description
;
evEPG
->
shortDescription
=
m_shortDescription
;
m_view
->
eventFocused
(
evEPG
);
}
modules/gui/qt4/components/epg/EPGItem.hpp
View file @
08823609
...
...
@@ -53,6 +53,9 @@ public:
void
setShortDescription
(
const
QString
&
shortDescription
);
void
setCurrent
(
bool
current
);
protected:
virtual
void
focusInEvent
(
QFocusEvent
*
event
);
private:
EPGView
*
m_view
;
QRectF
m_boundingRect
;
...
...
modules/gui/qt4/components/epg/EPGView.cpp
View file @
08823609
...
...
@@ -135,3 +135,8 @@ void EPGView::updateDuration()
m_duration
=
m_startTime
.
secsTo
(
lastItem
);
emit
durationChanged
(
m_duration
);
}
void
EPGView
::
eventFocused
(
EPGEvent
*
ev
)
{
emit
eventFocusedChanged
(
ev
);
}
modules/gui/qt4/components/epg/EPGView.hpp
View file @
08823609
...
...
@@ -52,7 +52,7 @@ public:
signals:
void
startTimeChanged
(
const
QDateTime
&
startTime
);
void
durationChanged
(
int
seconds
);
void
eventFocusedChanged
(
EPGEvent
*
);
protected:
virtual
void
drawBackground
(
QPainter
*
painter
,
const
QRectF
&
rect
);
...
...
@@ -60,6 +60,9 @@ protected:
QDateTime
m_startTime
;
int
m_scaleFactor
;
int
m_duration
;
public
slots
:
void
eventFocused
(
EPGEvent
*
);
};
#endif // EPGVIEW_H
modules/gui/qt4/components/epg/EPGWidget.cpp
View file @
08823609
...
...
@@ -32,6 +32,7 @@ ChannelsWidget::ChannelsWidget( QWidget *parent ) : QWidget( parent )
{
setContentsMargins
(
0
,
0
,
0
,
0
);
setMaximumWidth
(
50
);
setFocusPolicy
(
Qt
::
ClickFocus
);
}
EPGWidget
::
EPGWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
...
...
@@ -59,6 +60,8 @@ EPGWidget::EPGWidget( QWidget *parent ) : QWidget( parent )
m_rulerWidget
,
SLOT
(
setDuration
(
int
)
)
);
connect
(
m_epgView
->
horizontalScrollBar
(),
SIGNAL
(
valueChanged
(
int
)
),
m_rulerWidget
,
SLOT
(
setOffset
(
int
)
)
);
connect
(
m_epgView
,
SIGNAL
(
eventFocusedChanged
(
EPGEvent
*
)),
this
,
SIGNAL
(
itemSelectionChanged
(
EPGEvent
*
))
);
}
void
EPGWidget
::
setZoom
(
int
level
)
...
...
modules/gui/qt4/dialogs/epg.cpp
View file @
08823609
...
...
@@ -92,7 +92,10 @@ void EpgDialog::showEvent( EPGEvent *event )
if
(
!
event
)
return
;
title
->
setText
(
event
->
name
);
description
->
setText
(
event
->
description
);
if
(
!
event
->
description
.
isEmpty
()
)
description
->
setText
(
event
->
description
);
else
description
->
setText
(
event
->
shortDescription
);
}
void
EpgDialog
::
update
()
...
...
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