#include <SlideBarItem.h>
Inherits QObject, and QGraphicsItem.
Definition at line 8 of file SlideBarItem.h.
◆ SlideBarItem()
| SlideBarItem::SlideBarItem |
( |
unsigned |
startIndex, |
|
|
unsigned |
steps, |
|
|
unsigned |
stepSize, |
|
|
QGraphicsItem * |
parent = 0 |
|
) |
| |
Definition at line 9 of file SlideBarItem.cc.
10 QGraphicsItem(parent),height(10),width(100), color(QColor(Qt::gray))
14 allSliders.append(slider);
void reconfigure(unsigned startIndex, unsigned steps, unsigned stepSize)
◆ addTimeMarker()
Definition at line 72 of file SlideBarItem.cc.
73 timeMarkers.append(marker);
74 allSliders.append(marker);
unsigned markerIndex(Slider *marker)
void setLastIndex(unsigned index)
◆ bookmarkClicked
| void SlideBarItem::bookmarkClicked |
( |
int |
idx | ) |
|
|
signal |
◆ boundingRect()
| QRectF SlideBarItem::boundingRect |
( |
| ) |
const |
◆ getAllSliders()
| const QList< Slider * > & SlideBarItem::getAllSliders |
( |
| ) |
|
◆ getBookmarkHeight()
| qreal SlideBarItem::getBookmarkHeight |
( |
| ) |
const |
◆ getHeight()
| int SlideBarItem::getHeight |
( |
| ) |
const |
◆ getIndexSlider()
◆ getStartIndex()
| unsigned SlideBarItem::getStartIndex |
( |
| ) |
const |
◆ getTimeMarkers()
◆ getWidth()
| int SlideBarItem::getWidth |
( |
| ) |
const |
◆ markerContainsPoint()
| bool SlideBarItem::markerContainsPoint |
( |
BoundarySlider * |
marker, |
|
|
const QPointF & |
point |
|
) |
| |
Definition at line 119 of file SlideBarItem.cc.
121 if(otherMarker == marker) {
124 if(otherMarker->contains(point)) {
◆ markerIndex()
| unsigned SlideBarItem::markerIndex |
( |
Slider * |
marker | ) |
|
Definition at line 131 of file SlideBarItem.cc.
134 return (
unsigned) QStyle::sliderValueFromPosition(startIndex, steps*stepSize, marker->pos().x(),
getWidth());
◆ markerOverlap()
Definition at line 86 of file SlideBarItem.cc.
88 if(otherMarker == marker) {
97 if(marker->pos().x() < otherMarker->pos().x()) {
103 if(marker->pos().x() >= otherMarker->pos().x()) {
108 std::cerr <<
"Unknown direction!" << std::endl;
112 if(marker->collidesWithItem(otherMarker) || overlap) {
Direction leftRight(BoundarySlider *otherMarker)
◆ markerPositionForIndex()
| int SlideBarItem::markerPositionForIndex |
( |
unsigned |
index | ) |
|
Definition at line 137 of file SlideBarItem.cc.
138 return QStyle::sliderPositionFromValue(startIndex, steps*stepSize, index,
getWidth());
◆ mousePressEvent()
| void SlideBarItem::mousePressEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
Definition at line 150 of file SlideBarItem.cc.
152 Q_FOREACH(
int bookmark, bookmarks) {
155 if(clickRegion.contains(event->pos())) {
int markerPositionForIndex(unsigned index)
qreal getBookmarkHeight() const
void bookmarkClicked(int idx)
◆ paint()
| void SlideBarItem::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
option, |
|
|
QWidget * |
widget |
|
) |
| |
Definition at line 28 of file SlideBarItem.cc.
31 painter->setPen(QPen(Qt::black, 1));
32 painter->setBrush(QBrush(color));
35 Q_FOREACH(
unsigned bookmark, bookmarks) {
39 painter->drawLine(x_pos, y_top, x_pos, y_bottom);
int markerPositionForIndex(unsigned index)
qreal getBookmarkHeight() const
◆ reconfigure()
| void SlideBarItem::reconfigure |
( |
unsigned |
startIndex, |
|
|
unsigned |
steps, |
|
|
unsigned |
stepSize |
|
) |
| |
Definition at line 17 of file SlideBarItem.cc.
18 LOG_DEBUG(
"Reconfiguring slidebar: startIndex=%d, steps=%d, stepSize=%d\n", startIndex, steps, stepSize);
19 this->startIndex = startIndex;
21 this->stepSize = stepSize;
◆ setBookmarkHeight()
| void SlideBarItem::setBookmarkHeight |
( |
qreal |
height | ) |
|
Definition at line 52 of file SlideBarItem.cc.
53 this->bookmark_height = bookmark_height;
◆ setHeight()
| void SlideBarItem::setHeight |
( |
int |
width | ) |
|
◆ setIndexSliderHeight()
| void SlideBarItem::setIndexSliderHeight |
( |
int |
height | ) |
|
◆ setWidth()
| void SlideBarItem::setWidth |
( |
int |
width | ) |
|
◆ updateBookmarks()
| void SlideBarItem::updateBookmarks |
( |
QVector< int > & |
bookmarks | ) |
|
◆ HEIGHT
| const int SlideBarItem::HEIGHT = 3 |
|
static |
The documentation for this class was generated from the following files:
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/timeline/SlideBarItem.h
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/timeline/SlideBarItem.cc